order the nodes of a digraph in topological (i.e. execution) order.
Definition at line 83 of file graphAlgs.py.
◆ __init__()
| graphAlgs.Topological.__init__ |
( |
| self, |
|
|
| G, |
|
|
| roots = [] ) |
Definition at line 86 of file graphAlgs.py.
86 def __init__(self, G, roots=[]):
87 self.marked = [False for i in range(G.V)]
88 self.order_ = []
89 cycleFinder = DirectedCycle(G)
90 if not cycleFinder.has_cycle():
91 dfs = DepthFirstOrder(G, roots)
92
93
94
95 self.order_ = dfs.post()
96
◆ isDAG()
| graphAlgs.Topological.isDAG |
( |
| self | ) |
|
Definition at line 100 of file graphAlgs.py.
100 def isDAG(self):
101 return len(self.order_) != 0
◆ order()
| graphAlgs.Topological.order |
( |
| self | ) |
|
Definition at line 97 of file graphAlgs.py.
97 def order(self):
98 return self.order_
99
◆ marked
| list graphAlgs.Topological.marked = [False for i in range(G.V)] |
◆ order_
| graphAlgs.Topological.order_ = [] |
The documentation for this class was generated from the following file: