[Nauty-list] Using combinatorial data

Brendan McKay bdm at cs.anu.edu.au
Wed May 23 13:49:40 EST 2007


I'll upgrade Gordon's code a little and add some comments.
Link this with gtools.o.

 
#include "gtools.h"

int
main(int argc, char *argv[])
{

  graph *g;
  int m,n;

  int codetype;
  FILE *infile;

  infile = opengraphfile(NULL,&codetype,0,1);
         /* Replace NULL by a filename if you want to read from a file.
            Using NULL means you want to read from stdin. */

  if (infile == NULL)
  {
      fprintf(stderr,"Error: Can't open input file\n");
      exit(1);
  }

  while ((g = readg(infile,NULL,0,&m,&n)) != NULL)
  {

   //PUT YOUR CODE HERE
   // To write g to stdout use   writeg6(stdout,g,m,n);
   //                       or   writes6(stdout,g,m,n);
   // To write to a file you need to first open the file
   //      yourself using fopen.

     free(g);   /* After you finished with the graph */
  }
}

> On 23/05/2007, at 10:32 AM, Elton Zhang wrote:
> 
> >Dear all,
> >There are some combinatorial data on Professor Mckay's web pages. I  
> >am writing a program to use them. My target is that, from the  
> >collection of simple graphs, my program will pick up all those  
> >graphs having a certain property. So the action carried out will be  
> >accessing the data in some .g6 files, testing each graph for the  
> >property and then write the one with the answer "yes" to other .g6  
> >files.
> >
> >My question here is that whether there is a interface in the  
> >package of Nauty for reading and writing .g6 files? It would be  
> >appreciated if you could give me some advises on such works.
> >
> >Thank you for your attension!
> >
> >Best Regards,
> >Zan-Bo Zhang
> >
> >????????????????????????3.5G?????????20M?????????
> >_______________________________________________
> >Nauty-list mailing list
> >Nauty-list at cs.anu.edu.au
> >http://dcsmail.anu.edu.au/cgi-bin/mailman/listinfo/nauty-list
> 
> --
> Associate Professor Gordon Royle
> Department of Computer Science & Software Engineering
> University of Western Australia
> http://people.csse.uwa.edu.au/gordon
> 
> 
> 
> 
> 
> _______________________________________________
> 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