Esempio n. 1
0
        public virtual void VertexColor()
        {
            // medium size spiro cyclo hexane like
            int[][] g = new int[][] { new[] { 1, 5 }, new[] { 0, 2 }, new[] { 1, 3 }, 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 }, new[] { 11, 14, 17, 18 }, new[] { 17, 20 }, new[] { 15, 16 }, new[] { 15, 19 },
                                      new[]   { 18, 20 }, new[] { 16, 19, 22, 23 }, new[] { 22, 25 }, new[] { 20, 21 }, new[] { 20, 24 }, new[] { 23, 25 }, new[] { 21, 24, 27, 28 }, new[] { 27, 30 },
                                      new[]   { 25, 26 }, new[] { 25, 29 }, new[] { 28, 30 }, new[] { 26, 29, 32, 33 }, new[] { 32, 35 }, new[] { 30, 31 }, new[] { 30, 34 }, new[] { 33, 35 },
                                      new[]   { 31, 34, 37, 38 }, new[] { 37, 40 }, new[] { 35, 36 }, new[] { 35, 39 }, new[] { 38, 40 }, new[] { 36, 39, 42, 43 }, new[] { 42, 45 }, new[] { 40, 41 },
                                      new[]  { 40, 44 }, new[] { 43, 45 }, new[] { 41, 44, 47, 48 }, new[] { 47, 50 }, new[] { 45, 46 }, new[] { 45, 49 }, new[] { 48, 50 }, new[] { 46, 49, 52, 53 },
                                      new[]   { 52, 55 }, new[] { 50, 51 }, new[] { 50, 54 }, new[] { 53, 55 }, new[] { 51, 54, 57, 58 }, new[] { 57, 60 }, new[] { 55, 56 }, new[] { 55, 59 }, new[] { 58, 60 },
                                      new[]   { 56, 59 } };
            ICyclicVertexSearch search = new RegularCyclicVertexSearch(g);

            int[] colors = search.VertexColor();
        }