Beispiel #1
0
        // XXX DOES NOT YET WORK - reconstructed graph may be isomorphic,
        // but not automorphic
        public void Reconstruct(SimpleGraph graph)
        {
            SimpleGraphSignature signature = new SimpleGraphSignature(graph);

            foreach (var symmetryClass in signature.GetSymmetryClasses())
            {
                string             signatureString = symmetryClass.GetSignatureString();
                ColoredTree        tree            = AbstractVertexSignature.Parse(signatureString);
                SimpleGraphBuilder builder         = new SimpleGraphBuilder();
                SimpleGraph        reconstruction  = builder.FromTree(tree);
                Assert.AreEqual(reconstruction.ToString(), graph.ToString());
            }
        }
Beispiel #2
0
        public void TestColoredTreeRoundtrip()
        {
            string      signatureString = "[.]([.]([.,0])[.]([.,0]))";
            ColoredTree tree            = SimpleVertexSignature.Parse(signatureString);

            Assert.AreEqual(signatureString, tree.ToString());

            SimpleGraphBuilder   builder        = new SimpleGraphBuilder();
            SimpleGraph          graph          = builder.FromTree(tree);
            SimpleGraphSignature graphSignature = new SimpleGraphSignature(graph);
            string canonicalString = graphSignature.ToCanonicalString();

            Assert.AreEqual(signatureString, canonicalString);
        }