[Nauty-list] Coloring Inside the Lines

Susanne Nieß tarenil at web.de
Sun Oct 6 03:29:39 EST 2013


Hi Craig,

For your first question, here is an example (lm being the number of 
vertices):

  m=(lm+WORDSIZE-1)/WORDSIZE;
  nauty_check(WORDSIZE,m,lm,NAUTYVERSIONID);

  lab=(int*)malloc(lm*sizeof(int));
  if(!lab)
   {
    printf("lab kriegt keinen Speicherplatz.\n");
    exit(0);
   }
  ptn=(int*)malloc(lm*sizeof(int));
  if(!ptn)
   {
    printf("ptn kriegt keinen Speicherplatz.\n");
    exit(0);
   }
  orbits=(int*)malloc(lm*sizeof(int));
  if(!orbits)
   {
    printf("orbits kriegt keinen Speicherplatz.\n");
    exit(0);
   }
  DYNALLOC1(setword,workspace,workspace_sz,50*m,"malloc");
  DEFAULTOPTIONS_GRAPH(options);
  options.getcanon=TRUE;
  options.defaultptn=FALSE;
  for(i=0;i<lm;i++)
   {
    *(lab+i)=i;
    *(ptn+i)=1;
   }

  for(i=0; i < s; i++)
   {
    *(ptn+i)=0;
   }
   *(ptn+l-1)=0;
   *(ptn+lm-1)=0;


      nauty(an,lab,ptn,NULL,orbits,&options,&stats,workspace,50*m,m,lm,en);


I do not think that sparse graphs must be directed. The difference is: 
If your graph is big and has only a small number of edges (which is 
meant by sparse), then sparse representation uses a lot less memory than 
dense. If the graph is dense (meaning the edges it has are a 
considerable proportion of the edges it could have, given its number of 
vertices), sparse representation is very inefficient.

Susanne
Am 03.10.2013 03:35, schrieb craig.ross at gm.com:
>
>
> Craig Ross --- Coloring Inside the Lines ---
>
> From:	"Craig Ross" <craig.ross at gm.com>
> To	"" <nauty-list at anu.edu.au>
> Date:	Wed, Oct 2, 2013 6:36 PM
> Subject	Coloring Inside the Lines
>
> ------------------------------------------------------------------------
>
> I need to learn more about coloring in nauty and am looking for examples
> or pointers in programming. I've experimented in dreadnaut and read
> about the lab and ptn arrays, but I haven't found examples that show how
> to code using them.  Does anyone have any tips?
> Oh, another newbie question - I'm a little confused about dense versus
> sparse. I have fairly small, undirected graphs.  The manual suggests
> that sparse wants directed graphs, so I'm thinking I want to use the
> dense mode. Does that sound right? The code in the examples certainly
> looks different between them, so I want to be sure I'm learning the
> right mode.
> Craig
>
> Nothing in this message is intended to constitute an electronic
> signature unless a specific statement to the contrary is included in
> this message.
>
> Confidentiality Note: This message is intended only for the person or
> entity to which it is addressed. It may contain confidential and/or
> privileged material. Any review, transmission, dissemination or other
> use, or taking of any action in reliance upon this message by persons or
> entities other than the intended recipient is prohibited and may be
> unlawful. If you received this message in error, please contact the
> sender and delete it from your computer.
>
>
> _______________________________________________
> 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