This SAGE worksheet gives a rudimentary method used to compute the zero forcing number of a directed graph as well as its propagation time.
The code (with too many comments) needed to compute these is given below.
|
To use this first form a directed graph (digraph) in SAGE and then pass it into the zero_forcing function. There are several ways to form a digraph.
We illustrate each of these below and give examples of using the zero forcing process.
|
[0, 2] [0, 2] |
([0, 2], 3) ([0, 2], 3) |
|
[3, 5] [3, 5] |
([3, 5], 3) ([3, 5], 3) |
|
[0, 3, 7, 8, 9, 19] [0, 3, 7, 8, 9, 19] |
([8, 9, 10, 12, 17, 19], 4) ([8, 9, 10, 12, 17, 19], 4) |
|