public void HasOneOrMoreCycleTest() { DirectedGraph graph = TestGraphs.GetTestGraphWithoutLoop2(); Assert.IsFalse(graph.ContainsOneOrMoreCycles()); Assert.IsFalse(graph.ContainsOneOrMoreSelfLoops()); }
public void HasOneOrMoreCycleTest1() { DirectedGraph graph = TestGraphs.GetTestConnectedGraphWithSimpleLoop(); Assert.IsTrue(graph.ContainsOneOrMoreCycles()); Assert.IsFalse(graph.ContainsOneOrMoreSelfLoops()); Assert.IsTrue(graph.HasHamiltonianCycle(out _)); ISet <Cycle> cycles = graph.GetAllCycles(); Assert.AreEqual(1, cycles.Count); }