/* This program demonstrates how an isomorphism is found between two graphs, using the Moebius graph as an example. This version uses Traces and demonstrates how to compute the automorphism group separately before computing the canonical labelling. Although this is slower for easy graphs like those here, it can be faster for some very difficult graphs.
*/
/* Now we make the canonically labelled graphs by a two-step process. The first call to Traces computes the automorphism group. The second call computes the canonical labelling, using the automorphism group from the first call.
We have declared a variable "generators" that will be used to hold the group generators between the two calls. It has to be initialised to NULL and its address has to be given to Traces using options.generators. After the second call, we need to discard the generators with a
call to freeschreier(), which also initializes it again. */
if (aresame_sg(&cg1,&cg2))
{
printf("Isomorphic.\n"); if (n <= 1000)
{ /* Write the isomorphism. For each i, vertex lab1[i] of sg1 maps onto vertex lab2[i] of sg2. We compute
the map in order of labelling because it looks better. */
for (i = 0; i < n; ++i) map[lab1[i]] = lab2[i]; for (i = 0; i < n; ++i) printf(" %d-%d",i,map[i]);
printf("\n");
}
} else
printf("Not isomorphic.\n");
} else break;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.