[Nauty] Generating all possible automorfisms from given graph

ROMAN BOBER roman300178 at yahoo.com
Sun Feb 15 22:00:01 EST 2004


Hello!
Can you give me an example of an infile? How it must
look?

--- nauty-list-request at cs.anu.edu.au wrote:
> Send nauty-list mailing list submissions to
> 	nauty-list at cs.anu.edu.au
> 
> To subscribe or unsubscribe via the World Wide Web,
> visit
> 	http://cs.anu.edu.au/mailman/listinfo/nauty-list
> or, via email, send a message with subject or body
> 'help' to
> 	nauty-list-request at cs.anu.edu.au
> 
> You can reach the person managing the list at
> 	nauty-list-admin at cs.anu.edu.au
> 
> When replying, please edit your Subject line so it
> is more specific
> than "Re: Contents of nauty-list digest..."
> 
> 
> Today's Topics:
> 
>    1. Getting all possible automorphisms from given
> graph (ROMAN BOBER)
>    2. Re: Getting all possible automorphisms from
> given graph (Sterten at aol.com)
> 
> --__--__--
> 
> Message: 1
> Date: Fri, 13 Feb 2004 01:44:06 -0800 (PST)
> From: ROMAN BOBER <roman300178 at yahoo.com>
> To: nauty-list at cs.anu.edu.au
> Subject: [Nauty] Getting all possible automorphisms
> from given graph
> Reply-To: nauty-list at cs.anu.edu.au
> 
> Hello!
> Thanks for previous answers.I am looking at
> nautyex3.c
> file(which is inside the nauty package) there is an
> example of generating all possible automorphisms
> from 
> n-vertex polygon,but I have a hard time to
> comprehend
> how can I change this example in order to generate
> all
> possible automorphism of a given graph (suppose
> graph
> is an array of  n sets ,where the i-th set gives the
> vertexes to which vertex i is adjacent ,for
> 0<=i<n).Is
> there a simple way to do this transform?
> 
> p.s. I found a very good sun site ,which gives a
> very
> extensive explanation of how mix C and C++ code:
>
"http://developers.sun.com/tools/cc/articles/mixing.html#c_from_cpp"
> 
> =====
> ROMAN THE CIBERMIND
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing
> online.
> http://taxes.yahoo.com/filing.html
> 
> 
> --__--__--
> 
> Message: 2
> From: Sterten at aol.com
> Date: Fri, 13 Feb 2004 05:15:04 EST
> Subject: Re: [Nauty] Getting all possible
> automorphisms from given graph
> To: nauty-list at cs.anu.edu.au
> Reply-To: nauty-list at cs.anu.edu.au
> 
> 
> --part1_149.21bfba11.2d5dfda8_boundary
> Content-Type: text/plain; charset="US-ASCII"
> Content-Transfer-Encoding: 7bit
> 
> //  here is my program which reads adjacency
> matrices from a file - one per 
> line - 
> //  and calls nauty to print the size or a list of
> generators of the 
> automorphism group
> //  compiled with GCC 2.8.1. DJGPP  in a DOS box
> under Windows 98
> 
> 
> // take care, there is a cr at the end of the file !
> 
> 
> #include <stdio.h>
> #define MAXN 320
> #include "nauty.h"
> //int grpsize1,grpsize2;
> 
> 
> 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;
> char c[320*320];
> 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 n\n
>           prints automorphismgroup for the graphs in
> infile
>            and writes these to stdout\n
>           prints graphsize also, when n>0 is
> specified\n
>           prints generators, when n=42\n
>           format: n*n  entries of adjacency matrix
> ,\n"
>           printf("\n\n used NAUTY, which is
> copyright by Brendan McKay\n\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");
> 
> h01:i=-1;
> h02:j=fgetc(fin);
> 
> // printf("%i ",j);
>     if (feof(fin)){fclose(fin);goto h03;}
>     if(j==13)goto h04;
>     if(j<48 || j>49)goto h02;
>     if(i>320*320){printf("graph too big !\n");goto
> h03;}
>     i++;c[i]=j-48;
> goto h02;
> 
> h04:n=1;
>    h04f:if(n*n<i){n++;goto h04f;}
> 
> //printf("n=%i \n",n);
> 
>   m=(n+WORDSIZE-1)/WORDSIZE;
>   for(v=0;v<n;v++){
>     gv=GRAPHROW(g,v,m);
>     EMPTYSET(gv,m);
>     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");
> 
> 
>
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");
> 
>   goto h01;
> 
>   h03:;
> 
>  }
> 
> --part1_149.21bfba11.2d5dfda8_boundary
> Content-Type: text/html; charset="US-ASCII"
> Content-Transfer-Encoding: quoted-printable
> 
> <HTML><FONT FACE=3Darial,helvetica><HTML><FONT 
> SIZE=3D2 PTSIZE=3D10 FAMILY=
> 
=== message truncated ===

=====
ROMAN THE CIBERMIND

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html




More information about the Nauty mailing list