[Nauty] MAXN too big ?
Sterten at aol.com
Sterten at aol.com
Mon Jan 24 17:24:01 EST 2005
I tried to read a graph with 2680 vertices and to compute the
automorphismgroup. Is this too large ? I noticed that the
graph-creation routines EMPTYSET,ADDELEMENT and/or GRAPHROW
went upto 1170, when the program crashed - no more output,
no reaction to break.
I used the program earlier without problems for smaller
graphs, MAXN=350 or such.
compiled with :
gcc -O2 -c gautt.c
rem gcc gautt.o gtools.o naugraph.o nautil1.o nauty1.o -O2 -o gauto.exe
gcc gautt.o naugraph.o nautil.o nauty.o -O2 -o gauto.exe
type gautt.c >>gautt.exe
program:
// take care, there is a cr at the end of the file !
#include <stdio.h>
#define MAXN 2700
#include "nauty.h"
//int grpsize1,grpsize2;
char c[2700*2700];
int main(int argc,char*argv[]) {
FILE *fin;
graph g[MAXN*MAXM];
graph canong[MAXN*MAXM];
nvector lab[MAXN],ptn[MAXN],orbits[MAXN];
static DEFAULTOPTIONS(options);
statsblk(stats);
setword workspace[160*MAXM];
int x,y,z,i,j,n=12,m,v,gntk=0;
set *gv;
options.writeautoms = TRUE;
options.writeautoms = FALSE;
options.writemarkers = FALSE;
options.getcanon = TRUE;
options.defaultptn = TRUE;
options.digraph = TRUE;
if(argc<2){printf("\nusage: gauto infile v \n\n");
printf("prints automorphismgroup for the graphs in infile");
printf("and writes these to stdout\n");
printf("prints graphsize also, when v>0 is specified\n");
printf("prints generators, when v=42\n");
printf("format: n*n entries of adjacency matrix ,\n");exit(1);}
if((fin=fopen(argv[1],"rb"))==NULL){printf("file-error");exit(1);}
if(argc=3)sscanf(argv[2],"%i",&gntk);
if(gntk==42)options.writeautoms = TRUE;
//printf("los geht's");
n=2680;for(i=0;i<n*n;i++)c[i]=fgetc(fin)-48;fclose(fin);
m=(n+WORDSIZE-1)/WORDSIZE;
printf("graph read with n=%i vertices , m=%i \n",n,m);
for(v=0;v<n;v++){
gv=GRAPHROW(g,v,m);
EMPTYSET(gv,m);
printf("v=%i emptyset\n",v);
for(i=0;i<n;i++){
if(c[v*n+i])ADDELEMENT(gv,i);}
}
// for(i=1;i<=n;i++)
// {gv=GRAPHROW(g,i-1,m);
// for(j=1;j<=n;j++)printf("%i",ISELEMENT(gv,j-1));}printf("\n");
printf("calling nauty..\n");
nauty(g,lab,ptn,NILSET,orbits,&options,&stats,workspace,160*MAXM,m,n,canong);
// for(i=1;i<=n;i++)
// {gv=GRAPHROW(canong,i-1,m);
// for(j=1;j<=n;j++)printf("%i",ISELEMENT(gv,j-1));}printf("\n");
j=stats.grpsize1;v=stats.grpsize2;
if(gntk)printf("%i ",n);
printf("%i\n",j);
// for(i=1;i<=n;i++)
// {gv=GRAPHROW(g,i-1,m);
// for(j=1;j<=n;j++)printf("%i",ISELEMENT(gv,j-1));}printf("\n");
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.anu.edu.au/mailman/private/nauty/attachments/20050124/2cca243c/attachment.html
More information about the Nauty
mailing list