• Home
  • Raw
  • Download

Lines Matching +full:ts +full:- +full:node

1 :mod:`graphlib` --- Functionality to operate with graph-like structures
5 :synopsis: Functionality to operate with graph-like structures
15 --------------
23 for every directed edge u -> v from vertex u to vertex v, vertex u comes
33 are iterables of all predecessors of that node in the graph (the nodes that
46 process them. Call :meth:`~TopologicalSorter.done` on each node as it
56 >>> ts = TopologicalSorter(graph)
57 >>> tuple(ts.static_order())
69 for node in topological_sorter.get_ready():
72 task_queue.put(node)
74 # When the work for a node is done, workers put the node in
77 # least one node has been placed on 'task_queue' that hasn't yet
82 node = finalized_tasks_queue.get()
83 topological_sorter.done(node)
85 .. method:: add(node, *predecessors)
87 Add a new node and its predecessors to the graph. Both the *node* and all
90 If called multiple times with the same node argument, the set of
93 It is possible to add a node with no dependencies (*predecessors* is not
94 provided) or to provide a dependency twice. If a node that has not been
121 if ts.is_active():
126 if ts:
135 processed, unblocking any successor of each node in *nodes* for being
138 Raises :exc:`ValueError` if any node in *nodes* has already been marked as
139 processed by a previous call to this method or if a node was not added to
141 calling :meth:`~TopologicalSorter.prepare` or if node has not yet been
174 >>> ts = TopologicalSorter()
175 >>> ts.add(3, 2, 1)
176 >>> ts.add(1, 0)
177 >>> print([*ts.static_order()])
198 ----------
208 attribute of the exception instance and consists in a list of nodes, such that each node is,
209 in the graph, an immediate predecessor of the next node in the list. In the reported list,
210 the first and the last node will be the same, to make it clear that it is cyclic.