Exemplo n.º 1
0
        public static void InternalMain()
        {
            Diagraph g = new Diagraph(@"Graph/testdata/tinyDG.txt");

            Console.Write(g.toString());

            //Graph g1 = g.Clone();
            //Console.Write(g1.toString());
        }
        public static void InternalMain()
        {
            Diagraph g = new Diagraph(@"Graph/testdata/TinyDAG.txt");

            Console.Write(g.toString());

            Topological t = new Topological(g);

            Console.WriteLine(Graph.PrintFormat(t.GetOrder()));
        }
        public static void InternalMain()
        {
            Diagraph g = new Diagraph(@"Graph/testdata/tinyDG.txt");

            Console.Write(g.toString());

            DirectedCycle dc = new DirectedCycle(g);

            Console.WriteLine(dc.hasCycle());
            Console.WriteLine(Graph.PrintFormat(dc.Cycle()));
        }
Exemplo n.º 4
0
        public static void InternalMain()
        {
            Diagraph g = new Diagraph(@"Graph/testdata/tinyDAG.txt");

            Console.Write(g.toString());

            KosarajuSharirSCC cc = new KosarajuSharirSCC(g);

            Console.WriteLine("Number of connected components" + cc.count());
            Console.WriteLine(cc.connected(3, 7));
        }
        public static void InternalMain()
        {
            Diagraph g = new Diagraph(@"Graph/testdata/TinyDG.txt");

            Console.Write(g.toString());

            DirectedBFS bfsPths = new DirectedBFS(g, 6);

            Console.WriteLine(bfsPths.hasPathTo(3));
            Console.WriteLine(bfsPths.hasPathTo(1));
            Console.WriteLine(bfsPths.hasPathTo(7));
            Console.WriteLine(Graph.PrintFormat(bfsPths.pathTo(3)));
        }