edgegraph.traversal.depthfirst.idft_iterative

Contents

edgegraph.traversal.depthfirst.idft_iterative#

edgegraph.traversal.depthfirst.idft_iterative(uni, start, *, direction_sensitive=0, unknown_handling=2, ff_via=None, ff_result=None)#

Perform an iterative depth-first traversal of the given universe, starting at the given vertex (generator).

This algorithm used is similar to that in [KlTa05], algorithm 3.12. Slight modifications have been made to preclude re-visited vertices in the final list. This is a iterative implementation that returns a list of Vertex objects, in the order of the traversal performed.

Parameters:
  • uni (Universe) – The universe to traverse, or None for no universe limits.

  • start (Vertex) – Vertex to start searching at.

Returns:

A generator object yielding vertices in the order of an iterative depth-first traversal, in accordance with the set parameters.

Raises:

ValueError – if the start vertex is not a member of the specified universe, or if the universe is empty.

Return type:

Iterator[Vertex]