Package org.graph4j.eulerian
Interface EulerianCircuitAlgorithm
- All Known Implementing Classes:
EulerianCircuitAlgorithmBase,HierholzerEulerianCircuit
public interface EulerianCircuitAlgorithm
An Eulerian circuit is an Eulerian trail (a trail that contains all
the edges of the graph) that has its endpoints connected.
A connected graph is Eulerian if and only if the degree of each vertex is
even.
A connected digraph is Eulerian if and only if the in-degree of each vertex
equals the out-degree of each vertex.
- Author:
- Cristian Frăsinaru
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic EulerianCircuitAlgorithmgetInstance(Graph graph) Returns the default implementation of the algorithm.boolean
-
Method Details
-
findCircuit
Circuit findCircuit()- Returns:
- an Eulerian circuit, or
nullif the graph is not Eulerian.
-
isEulerian
boolean isEulerian()- Returns:
trueif the graph is Eulerian
-
getInstance
Returns the default implementation of the algorithm.- Parameters:
graph- the input graph.- Returns:
- the default implementation of the algorithm.
-