Example #1
0
    // Find path a->b on graph g
    private static void FindPath(Graph g, int a, int b)
    {
        Node start = new Node(a);
        Node goal  = new Node(b);

        Pathfinder finder = new Dijsktra();  // ***** CHANGE TO YOUR SEARCH CLASS *****

        finder.SetGraph(g);
        List <Node> path = finder.FindPath(start, goal);

        if (path != null)
        {
            WritePath(path);
        }
        else
        {
            Console.WriteLine("No path found.");
        }
    }