Package org.jgrapht.alg
Class EulerianCircuit
java.lang.Object
org.jgrapht.alg.EulerianCircuit
This algorithm will check whether a graph is Eulerian (hence it contains an
Eulerian
circuit). Also, if a graph is Eulerian, the caller can obtain a list of
vertices making up the Eulerian circuit. An Eulerian circuit is a circuit
which traverses each edge exactly once.
- Since:
- Dec 21, 2008
- Author:
- Andrew Newell
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <V,
E> List <V> This method will return a list of vertices which represents the Eulerian circuit of the graph.static <V,
E> boolean isEulerian
(UndirectedGraph<V, E> g) This method will check whether the graph passed in is Eulerian or not.
-
Constructor Details
-
EulerianCircuit
public EulerianCircuit()
-
-
Method Details
-
isEulerian
This method will check whether the graph passed in is Eulerian or not.- Parameters:
g
- The graph to be checked- Returns:
- true for Eulerian and false for non-Eulerian
-
getEulerianCircuitVertices
This method will return a list of vertices which represents the Eulerian circuit of the graph.- Parameters:
g
- The graph to find an Eulerian circuit- Returns:
- null if no Eulerian circuit exists, or a list of vertices representing the Eulerian circuit if one does exist
-