[Nauty] Getting Started with Nauty

Gordon Royle gordon.royle at uwa.edu.au
Fri Apr 28 11:08:49 AEST 2017

On the command line

geng -c 10 9 | linegraphg

does your job.

On 28 Apr 2017, at 8:25 am, Saul Spatz <saul.spatz at gmail.com<mailto:saul.spatz at gmail.com>> wrote:

I'm a complete newbie.  I'm trying to write program that will call geng to
generate trees of a given order and compute their line graphs.  I modified
callgeng.c do construct the trees, and it ran successfully.  Since there
doesn't seem to be a nauty function to compute the line graphs, I just
copied the function linegraph from linegraphg.c.  Now my OUTPROC looks like:

void OUTPROC(FILE *outfile, graph *g, int n)
{    /* This will be called for each graph. */
   sparsegraph h;
   linegraph( (sparsegraph *) g, &h);

When I run the code, I get the error

callgeng(30563,0x7fff7d2c9300) malloc: *** mach_vm_map(size=2251799813685248)
failed (error code=3)
*** error: can't allocate region

Apparently this occurs the first time the line
is executed.  I have never called SG_INIT for g, because the example shows
that OUTPROC takes a parameter of type graph*, so I have just cast the
pointer to (sparsegraph*) when calling linegraph.

Is this the source of the problem?  Is there a built-in way to construct a
sparsegraph from a dense graph?

Thanks for any assistance you can give me.
Nauty mailing list
Nauty at anu.edu.au<mailto:Nauty at anu.edu.au>

Gordon Royle

School of Mathematics and Statistics
University of Western Australia

Email: gordon.royle at uwa.edu.au<mailto:gordon.royle at uwa.edu.au>

(Note: my gordon at maths.uwa.edu.au<mailto:gordon at maths.uwa.edu.au> address is deprecated and will stop working soon.)

More information about the Nauty mailing list