コード例 #1
0
        private static void DemoDijkstraAlg()
        {
            graphWithAdjList = new GraphWithAdjacencyList();
            Console.WriteLine("Enter the Node to start with");
            char input = Console.ReadLine().Trim().ToUpper()[0];

            graphWithAdjList.GetDjikstraAlgResultOn(input);
        }
コード例 #2
0
        private static void DemoDepthFirstSearch()
        {
            graphWithAdjList = new GraphWithAdjacencyList();
            Console.WriteLine("Enter the node from which to start with");
            string input = Console.ReadLine();
            int    index = input.ToUpper()[0] - 'A';

            graphWithAdjList.DepthFirstSearch(index);
        }
コード例 #3
0
        private static void CreateGraphWithAdjList()
        {
            Console.WriteLine("Please enter the number of nodes present in the Graph");
            int totalNumOfNodes = Convert.ToInt32(Console.ReadLine());

            graphWithAdjList = new GraphWithAdjacencyList(totalNumOfNodes);

            graphWithAdjList.InsertNodesWithNeighboursInfo();
            Console.WriteLine("All neighbouring nodes have been inserted");
            Console.ReadKey();
        }
コード例 #4
0
        private static void DemoTopologySorting()
        {
            graphWithAdjList = new GraphWithAdjacencyList();

            graphWithAdjList.GetTopologicalSort();
        }
コード例 #5
0
 private static void DemoMSTByPrimAlg()
 {
     graphWithAdjList = new GraphWithAdjacencyList();
     graphWithAdjList.GetMSTByPrimAlg();
 }
コード例 #6
0
 private static void CreateGraphWithAdjListFromFile()
 {
     graphWithAdjList = new GraphWithAdjacencyList();
 }