[Nauty] Nauty Newbie

Saul Spatz saul.spatz at gmail.com
Fri Apr 28 10:26:57 AEST 2017


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. */
    ++counter;
    sparsegraph h;
    SG_INIT(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
    DYNALLOC1(size_t,eno,eno_sz,gnde,"linegraphg");
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.


More information about the Nauty mailing list