Exemplo n.º 1
0
        public virtual void TestIsolated_Empty()
        {
            ICyclicVertexSearch search = new RegularCyclicVertexSearch(Arrays.CreateJagged <int>(0, 0));

            Assert.IsTrue(Compares.AreDeepEqual(Array.Empty <int>(), search.Cyclic()));
            Assert.IsTrue(Compares.AreDeepEqual(Arrays.CreateJagged <int>(0, 0), search.Isolated()));
            Assert.IsTrue(Compares.AreDeepEqual(Arrays.CreateJagged <int>(0, 0), search.Fused()));
        }
Exemplo n.º 2
0
        public virtual void TestFused()
        {
            int[][]             g      = new int[][] { new[] { 1, 5, 6 }, new[] { 0, 2 }, new[] { 1, 3 }, new[] { 2, 4, 7 }, new[] { 3, 5 }, new[] { 0, 4 }, new[] { 0, 7 }, new[] { 6, 3 } };
            ICyclicVertexSearch search = new RegularCyclicVertexSearch(g);

            int[][] isolated = search.Isolated();
            int[][] fused    = search.Fused();
            Assert.AreEqual(0, isolated.Length);
            Assert.AreEqual(1, fused.Length);
            Assert.AreEqual(g.Length, fused[0].Length);
        }
Exemplo n.º 3
0
        public virtual void TestFused_OrthoFused()
        {
            // napthalene like
            int[][]             g      = new int[][] { new[] { 1, 5 }, new[] { 0, 2 }, new[] { 1, 3 }, new[] { 2, 4 }, new[] { 3, 5, 7 }, new[] { 0, 6, 4 }, new[] { 5, 9 }, new[] { 4, 8 }, new[] { 7, 9 }, new[] { 6, 8 } };
            ICyclicVertexSearch search = new RegularCyclicVertexSearch(g);

            int[][] isolated = search.Isolated();
            int[][] fused    = search.Fused();
            Assert.AreEqual(0, isolated.Length);
            Assert.AreEqual(1, fused.Length);
            Assert.AreEqual(g.Length, fused[0].Length);
        }
Exemplo n.º 4
0
        public virtual void TestFused_BiorthoFused()
        {
            // 3 fused rings
            int[][] g = new int[][] { new[] { 1, 5 }, new[] { 0, 2, 10 }, new[] { 3, 13, 1 }, new[] { 2, 4 }, new[] { 3, 5, 7 }, new[] { 0, 6, 4 }, new[] { 5, 9 }, new[] { 4, 8 }, new[] { 7, 9 },
                                      new[] { 6, 8 }, new[] { 1, 11 }, new[] { 10, 12 }, new[] { 11, 13 }, new[] { 2, 12 } };
            ICyclicVertexSearch search = new RegularCyclicVertexSearch(g);

            int[][] isolated = search.Isolated();
            int[][] fused    = search.Fused();
            Assert.AreEqual(0, isolated.Length);
            Assert.AreEqual(1, fused.Length);
            Assert.AreEqual(g.Length, fused[0].Length);
        }
Exemplo n.º 5
0
        public virtual void TestFused_BiocycloVertexLinked()
        {
            // biocyclooctanylbiocylooctane like
            int[][] g = new int[][] { new[] { 1, 5 }, new[] { 0, 2 }, new[] { 1, 3, 6, 16 }, new[] { 2, 4 }, new[] { 3, 5 }, new[] { 4, 0, 7 }, new[] { 2, 7 }, new[] { 6, 5 }, new[] { 9, 13 },
                                      new[] { 8, 10 }, new[] { 9, 11, 14 }, new[] { 10, 12 }, new[] { 11, 13 }, new[] { 12, 8, 15, 16 }, new[] { 10, 15 }, new[] { 14, 13 }, new[] { 13, 2 } };
            ICyclicVertexSearch search = new RegularCyclicVertexSearch(g);

            int[][] isolated = search.Isolated();
            int[][] fused    = search.Fused();
            Assert.AreEqual(0, isolated.Length);
            Assert.AreEqual(2, fused.Length);
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }, fused[0]));
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 8, 9, 10, 11, 12, 13, 14, 15 }, fused[1]));
        }
