[Nauty-list] readgraph() (Susanne Nie?)

Gordon Royle gordon at maths.uwa.edu.au
Wed Feb 2 10:04:31 EST 2011


This may be silly because you have not sent us a complete program, but where is (a) the variables "orbits" etc defined? (b)  g2 and g3 defined and allocated...

Perhaps if you could send an entire program, together with input then it would be easier to debug...

Gordon

On 02/02/2011, at 12:10 AM, Susanne Nieß wrote:

> Thank you for your help; unfortunately it did not solve the problem. With readg, the program still complains about an illegal character.
> 
> Now I have an even more severe problem: I get a segmentation fault, seemingly when I use nauty. I wrote a function that takes the upper triangle of the adjacency matrix of a graph and writes the graph in the format that nauty uses (I need such a function and could not find any) and in my test program I call this function and than nauty and the result is a segmenation fault. As I am not able to read a graph with a function from the nauty-package, I can not say if my format-changing function causes the problem.
> 
> 
> My function is:
> 
> void zunau1(graph *gn,int *gs,int l,int m)
> /* wandelt einen Graphen ins nauty-Speicherformat um */
> /* gn = Graph in nauty-Format (packed) */
> /* gs = Graph as adjacency matrix */
> /* l = number of nodes */
> /* m = ceil(l/WORDSIZE) */
> {
> int i,j;
> set *gv;
> 
> for(i=0;i<l;i++)
>  {
>   gv=GRAPHROW(gn,i,m);
>   EMPTYSET(gv,m);
>   for(j=0;j<i;j++)
>    {
>     if(*(gs+j*l+i))
>      {
>       ADDELEMENT(gv,j);
>      }
>    }
>   for(j=i+1;j<l;j++)
>    {
>     if(*(gs+i*l+j))
>      {
>       ADDELEMENT(gv,j);
>      }
>    }
>  }
> 
> 
> } /* end of zunau1 */
> 
> The part of main() where the error occurs is the following:
> 
> for(i =0; i<anz; i++)
>  {
>   zunau1(g2 + i*l*m, f1+i*l*l, l,m);
>  }
>  printf("test4\n");
> 
> DEFAULTOPTIONS_GRAPH(options);
> options.getcanon=TRUE;
>  printf("test5\n");
> 
> for(i =0; i<anz; i++)
>  {
>   nauty(g2+i*l*m,lab,ptn,NULL,orbits,&options,stats,workspace,5*m,m,l,g3+i*l*m);
>  }
> printf("test6\n");
> 
> 
> 
> On 01/26/11 05:16 PM, William Rummler wrote:
>> You should be using opengraphfile() and readg() from gtools.h to read
>> graphs generated by geng. Here is a short example program that
>> illustrates basic usage.
> 
> 
> _______________________________________________
> Nauty-list mailing list
> Nauty-list at cs.anu.edu.au
> http://dcsmail.anu.edu.au/cgi-bin/mailman/listinfo/nauty-list
> 





More information about the Nauty mailing list