Exemple #1
0
        public static void TestGetAllPathsInGraphFromStartVertexToEndVertex()
        {
            DirectedGraph dg = GraphProbHelper.CreateDirectedGraph();

            Console.WriteLine("All the paths from start vertex to the end vertex are:");
            GetAllPathsInGraphFromStartVertexToEndVertex(dg.AllVertices[2], dg.AllVertices[3]);
        }
        public static void TestCheckBipartiteGraph()
        {
            DirectedGraph dg = GraphProbHelper.CreateDirectedGraph();

            Console.WriteLine("Can the graph nodes be colored: {0}", IsBiPartiteGraph(dg.AllVertices[2]));

            dg.RemoveEdge(0, 1);
            Console.WriteLine("Can the graph nodes be colored: {0}", IsBiPartiteGraph(dg.AllVertices[2]));
        }
        public static void TestColorVerticesWithDifferentColor()
        {
            DirectedGraph dg = GraphProbHelper.CreateDirectedGraph();

            Console.WriteLine("Can the graph nodes be colored: {0}", ColorVerticesWithDifferentColor(dg.AllVertices[2]));

            dg.RemoveEdge(0, 1);
            Console.WriteLine("Can the graph nodes be colored: {0}", ColorVerticesWithDifferentColor(dg.AllVertices[2]));
        }