Exemplo n.º 6
0
        public virtual void TestFused_Cylclophane()
        {
            // medium size spiro cyclophane
            int[][] g = new int[][] { new[] { 1, 5 }, new[] { 0, 2 }, new[] { 1, 3, 50, 46 }, new[] { 2, 4 }, new[] { 3, 5 }, new[] { 0, 4, 7, 8 }, new[] { 7, 10 }, new[] { 5, 6 }, new[] { 5, 9 },
                                      new[] { 8, 10 }, new[] { 6, 9, 12, 13 }, new[] { 12, 15 }, new[] { 10, 11 }, new[] { 10, 14 }, new[] { 13, 15, 16, 17 }, new[] { 11, 14 }, new[] { 14, 20 }, new[] { 14, 18 },
                                      new[] { 17, 19 }, new[] { 18, 20, 21, 22 }, new[] { 16, 19 }, new[] { 19, 25 }, new[] { 19, 23 }, new[] { 22, 24, 26, 30 }, new[] { 23, 25 }, new[] { 21, 24 },
                                      new[] { 23, 27 }, new[] { 26, 28, 35, 31 }, new[] { 27, 29 }, new[] { 28, 30 }, new[] { 23, 29 }, new[] { 27, 32 }, new[] { 31, 33 }, new[] { 32, 34, 40, 36 },
                                      new[] { 33, 35 }, new[] { 27, 34 }, new[] { 33, 37 }, new[] { 36, 38 }, new[] { 37, 39, 45, 41 }, new[] { 38, 40 }, new[] { 33, 39 }, new[] { 38, 42 },
                                      new[] { 41, 43, 58, 59 }, new[] { 42, 44 }, new[] { 43, 45 }, new[] { 38, 44 }, new[] { 2, 47 }, new[] { 46, 48 }, new[] { 47, 49 }, new[] { 48, 50, 51, 55 }, new[] { 2, 49 },
                                      new[] { 49, 52 }, new[] { 51, 53 }, new[] { 52, 54 }, new[] { 53, 55, 56, 57 }, new[] { 49, 54 }, new[] { 54, 59 }, new[] { 54, 58 }, new[] { 42, 57 }, new[] { 42, 56 } };
            ICyclicVertexSearch search = new RegularCyclicVertexSearch(g);

            int[][] isolated = search.Isolated();
            int[][] fused    = search.Fused();
            Assert.AreEqual(0, isolated.Length);
            Assert.AreEqual(1, fused.Length);
            Assert.AreEqual(g.Length, fused[0].Length);
        }
Exemplo n.º 7
0
        public virtual void TestFused_Fullerene()
        {
            int[][] g = new int[][] { new[] { 1, 4, 8 }, new[] { 0, 2, 11 }, new[] { 1, 3, 14 }, new[] { 2, 4, 17 }, new[] { 3, 0, 5 }, new[] { 4, 6, 19 }, new[] { 5, 7, 21 },
                                      new[] { 6, 8, 24 }, new[] { 7, 0, 9 }, new[] { 8, 10, 25 }, new[] { 9, 11, 28 }, new[] { 10, 1, 12 }, new[] { 11, 13, 29 }, new[] { 12, 14, 32 }, new[] { 13, 2, 15 },
                                      new[] { 14, 16, 33 }, new[] { 15, 17, 36 }, new[] { 16, 3, 18 }, new[] { 17, 19, 37 }, new[] { 18, 5, 20 }, new[] { 19, 21, 39 }, new[] { 20, 6, 22 },
                                      new[] { 21, 23, 41 }, new[] { 22, 24, 43 }, new[] { 23, 7, 25 }, new[] { 24, 9, 26 }, new[] { 25, 27, 44 }, new[] { 26, 28, 46 }, new[] { 27, 10, 29 },
                                      new[] { 28, 12, 30 }, new[] { 29, 31, 47 }, new[] { 30, 32, 49 }, new[] { 31, 13, 33 }, new[] { 32, 15, 34 }, new[] { 33, 35, 50 }, new[] { 34, 36, 52 },
                                      new[] { 35, 16, 37 }, new[] { 36, 18, 38 }, new[] { 37, 39, 53 }, new[] { 38, 20, 40 }, new[] { 39, 41, 54 }, new[] { 40, 22, 42 }, new[] { 41, 43, 56 },
                                      new[] { 42, 23, 44 }, new[] { 43, 26, 45 }, new[] { 44, 46, 57 }, new[] { 45, 27, 47 }, new[] { 46, 30, 48 }, new[] { 47, 49, 58 }, new[] { 48, 31, 50 },
                                      new[] { 49, 34, 51 }, new[] { 50, 52, 59 }, new[] { 51, 35, 53 }, new[] { 52, 38, 54 }, new[] { 53, 40, 55 }, new[] { 54, 56, 59 }, new[] { 55, 42, 57 },
                                      new[] { 56, 45, 58 }, new[] { 57, 48, 59 }, new[] { 58, 51, 55 } };
            ICyclicVertexSearch search = new RegularCyclicVertexSearch(g);

            int[][] isolated = search.Isolated();
            int[][] fused    = search.Fused();
            Assert.AreEqual(0, isolated.Length);
            Assert.AreEqual(1, fused.Length);
            Assert.AreEqual(g.Length, fused[0].Length);
        }