Exemplo n.º 1
0
        private static void PrintAllRoutes(string start, string destination, RouterBase router)
        {
            Console.WriteLine("--------------------------------");
            Console.WriteLine($"{start} to {destination}");
            var routes = router.GetAllRoutes(start, destination);

            if (routes.Any())
            {
                Console.WriteLine("The route exists from {0} to {1}.", start, destination);
                foreach (var route in routes)
                {
                    Console.WriteLine($"{route.ResultingPath} costs {route.CumulativeWeight}");
                }
            }
            else
            {
                Console.WriteLine("The route does not exist from {0} to {1}.", start, destination);
            }
        }