Exemplo n.º 1
0
 public void TestMethod1()
 {
     weighted_graph.Weighted_graph graph = new weighted_graph.Weighted_graph();
     graph.download_Graph(@"C:\Users\Student241580\source\repos\weighted_graph\Graph_test.txt");
     Assert.AreEqual(9, graph.NumberOfBranches);
     Assert.AreEqual(5, graph.NumberOfVertices);
     Assert.AreEqual(1, graph.StartingVertice);
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Weighted_graph graph = new Weighted_graph();

            graph.download_Graph(@"C:\Users\Student241580\source\repos\weighted_graph\Graph_test.txt");
            Console.WriteLine(graph.NumberOfBranches);
            Console.WriteLine(graph.NumberOfVertices);
            Console.WriteLine(graph.StartingVertice);
            Console.ReadKey();
        }
Exemplo n.º 3
0
    static void Main(string[] args)
    {
        WeightedGraphMatrix.WeightedGraphMatrix graph  = new WeightedGraphMatrix.WeightedGraphMatrix(@"..\..\..\Graph.txt");
        weighted_graph.Weighted_graph           graph1 = new weighted_graph.Weighted_graph(@"..\..\..\Graph.txt");
        // WeightedGraphMatrix.WeightedGraphMatrix graf = new WeightedGraphMatrix.WeightedGraphMatrix(100,100*99 );
        DjikstraAlgoritm djikstra = new DjikstraAlgoritm(graph);

        weighted_graph.Branch E = djikstra.FindTheShortestWayTo(4);
        Console.WriteLine(E.vertice);
        Console.WriteLine(E.Weight);
        djikstra.saveToFile(@"..\..\..\paths1.txt");

        Console.ReadKey();
    }