Ejemplo n.º 1
0
 public SimpleVertexSignature(int rootVertexIndex, int height, SimpleGraph graph)
     : base()
 {
     this.graph = graph;
     if (height == -1)
     {
         base.CreateMaximumHeight(rootVertexIndex, graph.GetVertexCount());
     }
     else
     {
         base.Create(rootVertexIndex, graph.GetVertexCount(), height);
     }
 }
Ejemplo n.º 2
0
 public void RegularGraphTest(SimpleGraph graph, int diameter)
 {
     for (int h = 1; h <= diameter; h++)
     {
         SimpleVertexSignature sig0 =
             new SimpleVertexSignature(0, h, graph);
         string zeroCanonical = sig0.ToCanonicalString();
         Console.Out.WriteLine(h + "\t" + zeroCanonical);
         for (int i = 1; i < graph.GetVertexCount(); i++)
         {
             SimpleVertexSignature sig =
                 new SimpleVertexSignature(i, h, graph);
             //                Assert.AreEqual(zeroCanonical, sig.ToCanonicalString());
             string canString = sig.ToCanonicalString();
             if (zeroCanonical.Equals(canString))
             {
                 //                    Console.Out.WriteLine("EQU");
             }
             else
             {
                 Console.Out.WriteLine("NEQ "
                                       + h + "\t" + i + "\t"
                                       + zeroCanonical + " " + canString);
             }
             Assert.AreEqual(zeroCanonical, canString);
         }
     }
 }