示例#1
0
            public void TestRandomly()
            {
                var     rg = new RandomGraph(0.3, 4000 /* seed */);
                Graph   graph1, graph2;
                VfState vfs;

                FullMapping[] matches;

                for (var i = 0; i < 10; i++)
                {
                    rg.IsomorphicPair(100, out graph1, out graph2);
                    vfs     = new VfState(graph1, graph2);
                    matches = vfs.Matches().ToArray();
                    Assert.AreNotEqual(0, matches.Length);
                }

                graph1  = rg.GetGraph(100);
                graph2  = rg.GetGraph(100);
                vfs     = new VfState(graph1, graph2);
                matches = vfs.Matches().ToArray();
                Assert.AreEqual(0, matches.Length);

                rg      = new RandomGraph(0.3, 5000 /* seed */);
                graph1  = rg.GetGraph(100);
                rg      = new RandomGraph(0.3, 5000 /* seed */);
                graph2  = rg.GetGraph(100);
                vfs     = new VfState(graph1, graph2);
                matches = vfs.Matches().ToArray();
                Assert.AreEqual(1, matches.Length);
            }
示例#2
0
            public void TestGetGraph()
            {
                RandomGraph rg = new RandomGraph(0.3);

                Graph graph = rg.GetGraph(30);

                Assert.IsNotNull(graph);
                Assert.AreEqual(30, graph.NodeCount);
            }
示例#3
0
            public void TestRandomly()
            {
                RandomGraph rg = new RandomGraph(0.3, 4000 /* seed */);
                Graph       graph1, graph2;
                VfState     vfs;

                for (int i = 0; i < 10; i++)
                {
                    rg.IsomorphicPair(100, out graph1, out graph2);
                    vfs = new VfState(graph1, graph2);
                    Assert.IsTrue(vfs.FMatch());
                }

                graph1 = rg.GetGraph(100);
                graph2 = rg.GetGraph(100);
                vfs    = new VfState(graph1, graph2);
                Assert.IsFalse(vfs.FMatch());
            }
            public void TestGetGraph()
            {
                var rg = new RandomGraph(0.3);

                var graph = rg.GetGraph(30);

                Assert.IsNotNull(graph);
                Assert.AreEqual(30, graph.VertexCount);
            }