use of org.jgrapht.alg.cycle.HierholzerEulerianCycle in project tutorials by eugenp.
the class EulerianCircuitTest method givenGraph_whenCheckEluerianCycle_thenGetResult.
@Test
public void givenGraph_whenCheckEluerianCycle_thenGetResult() {
HierholzerEulerianCycle eulerianCycle = new HierholzerEulerianCycle<>();
assertTrue(eulerianCycle.isEulerian(simpleGraph));
}
use of org.jgrapht.alg.cycle.HierholzerEulerianCycle in project tutorials by eugenp.
the class EulerianCircuitTest method givenGraphWithEulerianCircuit_whenGetEulerianCycle_thenGetGraphPath.
@Test
public void givenGraphWithEulerianCircuit_whenGetEulerianCycle_thenGetGraphPath() {
HierholzerEulerianCycle eulerianCycle = new HierholzerEulerianCycle<>();
GraphPath path = eulerianCycle.getEulerianCycle(simpleGraph);
assertTrue(path.getEdgeList().containsAll(simpleGraph.edgeSet()));
}
Aggregations