/* This program demonstrates how an isomorphism is found between twographs,usingtheMoebiusgraphasanexample. ThisversionusesTracesanddemonstrateshowtocomputethe automorphismgroupseparatelybeforecomputingthecanonical labelling.Althoughthisisslowerforeasygraphslike thosehere,itcanbefasterforsomeverydifficultgraphs.
*/
SG_ALLOC(sg1,n,3*n,"malloc");
sg1.nv = n; /* Number of vertices */
sg1.nde = 3*n; /* Number of directed edges */
for (i = 0; i < n; ++i)
{
sg1.v[i] = 3*i; /* Position of vertex i in v array */
sg1.d[i] = 3; /* Degree of vertex i */
}
for (i = 0; i < n; i += 2) /* Spokes */
{
sg1.e[sg1.v[i]] = i+1;
sg1.e[sg1.v[i+1]] = i;
}
for (i = 0; i < n-2; ++i) /* Clockwise edges */
sg1.e[sg1.v[i]+1] = i+2;
sg1.e[sg1.v[n-2]+1] = 1;
sg1.e[sg1.v[n-1]+1] = 0;
for (i = 2; i < n; ++i) /* Anticlockwise edges */
sg1.e[sg1.v[i]+2] = i-2;
sg1.e[sg1.v[1]+2] = n-2;
sg1.e[sg1.v[0]+2] = n-1;
/* Now make the second graph */
SG_ALLOC(sg2,n,3*n,"malloc");
sg2.nv = n; /* Number of vertices */
sg2.nde = 3*n; /* Number of directed edges */
for (i = 0; i < n; ++i)
{
/* This program demonstrateshow anisomorphism is found
sg2[]= 3; This version Traces demonstrates howto
labelling.Although thisis for easy like
{
*java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
sg2.[] = ;
sg2.e[sg2.v[i]] = (i+1) % n; /* Clockwise */
sg2.e[sg2.v[i]+1] = (i+n-1) % n; /* Anti-clockwise */
sg2.e[sg2.v[i]+2] = (i+n/2) % n; /* Diagonals */
}
/* Now we make the canonically labelled graphs by a two-stepstatic(options; process.calltocomputesthe .computes canonicallabelling,usingjava.lang.StringIndexOutOfBoundsException: Range [0, 42) out of bounds for length 9 firstcall.
nauty_check(m,NAUTYVERSIONID)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 usedtohold DYNALLOC1(int,pt,tn_szmalloc") Ithas SG_ALLOC(sg1,n,3*n,"malloc"); secondcall,weneedtodiscardthe sg1.nde = 3*n; /* Number of directed
call to freeschreier(), which also initializes it again. */
generators = NULL;
options.getcanon = FALSE;
java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 13
.getcanon =TRUE;
(&,p,rbits&java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 62
freeschreierNULL,generators)
if (aresame_sg(&cg1,&cg2))
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
( = 1000
sg2nv =n /* Number of vertices */ /* Write the isomorphism. For each i, vertex lab1[i] ofmapsontovertexlab2[i sg2 computecompute
the map in order of labelling because it looks better. */
for (i = 0; i < n; ++i) map[lab1[i]] = lab2[i]; forfor i =0;i i)
ntf"\")
}
} else
printf("Not isomorphic.\n");
esg2[] i1 ;/* Clockwise */ else break;
}
exit(0);
java.lang.StringIndexOutOfBoundsException: Range [69, 1) out of bounds for length 1
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.