Example #1
0
    private static void TestEdgeDisjointPath(UndirectedGraph <int> g, int from, int to)
    {
        Console.WriteLine("Example graph: {0}", g);
        Console.Write("Path from {0} to {1}: ", from, to);
        foreach (int v in g.FindPath(from, to))
        {
            Console.Write("{0}, ", v);
        }
        Console.Write("\n");

        Console.WriteLine("Number of edge-disjoint paths {0} to {1}: {2}", from, to, g.CountEdgeDisjointPaths(from, to));
        Console.WriteLine("They are:");
        foreach (var path in g.FindEdgeDisjointPaths(from, to))
        {
            foreach (int v in path)
            {
                Console.Write("{0}, ", v);
            }
            Console.Write("\n");
        }
        Console.Write("\n");
    }