Example #1
0
static void
na_newedge(graph *g1, int m1, int n1, boolean dolabel)
/* Make all graphs by non-adjacent edge addition. */
{
    int n2,m2;
    int v1,v2,w1,w2;
    set *sv1,*sw1;
    graph *gq;
#if MAXN
    graph h[MAXN*MAXM];
    grapg g2[MAXN*MAXM];
#else
    DYNALLSTAT(graph,h,h_sz);
    DYNALLSTAT(graph,g2,g2_sz);
#endif

    n2 = n1 + 2;
    m2 = (n2 + WORDSIZE - 1) / WORDSIZE;
    if (m2 < m1) m2 = m1;

#if !MAXN
    DYNALLOC2(graph,g2,g2_sz,m2,n2,"newedgeg");
    if (dolabel) DYNALLOC2(graph,h,h_sz,m2,n2,"newedgeg");
#endif

    for (v1 = 0, sv1 = g1; v1 < n1-3; ++v1, sv1 += m1)
        for (w1 = v1+1, sw1 = sv1 + m1; w1 < n1-1; ++w1, sw1 += m1)
        {
            for (v2 = v1; (v2 = nextelement(sv1,m1,v2)) >= 0; )
                for (w2 = w1; (w2 = nextelement(sw1,m1,w2)) >= 0; )
                {
                    if (v2 == w1 || v2 == w2) continue;

                    newedge(g1,m1,n1,v1,v2,w1,w2,g2,m2);

                    gq = g2;

                    if (dolabel)
                    {
                        fcanonise(g2,m2,n2,h,NULL,FALSE);  /* FIXME (loops) */
                        gq = h;
                    }
                    if (outcode == SPARSE6) writes6(outfile,gq,m2,n2);
                    else                    writeg6(outfile,gq,m2,n2);
                    ++nout;
                }
        }
}
Example #2
0
void
writeg6x(FILE *f, graph *g, int n1, int n2)
/* write graph g (n1+n2 vertices) to file f in graph6 format */
{
    writeg6(f,g,1,n1+n2);
}
Example #3
0
void
static writeg6x(FILE *f, graph *g, int n)
/* write graph g (n vertices) to file f in graph6 format */
{
	writeg6(f,g,1,n);
}