The documentation for retworkx has migrated to:
These docs will no longer be updated.
- class EdgeList¶
A custom class for the return of edge lists
This class is a container class for the results of functions that return a list of edges. It implements the Python sequence protocol. So you can treat the return as a read-only sequence/list that is integer indexed. If you want to use it as an iterator you can by wrapping it in an
iter()that will yield the results in order.
import retworkx graph = retworkx.generators.directed_path_graph(5) edges = graph.edge_list() # Index based access third_element = edges # Use as iterator edges_iter = iter(edges) first_element = next(edges_iter) second_element = next(edges_iter)
Initialize self. See help(type(self)) for accurate signature.