public static void TestIsCycleInUnDirectedGraph() { UndirectedGraph udg = GraphProbHelper.CreateUndirectedGraphWithoutCycle(); Console.WriteLine("Is the cycle present in the undirected graph: {0}", IsCycleInUnDirectedGraph(udg)); udg = GraphProbHelper.CreateUndirectedGraphWithCycle(); Console.WriteLine("Is the cycle present in the undirected graph: {0}", IsCycleInUnDirectedGraph(udg)); }
public static void TestIsGraphATree() { IsGraphATree gt = new IsGraphATree(); UndirectedGraph udg = GraphProbHelper.CreateUndirectedGraphWithoutCycleWithoutUnconnectedNodes(); Console.WriteLine("Is the cycle present in the undirected graph: {0}", gt.IsGraphTree(udg)); udg = GraphProbHelper.CreateUndirectedGraphWithoutCycle(); Console.WriteLine("Is the cycle present in the undirected graph: {0}", gt.IsGraphTree(udg)); udg = GraphProbHelper.CreateUndirectedGraphWithCycle(); Console.WriteLine("Is the cycle present in the undirected graph: {0}", gt.IsGraphTree(udg)); }