rustworkx.TopologicalSorter.done#

TopologicalSorter.done(nodes)#

Marks a set of nodes returned by “get_ready” as processed.

This method unblocks any successor of each node in nodes for being returned in the future by a call to “get_ready”.

Parameters:

nodes (int | list[int]) – A node index or list of node indices to mark as done.

Raises:
  • ValueError – If any node in nodes has already been marked as processed by a previous call to this method or node has not yet been returned by “get_ready”.

  • ValueError – If one of the given initial nodes is a direct successor of one of the nodes given to done(). This can only happen if the initial nodes had even a partial topological ordering amongst themselves, which is not a valid starting input.