org.jgrapht.alg
Class EulerianCircuit
java.lang.Object
org.jgrapht.alg.EulerianCircuit
public abstract class EulerianCircuit
- extends java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EulerianCircuit
public EulerianCircuit()
isEulerian
public static <V,E> boolean isEulerian(UndirectedGraph<V,E> g)
- 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
public static <V,E> java.util.List<V> getEulerianCircuitVertices(UndirectedGraph<V,E> g)
- 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