differt_core.rt.AllPathsFromCompleteGraphIter#
- class AllPathsFromCompleteGraphIter#
Bases:
objectAn iterator over all paths in a complete graph.
Note
Even though this iterator is generally sized, this is not true when its length is so large that overflow occurred when computing its theoretical length. A warning will be emitted in such cases, and the length will be set to the maximal representable value.
Methods
count()Count the number of elements in this iterator by consuming it.
Detailed documentation
- count()#
Count the number of elements in this iterator by consuming it.
This is much faster that counting the number of elements using Python code.
- Returns:
The number of elements that this iterator contains.
- Return type:
Warning
This iterator provides
len, which returns the current remaining length of this iterator, without consuming it, and will also be faster as it does not need to perform any iteration.