Why would you want to modify geng.c? From your previous comments I get the
impression that you are not familiar with the algorithm that geng uses.
You're not even familiar with the way geng encodes graphs. In that case it
is almost guaranteed that you will break something if you modify it.

So again, why would you want to modify it? If it is to obtain an even
split, then you can only do this by generating all graphs and then
splitting the output. The commands to do this without translating the
intermediate graphs to the Sage data structure have been shown in the other
thread. For anything larger than 12 this will still be too slow since there
are just so many graphs.

The builtin splitting in geng works by generating the graphs and at a
certain depth in the generation tree counting the branches and only
proceeding if the number modulo mod is equal to res. This way not
everything is generated and if this is done at a suitable depth then the
splitting will be fairly equal.

Cheers
Nico

Op vr 22 mrt. 2019 om 06:06 schreef Ai Bo <boaisp...@gmail.com>:

> Sorry for not being clear.
> I meant I used geng —help.
> Apparently, the equal divide doesn’t help in my example case.
> Where is this geng.c file? If I modify geng.c, how should I build geng?
>
> On Thu, Mar 21, 2019 at 9:58 PM John H Palmieri <jhpalmier...@gmail.com>
> wrote:
>
>>
>>
>> On Thursday, March 21, 2019 at 9:38:03 PM UTC-7, Ai Bo wrote:
>>>
>>> Saw this in the document:
>>>  res/mod : only generate subset res out of subsets 0..mod-1
>>>
>>
>> It would help if you gave some context for this. I'm guessing that most
>> Sage users won't know what "geng" is. I certainly didn't. I found by
>> searching the source code that you found this help message in the method
>> "nauty_geng" in graph_generators.py: you should have said this at the start
>> instead of just "saw this in the document". This makes it look like the
>> program "geng" comes from nauty. Now look at the nauty source code (there
>> is a tar file in the "upstream" directory, if you have a source code
>> version of Sage, also available at
>> http://files.sagemath.org/spkg/upstream/nauty/index.html). The nauty
>> manual says
>>
>> res/mod : only generate subset res out of subsets 0..mod-1
>>
>> and
>>
>> See program text for much more information.
>>
>> The file geng.c says
>>
>>             mod, res = a way to restrict the output to a subset.
>>                         All the graphs in G(n,mine..maxe) are divided
>> into
>>                         disjoint classes C(0,mod),C(1,mod),...,C(mod-1,
>> mod),
>>                         of very approximately equal size.
>>                         Only the class C(res,mod) is written.
>>
>>                         If the -x or -X switch is used, they must have
>> the
>>                         same value for different values of res;
>> otherwise
>>                         the partitioning may not be valid.  In this case
>>                         (-x,-X with constant value), the usual
>> relationships
>>                         between modulo classes are obeyed; for example
>>                         C(3,4) = C(3,8) union C(7,8).  This is not true
>>                         if 3/8 and 7/8 are done with -x or -X values
>>                         different from those used for 3/4.
>>
>>
>>
>>>
>>> How is the output divided?
>>>
>>> I tried with : ../sage-8.6/local/bin/geng 6 -C 0/7
>>> and then I iterated from 0/7, 1/7, 2/7, 3/7....
>>> Why the output is 27, 21, 7, 1, 0, 0, ...
>>>
>>> How is the subset generated?
>>>
>>> Thank you.
>>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "sage-devel" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/sage-devel/FJZoODSZK3Q/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> sage-devel+unsubscr...@googlegroups.com.
>> To post to this group, send email to sage-devel@googlegroups.com.
>> Visit this group at https://groups.google.com/group/sage-devel.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to