Пример #1
0
        static void Main(string[] args)
        {
            FASSE fas = new FASSE();
            var edges = new Edge<int>[] { new Edge<int>(0, 1)
                , new Edge<int>(0, 6)
                , new Edge<int>(1, 3)
                , new Edge<int>(2, 0)
                , new Edge<int>(2, 1)
                , new Edge<int>(3, 2)
                , new Edge<int>(3, 4)
                , new Edge<int>(4, 5)
                , new Edge<int>(5, 0)
                , new Edge<int>(5, 6)
                , new Edge<int>(6, 4)
                , new Edge<int>(6, 3)
            };

            GraphGenerator gg = new GraphGenerator();

            BidirectionalGraph<int, Edge<int>> graph = gg.generate(20, 10, 100);//edges.ToBidirectionalGraph<int, Edge<int>>();
            GraphvizAlgorithm<int, Edge<int>> graphviz = new GraphvizAlgorithm<int, Edge<int>>(graph);
            graphviz.Generate(new FileDotEngine(), "g_b");
            List<Edge<int>> mfas = fas.mfas(graph);

            foreach (Edge<int> e in mfas)
            {
                graph.RemoveEdge(e);
            }
            bool f = graph.IsDirectedAcyclicGraph<int, Edge<int>>();
            graphviz.Generate(new FileDotEngine(), "g_a");
            Console.WriteLine(mfas.Count());
        }
Пример #2
0
        public void TestMethod4()
        {
            FASSE fas = new FASSE();
            BidirectionalGraph<int, Edge<int>> graph = gg.generate(200, 20, 1000);
            List<Edge<int>> mfas = fas.mfas(graph);

            foreach (Edge<int> e in mfas)
            {
                graph.RemoveEdge(e);
            }
            bool f = graph.IsDirectedAcyclicGraph<int, Edge<int>>();
            Assert.AreEqual(f, true);
        }
Пример #3
0
        public void TestMethod3()
        {
            FASSE fas = new FASSE();
            BidirectionalGraph<int, Edge<int>> graph = gg.generate(100, 14, 500);
            List<Edge<int>> mfas = fas.mfas(graph);

            foreach (Edge<int> e in mfas)
            {
                graph.RemoveEdge(e);
            }
            bool f = graph.IsDirectedAcyclicGraph<int, Edge<int>>();
            Assert.IsTrue(f);
        }