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

Susanne Nieß niess at ma.tum.de
Wed Feb 2 03:10:07 EST 2011


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.





More information about the Nauty mailing list