public void GetVertexCountTest()
        {
            int         n       = 10;
            Graph       g       = new Graph(n);
            MockRefiner refiner = new MockRefiner(g);

            Assert.AreEqual(g.vertexCount, refiner.GetVertexCount());
        }
        public void SetupTest()
        {
            int n = 5;
            PermutationGroup group   = new PermutationGroup(n);
            Graph            g       = new Graph(n);
            MockRefiner      refiner = new MockRefiner(g);

            Setup(refiner, group, g);
            Assert.AreEqual(group, refiner.GetAutomorphismGroup());
        }
        public void GetConnectivityTest()
        {
            int   n = 3;
            Graph g = new Graph(n)
            {
                connectionTable = new int[][] { new[] { 0, 1, 0 }, new[] { 1, 0, 1 }, new[] { 0, 1, 0 } }
            };
            MockRefiner refiner = new MockRefiner(g);

            Assert.AreEqual(1, refiner.GetConnectivity(0, 1));
        }
        public void GetGroupTest()
        {
            int   n = 3;
            Graph g = new Graph(n)
            {
                connectionTable = new int[][] { new[] { 0, 1, 0 }, new[] { 1, 0, 1 }, new[] { 0, 1, 0 } }
            };
            PermutationGroup group   = new PermutationGroup(n);
            MockRefiner      refiner = new MockRefiner(g);

            Setup(refiner, group, g);
            Assert.IsNotNull(refiner.GetAutomorphismGroup());
        }
        public void RefineTest()
        {
            int   n = 3;
            Graph g = new Graph(n)
            {
                connectionTable = new int[][] { new[] { 0, 1, 1 }, new[] { 1, 0, 0 }, new[] { 1, 0, 0 } }
            };
            PermutationGroup group   = new PermutationGroup(n);
            MockRefiner      refiner = new MockRefiner(g);

            Setup(refiner, group, g);
            refiner.Refine(Partition.Unit(n));
            Assert.IsNotNull(refiner);
        }
        public void GetFirstTest()
        {
            int   n = 3;
            Graph g = new Graph(n)
            {
                connectionTable = new int[][] { new[] { 0, 1, 0 }, new[] { 1, 0, 1 }, new[] { 0, 1, 0 } }
            };
            PermutationGroup group   = new PermutationGroup(n);
            MockRefiner      refiner = new MockRefiner(g);

            Setup(refiner, group, g);
            refiner.Refine(Partition.Unit(n));
            Permutation first    = refiner.GetFirst();
            Permutation expected = new Permutation(1, 0, 2);

            Assert.AreEqual(expected, first);
        }
        public void GetFirstHalfMatrixStringTest()
        {
            int   n = 3;
            Graph g = new Graph(n)
            {
                connectionTable = new int[][] { new[] { 0, 0, 1 }, new[] { 0, 0, 1 }, new[] { 1, 1, 0 } }
            };
            PermutationGroup group   = new PermutationGroup(n);
            MockRefiner      refiner = new MockRefiner(g);

            Setup(refiner, group, g);
            refiner.Refine(Partition.Unit(n));
            string hms      = refiner.GetFirstHalfMatrixString();
            string expected = "110";

            Assert.AreEqual(expected, hms);
        }
        public void GetAutomorphismPartitionTest()
        {
            int   n = 3;
            Graph g = new Graph(n)
            {
                connectionTable = new int[][] { new[] { 0, 1, 1 }, new[] { 1, 0, 0 }, new[] { 1, 0, 0 } }
            };
            PermutationGroup group   = new PermutationGroup(n);
            MockRefiner      refiner = new MockRefiner(g);

            Setup(refiner, group, g);
            refiner.Refine(Partition.Unit(n));
            Partition autPartition = refiner.GetAutomorphismPartition();
            Partition expected     = Partition.FromString("0|1,2");

            Assert.AreEqual(expected, autPartition);
        }
 private void Setup(MockRefiner refiner, PermutationGroup group, Graph g)
 {
     refiner.Setup(group, new EquitablePartitionRefiner(new GraphRefinable(g)));
 }
        public void EmptyConstructor()
        {
            MockRefiner refiner = new MockRefiner(null);

            Assert.IsNotNull(refiner);
        }