V
- the graph vertex typeE
- the graph edge typepublic class HierholzerEulerianCycle<V,E> extends Object implements EulerianCycleAlgorithm<V,E>
See the Wikipedia article for details and references about Eulerian cycles and a short description of Hierholzer's algorithm for the construction of an Eulerian cycle. The original presentation of the algorithm dates back to 1873 and the following paper: Carl Hierholzer: Über die Möglichkeit, einen Linienzug ohne Wiederholung und ohne Unterbrechung zu umfahren. Mathematische Annalen 6(1), 30–32, 1873.
Constructor and Description |
---|
HierholzerEulerianCycle() |
Modifier and Type | Method and Description |
---|---|
GraphPath<V,E> |
getEulerianCycle(Graph<V,E> g)
Compute an Eulerian cycle of a graph.
|
boolean |
isEulerian(Graph<V,E> graph)
Test whether a graph is Eulerian.
|
public boolean isEulerian(Graph<V,E> graph)
graph
- the input graphpublic GraphPath<V,E> getEulerianCycle(Graph<V,E> g)
getEulerianCycle
in interface EulerianCycleAlgorithm<V,E>
g
- the input graphIllegalArgumentException
- in case the graph is not EulerianCopyright © 2018. All rights reserved.