[Nauty] A question.
Brendan McKay
bdm at cs.anu.edu.au
Thu Feb 17 13:43:01 EST 2005
A reminder: You can only post messages from the exact email address
you are subscribed under. This is to minimise spam. Currently about
20 spams per day would get onto the list without this feature, so
it's for your own good ;-).
Igor, that reminder was for you. I found your message only by
accident.
Brendan.
----- Forwarded message from Igor Dukanovic <igor.dukanovic at uni-klu.ac.at> -----
From: Igor Dukanovic <igor.dukanovic at uni-klu.ac.at>
To: nauty-list at cs.anu.edu.au
Reply-To: igor.mat at uni-mb.si
Date: Wed, 16 Feb 2005 19:50:03 +0100
Subject: Re: [Nauty] A question.
On Wed, 2005-02-16 at 11:13 -0600, SHIUE-YUAN SHIAU wrote:
> Hi
> I am also a newcomer. I have been struggling to make an executable
> that is suitable to find the automorphism group of strongly regular
> graphs with format like 5X5 graph
> 01100
> 10010
> 10001
> 01001
> 00110
> where 1 represents two adjacent vertices and 0 non-adjacent vertices.
> But so far I have little idea how to do it.
Attached is the file in which I've hacked the nautyex.c file
to do this job. It is not very elegant, but for me it does the job.
Best regards,
igor
P.S. File inputdata contains your graph in a very similar format
5
0 1 1 0 0
1 0 0 1 0
1 0 0 0 1
0 1 0 0 1
0 0 1 1 0
(the first number is the number of vertices),
but I'm sure that you'll be able to hack it on.
/* This program prints generators for the automorphism group of a
graph given to the file inputdata,
and generators for the automorphism group which fixes
first vertex (vertex 0) to the file fixedfirst.
It needs to be linked with nauty.c, nautil.c and naugraph.c:
gcc twicenauty.c nauty.c nautil.c naugraph.c
*/
/* #define MAXN 712L */
#define MAXN 3000L
#include "nauty.h" /* which includes <stdio.h> */
main()
{ graph g[MAXN*MAXM];
int lab[MAXN],ptn[MAXN],orbits[MAXN];
static DEFAULTOPTIONS(options);
statsblk(stats);
setword workspace[50*MAXM];
int n,m,v,i,edge01;
set *gv;
FILE *printout,*inputdata, *fixedfirst;
options.writeautoms = TRUE;
options.writemarkers = FALSE;
options.cartesian = TRUE;
printout = fopen("printout","w");
options.outfile = printout;
inputdata = fopen("inputdata","r");
fscanf(inputdata,"%d",&n);
m = (n + WORDSIZE - 1) / WORDSIZE;
nauty_check(WORDSIZE,m,n,NAUTYVERSIONID);
/* translate the graph to NAUTY */
for (v = 0; v < n; ++v)
{ gv = GRAPHROW(g,v,m);
EMPTYSET(gv,m);
for (i=0; i<n; i++)
{ fscanf(inputdata,"%d",&edge01);
if (edge01) ADDELEMENT(gv,i);
}
}
nauty(g,lab,ptn,NULL,orbits,&options,&stats,workspace,50*MAXM,m,n,NULL);
fclose(printout);
fclose(inputdata);
fixedfirst = fopen("fixedfirst","w");
options.outfile = fixedfirst;
options.defaultptn = FALSE;
for (i=0; i<n; lab[i]=i, ptn[i++]=1);
*ptn=0; ptn[n-1]=0;
nauty(g,lab,ptn,NULL,orbits,&options,&stats,workspace,50*MAXM,m,n,NULL);
}
----- End forwarded message -----
More information about the Nauty
mailing list