Beispiel #1
0
        static void Main(string[] args)
        {
            Graph graph = new Graph(4);

            AddEdgesToGraph(graph);
            graph.PrintVerticesMatrix();

            Console.WriteLine("BFS traversal starting from vertex 2:");
            BFS bfs = new BFS(graph);

            bfs.ExecuteAlgorithm(2);

            Console.WriteLine("DFS traversal starting from vertex 2:");
            DFS dfs = new DFS(graph);

            dfs.ExecuteAlgorithm(2);
        }