kriegaex/jgrapht: No Hamiltonian cycle (HC) found

35 Views Asked by At

I am not found place open issue in github https://github.com/kriegaex/jgrapht I test code

Graph<String, DefaultEdge> graph = GraphTypeBuilder
  .<String, DefaultEdge>directed()
  .allowingMultipleEdges(false)
  .allowingSelfLoops(false)
  .edgeClass(DefaultEdge.class)
  .buildGraph();

graph.addVertex("a");
graph.addVertex("b");
graph.addVertex("c");
graph.addVertex("d");
graph.addEdge("a", "b");
graph.addEdge("b", "c");
graph.addEdge("c", "a");
graph.addEdge("c", "d");
graph.addEdge("d", "b");

new CyclicTransitiveReduction<>(graph).reduce();

it give me an runtime exception (line breaks added)

java.lang.RuntimeException:
  No Hamiltonian cycle (HC) found.
  This should never happen and indicates an error in the algorithm,
  because the graph is strongly connected and a HC must therefore exist.

don't raise exception

0

There are 0 best solutions below