Package org.jgrapht.alg.cycle
Interface DirectedSimpleCycles<V,E>
-
- Type Parameters:
V
- the vertex type.E
- the edge type.
- All Known Implementing Classes:
HawickJamesSimpleCycles
,JohnsonSimpleCycles
,SzwarcfiterLauerSimpleCycles
,TarjanSimpleCycles
,TiernanSimpleCycles
public interface DirectedSimpleCycles<V,E>
A common interface for classes implementing algorithms for enumeration of the simple cycles of a directed graph.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<java.util.List<V>>
findSimpleCycles()
Finds the simple cycles of the graph.
Note that the full algorithm is executed on every call since the graph may have changed between calls.DirectedGraph<V,E>
getGraph()
Returns the graph on which the simple cycle search algorithm is executed by this object.void
setGraph(DirectedGraph<V,E> graph)
Sets the graph on which the simple cycle search algorithm is executed by this object.
-
-
-
Method Detail
-
getGraph
DirectedGraph<V,E> getGraph()
Returns the graph on which the simple cycle search algorithm is executed by this object.- Returns:
- The graph.
-
setGraph
void setGraph(DirectedGraph<V,E> graph)
Sets the graph on which the simple cycle search algorithm is executed by this object.- Parameters:
graph
- the graph.- Throws:
java.lang.IllegalArgumentException
- if the argument isnull
.
-
findSimpleCycles
java.util.List<java.util.List<V>> findSimpleCycles()
Finds the simple cycles of the graph.
Note that the full algorithm is executed on every call since the graph may have changed between calls.- Returns:
- The list of all simple cycles. Possibly empty but never
null
. - Throws:
java.lang.IllegalArgumentException
- if the current graph is null.
-
-