Package org.graph4j.spanning
Class SpanningTreeIterator
java.lang.Object
org.graph4j.spanning.SpanningTreeIterator
- All Implemented Interfaces:
Iterator<Collection<Edge>>
Iterates over all spanning trees of a graph.
The iterator returns the collection of edges of a spanning tree, which can be
used to create the actual tree with the method
Graph.subgraph(java.util.Collection).
This iterator should be used when the spanning trees are required without
taking into account the weight of the edges. If the spanning trees are
supposed to be returned in order by their weight, see
WeightedSpanningTreeIterator.- Author:
- Cristian Frăsinaru
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSpanningTreeIterator(Graph graph) Creates an iterator over the spanning trees of a graph. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
SpanningTreeIterator
Creates an iterator over the spanning trees of a graph.- Parameters:
graph- the input graph.
-
-
Method Details
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceIterator<Collection<Edge>>
-
next
- Specified by:
nextin interfaceIterator<Collection<Edge>>
-