public void TestThoughtWorksRailNetwork9()
        {
            // The length of the shortest route (in terms of distance to travel) from B to B. (should be 9)
            DjikstraShortestPathWithRevisiting shortestPath = new DjikstraShortestPathWithRevisiting(Graph);
            int costOfShortestPath = shortestPath.Solve("B", "B");

            Assert.IsTrue(costOfShortestPath == 9, "The shortest distance between B and B is not 9. The calculcation returned " + costOfShortestPath);
        }
Exemple #2
0
        public void TestThoughtWorksRailNetwork9()
        {
            // The length of the shortest route (in terms of distance to travel) from B to B. (should be 9)
            DjikstraShortestPathWithRevisiting shortestPath = new DjikstraShortestPathWithRevisiting(Graph);
            int costOfShortestPath = shortestPath.Solve("B", "B");

            Console.WriteLine((costOfShortestPath < 0) ? "NO SUCH ROUTE" : costOfShortestPath.ToString());
        }