Re: [sage-devel] Suggestion to speed up nauty_geng()?

2019-03-22 Thread Dima Pasechnik
On Thu, 21 Mar 2019 at 18:42, Ai Bo  wrote:

> I found it. Thank you.
> I also tried the command listed above.
> I am confused. Where is this "I]~~w"?
> Is it a file? How did Graph load this?
>
> In my program, my code looks like this:
> i=12
> for G in graphs.nauty_geng(str(i) + " -C"):
> q = True
> for j in range (0,i):
> S = Sandpile(G,j)
> if S.identity() != S.max_stable():
> q = False
> break
>
>
>
> If I use geng to generate graphs, how should I load them in my for loop so
> I can check with Sandpile?
>

I think the bottleneck in you computation is not geng, but Sandpile: you
spend much more time computing Sandpile compared with asking geng for the
next graph.


> On Thursday, March 21, 2019 at 8:46:56 AM UTC-7, Dima Pasechnik wrote:
>>
>> On Thu, Mar 21, 2019 at 3:03 PM Ai Bo  wrote:
>>
>> > is this "nauty26r7/geng" a program available?
>>
>> geng is installed in local/bin/ sub-directory of your Sage
>> installation, as a part of Sage's standard package nauty.
>>
>> > Also, as Python is slow, any part of the nautygen can be written in
>> other language, such as C/C++?
>>
>> it is written in C, so it's quite fast in this sense.
>>
>> >
>> > Thanks,
>> > Laura
>> >
>> > On Wednesday, March 20, 2019 at 11:48:38 PM UTC-7, Jori Mäntysalo (TAU)
>> wrote:
>> >>
>> >> On Thu, 21 Mar 2019, Ai Bo wrote:
>> >>
>> >> > Is there a way to "random access"? For example, access the nth
>> element
>> >> > in the "generator", instead of one by one?
>> >>
>> >> Kind of. As a most time is propably spent by creating Python data
>> >> structures for SageMath, you can use nautygen directly to generate
>> huge
>> >> number of graphs.
>> >>
>> >> As an example, it takes below 5 seconds to generate all biconnected
>> graphs
>> >> on 10 vertices, and I took third last one:
>> >>
>> >> $ nauty26r7/geng 10 -C | tail -3 | head -1
>> >> >A /home/jm58660/lat-koe/nauty26r7/geng -Cd2D9 n=10 e=10-45
>> >> >Z 9743542 graphs generated in 4.59 sec
>> >> I]~~w
>> >>
>> >> and now
>> >>
>> >> sage: g = Graph('I]~~w', format='graph6')
>> >> sage: g.is_biconnected()
>> >> True
>> >>
>> >>
>> >> --
>> >> Jori Mäntysalo
>> >>
>> >> Tampereen yliopisto - Ihminen ratkaisee
>> >
>> > --
>> > 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+...@googlegroups.com.
>> > To post to this group, send email to sage-...@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.


Re: [sage-devel] Suggestion to speed up nauty_geng()?

2019-03-22 Thread Samuel Lelievre
Thu 2019-03-21 18:47:37 UTC, Dima Pasechnik:
> 
> Ideally one should create a fast interface from Python
> to geng, probably using Cython, if it is not already done.

PyNauty is discussed at

- Sage Trac ticket 25506:
  Nauty interface for isomorphism checking and automorphism group computing
  https://trac.sagemath.org/ticket/25506
  (needs review)

-- 
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.


Re: [sage-devel] Suggestion to speed up nauty_geng()?

2019-03-22 Thread Nico Van Cleemput
If you want to use the command that Jori gave in Sage, you can use the fact
that nauty_geng just runs geng and appends the option string after the
command. So if you want to generate the last three graphs that are returned
by geng for biconnected graphs on 10 vertices you can do this:

for g in graphs.nauty_geng("10 -C | tail -3"):
print g


Cheers
Nico

Op vr 22 mrt. 2019 om 08:29 schreef David Coudert :

> Our interface to nauty geng is in Python, but the difficulty is not here.
>
>- It takes time to build graphs from graph6 strings, and also to build
>Sandpiles (12 for each graph)
>- The number of biconnected graphs with 12 nodes is huge:  153.620.333.545
>See https://oeis.org/A002218
>
> Some parallelism could certainly help here, but there will be no miracle.
> A faster method for the tests on Sandpile is needed.
>
>
> Le jeudi 21 mars 2019 19:47:37 UTC+1, Dima Pasechnik a écrit :
>>
>>
>>
>> On Thu, 21 Mar 2019 18:42 Ai Bo,  wrote:
>>
>>> I found it. Thank you.
>>> I also tried the command listed above.
>>> I am confused. Where is this "I]~~w"?
>>>
>>
>> This is a particular way to encode graph as a string of characters (8
>> bits per character).
>> Read Sage docs on Graph for details.
>>
>> Is it a file? How did Graph load this?
>>>
>>> In my program, my code looks like this:
>>> i=12
>>> for G in graphs.nauty_geng(str(i) + " -C"):
>>> q = True
>>> for j in range (0,i):
>>> S = Sandpile(G,j)
>>> if S.identity() != S.max_stable():
>>> q = False
>>> break
>>>
>>>
>>>
>>> If I use geng to generate graphs, how should I load them in my for loop
>>> so I can check with Sandpile?
>>>
>>
>> Ideally one should create a fast interface from Python to geng, probably
>> using Cython, if it is not already done.
>>
>>
>>> On Thursday, March 21, 2019 at 8:46:56 AM UTC-7, Dima Pasechnik wrote:

 On Thu, Mar 21, 2019 at 3:03 PM Ai Bo  wrote:

 > is this "nauty26r7/geng" a program available?

 geng is installed in local/bin/ sub-directory of your Sage
 installation, as a part of Sage's standard package nauty.

 > Also, as Python is slow, any part of the nautygen can be written in
 other language, such as C/C++?

 it is written in C, so it's quite fast in this sense.

 >
 > Thanks,
 > Laura
 >
 > On Wednesday, March 20, 2019 at 11:48:38 PM UTC-7, Jori Mäntysalo
 (TAU) wrote:
 >>
 >> On Thu, 21 Mar 2019, Ai Bo wrote:
 >>
 >> > Is there a way to "random access"? For example, access the nth
 element
 >> > in the "generator", instead of one by one?
 >>
 >> Kind of. As a most time is propably spent by creating Python data
 >> structures for SageMath, you can use nautygen directly to generate
 huge
 >> number of graphs.
 >>
 >> As an example, it takes below 5 seconds to generate all biconnected
 graphs
 >> on 10 vertices, and I took third last one:
 >>
 >> $ nauty26r7/geng 10 -C | tail -3 | head -1
 >> >A /home/jm58660/lat-koe/nauty26r7/geng -Cd2D9 n=10 e=10-45
 >> >Z 9743542 graphs generated in 4.59 sec
 >> I]~~w
 >>
 >> and now
 >>
 >> sage: g = Graph('I]~~w', format='graph6')
 >> sage: g.is_biconnected()
 >> True
 >>
 >>
 >> --
 >> Jori Mäntysalo
 >>
 >> Tampereen yliopisto - Ihminen ratkaisee
 >
 > --
 > 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+...@googlegroups.com.
 > To post to this group, send email to sage-...@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+...@googlegroups.com.
>>> To post to this group, send email to sage-...@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.

Re: [sage-devel] Suggestion to speed up nauty_geng()?

2019-03-22 Thread David Coudert
Our interface to nauty geng is in Python, but the difficulty is not here.

   - It takes time to build graphs from graph6 strings, and also to build 
   Sandpiles (12 for each graph)
   - The number of biconnected graphs with 12 nodes is huge:  153.620.333.545  
   See https://oeis.org/A002218
   
Some parallelism could certainly help here, but there will be no miracle. A 
faster method for the tests on Sandpile is needed.


Le jeudi 21 mars 2019 19:47:37 UTC+1, Dima Pasechnik a écrit :
>
>
>
> On Thu, 21 Mar 2019 18:42 Ai Bo, > wrote:
>
>> I found it. Thank you.
>> I also tried the command listed above.
>> I am confused. Where is this "I]~~w"?
>>
>
> This is a particular way to encode graph as a string of characters (8 bits 
> per character).
> Read Sage docs on Graph for details.
>
> Is it a file? How did Graph load this?
>>
>> In my program, my code looks like this:
>> i=12
>> for G in graphs.nauty_geng(str(i) + " -C"): 
>> q = True
>> for j in range (0,i):
>> S = Sandpile(G,j)
>> if S.identity() != S.max_stable():
>> q = False
>> break
>>
>>
>>
>> If I use geng to generate graphs, how should I load them in my for loop 
>> so I can check with Sandpile?
>>
>
> Ideally one should create a fast interface from Python to geng, probably 
> using Cython, if it is not already done.
>
>
>> On Thursday, March 21, 2019 at 8:46:56 AM UTC-7, Dima Pasechnik wrote:
>>>
>>> On Thu, Mar 21, 2019 at 3:03 PM Ai Bo  wrote: 
>>>
>>> > is this "nauty26r7/geng" a program available? 
>>>
>>> geng is installed in local/bin/ sub-directory of your Sage 
>>> installation, as a part of Sage's standard package nauty. 
>>>
>>> > Also, as Python is slow, any part of the nautygen can be written in 
>>> other language, such as C/C++? 
>>>
>>> it is written in C, so it's quite fast in this sense. 
>>>
>>> > 
>>> > Thanks, 
>>> > Laura 
>>> > 
>>> > On Wednesday, March 20, 2019 at 11:48:38 PM UTC-7, Jori Mäntysalo 
>>> (TAU) wrote: 
>>> >> 
>>> >> On Thu, 21 Mar 2019, Ai Bo wrote: 
>>> >> 
>>> >> > Is there a way to "random access"? For example, access the nth 
>>> element 
>>> >> > in the "generator", instead of one by one? 
>>> >> 
>>> >> Kind of. As a most time is propably spent by creating Python data 
>>> >> structures for SageMath, you can use nautygen directly to generate 
>>> huge 
>>> >> number of graphs. 
>>> >> 
>>> >> As an example, it takes below 5 seconds to generate all biconnected 
>>> graphs 
>>> >> on 10 vertices, and I took third last one: 
>>> >> 
>>> >> $ nauty26r7/geng 10 -C | tail -3 | head -1 
>>> >> >A /home/jm58660/lat-koe/nauty26r7/geng -Cd2D9 n=10 e=10-45 
>>> >> >Z 9743542 graphs generated in 4.59 sec 
>>> >> I]~~w 
>>> >> 
>>> >> and now 
>>> >> 
>>> >> sage: g = Graph('I]~~w', format='graph6') 
>>> >> sage: g.is_biconnected() 
>>> >> True 
>>> >> 
>>> >> 
>>> >> -- 
>>> >> Jori Mäntysalo 
>>> >> 
>>> >> Tampereen yliopisto - Ihminen ratkaisee 
>>> > 
>>> > -- 
>>> > 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+...@googlegroups.com. 
>>> > To post to this group, send email to sage-...@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+...@googlegroups.com .
>> To post to this group, send email to sage-...@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.


Re: [sage-devel] Suggestion to speed up nauty_geng()?

2019-03-21 Thread Dima Pasechnik
On Thu, 21 Mar 2019 18:42 Ai Bo,  wrote:

> I found it. Thank you.
> I also tried the command listed above.
> I am confused. Where is this "I]~~w"?
>

This is a particular way to encode graph as a string of characters (8 bits
per character).
Read Sage docs on Graph for details.

Is it a file? How did Graph load this?
>
> In my program, my code looks like this:
> i=12
> for G in graphs.nauty_geng(str(i) + " -C"):
> q = True
> for j in range (0,i):
> S = Sandpile(G,j)
> if S.identity() != S.max_stable():
> q = False
> break
>
>
>
> If I use geng to generate graphs, how should I load them in my for loop so
> I can check with Sandpile?
>

Ideally one should create a fast interface from Python to geng, probably
using Cython, if it is not already done.


> On Thursday, March 21, 2019 at 8:46:56 AM UTC-7, Dima Pasechnik wrote:
>>
>> On Thu, Mar 21, 2019 at 3:03 PM Ai Bo  wrote:
>>
>> > is this "nauty26r7/geng" a program available?
>>
>> geng is installed in local/bin/ sub-directory of your Sage
>> installation, as a part of Sage's standard package nauty.
>>
>> > Also, as Python is slow, any part of the nautygen can be written in
>> other language, such as C/C++?
>>
>> it is written in C, so it's quite fast in this sense.
>>
>> >
>> > Thanks,
>> > Laura
>> >
>> > On Wednesday, March 20, 2019 at 11:48:38 PM UTC-7, Jori Mäntysalo (TAU)
>> wrote:
>> >>
>> >> On Thu, 21 Mar 2019, Ai Bo wrote:
>> >>
>> >> > Is there a way to "random access"? For example, access the nth
>> element
>> >> > in the "generator", instead of one by one?
>> >>
>> >> Kind of. As a most time is propably spent by creating Python data
>> >> structures for SageMath, you can use nautygen directly to generate
>> huge
>> >> number of graphs.
>> >>
>> >> As an example, it takes below 5 seconds to generate all biconnected
>> graphs
>> >> on 10 vertices, and I took third last one:
>> >>
>> >> $ nauty26r7/geng 10 -C | tail -3 | head -1
>> >> >A /home/jm58660/lat-koe/nauty26r7/geng -Cd2D9 n=10 e=10-45
>> >> >Z 9743542 graphs generated in 4.59 sec
>> >> I]~~w
>> >>
>> >> and now
>> >>
>> >> sage: g = Graph('I]~~w', format='graph6')
>> >> sage: g.is_biconnected()
>> >> True
>> >>
>> >>
>> >> --
>> >> Jori Mäntysalo
>> >>
>> >> Tampereen yliopisto - Ihminen ratkaisee
>> >
>> > --
>> > 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+...@googlegroups.com.
>> > To post to this group, send email to sage-...@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.


Re: [sage-devel] Suggestion to speed up nauty_geng()?

2019-03-21 Thread Ai Bo
I found it. Thank you.
I also tried the command listed above.
I am confused. Where is this "I]~~w"?
Is it a file? How did Graph load this?

In my program, my code looks like this:
i=12
for G in graphs.nauty_geng(str(i) + " -C"): 
q = True
for j in range (0,i):
S = Sandpile(G,j)
if S.identity() != S.max_stable():
q = False
break



If I use geng to generate graphs, how should I load them in my for loop so 
I can check with Sandpile?

On Thursday, March 21, 2019 at 8:46:56 AM UTC-7, Dima Pasechnik wrote:
>
> On Thu, Mar 21, 2019 at 3:03 PM Ai Bo > 
> wrote: 
>
> > is this "nauty26r7/geng" a program available? 
>
> geng is installed in local/bin/ sub-directory of your Sage 
> installation, as a part of Sage's standard package nauty. 
>
> > Also, as Python is slow, any part of the nautygen can be written in 
> other language, such as C/C++? 
>
> it is written in C, so it's quite fast in this sense. 
>
> > 
> > Thanks, 
> > Laura 
> > 
> > On Wednesday, March 20, 2019 at 11:48:38 PM UTC-7, Jori Mäntysalo (TAU) 
> wrote: 
> >> 
> >> On Thu, 21 Mar 2019, Ai Bo wrote: 
> >> 
> >> > Is there a way to "random access"? For example, access the nth 
> element 
> >> > in the "generator", instead of one by one? 
> >> 
> >> Kind of. As a most time is propably spent by creating Python data 
> >> structures for SageMath, you can use nautygen directly to generate huge 
> >> number of graphs. 
> >> 
> >> As an example, it takes below 5 seconds to generate all biconnected 
> graphs 
> >> on 10 vertices, and I took third last one: 
> >> 
> >> $ nauty26r7/geng 10 -C | tail -3 | head -1 
> >> >A /home/jm58660/lat-koe/nauty26r7/geng -Cd2D9 n=10 e=10-45 
> >> >Z 9743542 graphs generated in 4.59 sec 
> >> I]~~w 
> >> 
> >> and now 
> >> 
> >> sage: g = Graph('I]~~w', format='graph6') 
> >> sage: g.is_biconnected() 
> >> True 
> >> 
> >> 
> >> -- 
> >> Jori Mäntysalo 
> >> 
> >> Tampereen yliopisto - Ihminen ratkaisee 
> > 
> > -- 
> > 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+...@googlegroups.com . 
> > To post to this group, send email to sage-...@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.


Re: [sage-devel] Suggestion to speed up nauty_geng()?

2019-03-21 Thread Dima Pasechnik
On Thu, Mar 21, 2019 at 3:03 PM Ai Bo  wrote:

> is this "nauty26r7/geng" a program available?

geng is installed in local/bin/ sub-directory of your Sage
installation, as a part of Sage's standard package nauty.

> Also, as Python is slow, any part of the nautygen can be written in other 
> language, such as C/C++?

it is written in C, so it's quite fast in this sense.

>
> Thanks,
> Laura
>
> On Wednesday, March 20, 2019 at 11:48:38 PM UTC-7, Jori Mäntysalo (TAU) wrote:
>>
>> On Thu, 21 Mar 2019, Ai Bo wrote:
>>
>> > Is there a way to "random access"? For example, access the nth element
>> > in the "generator", instead of one by one?
>>
>> Kind of. As a most time is propably spent by creating Python data
>> structures for SageMath, you can use nautygen directly to generate huge
>> number of graphs.
>>
>> As an example, it takes below 5 seconds to generate all biconnected graphs
>> on 10 vertices, and I took third last one:
>>
>> $ nauty26r7/geng 10 -C | tail -3 | head -1
>> >A /home/jm58660/lat-koe/nauty26r7/geng -Cd2D9 n=10 e=10-45
>> >Z 9743542 graphs generated in 4.59 sec
>> I]~~w
>>
>> and now
>>
>> sage: g = Graph('I]~~w', format='graph6')
>> sage: g.is_biconnected()
>> True
>>
>>
>> --
>> Jori Mäntysalo
>>
>> Tampereen yliopisto - Ihminen ratkaisee
>
> --
> 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.


Re: [sage-devel] Suggestion to speed up nauty_geng()?

2019-03-21 Thread Ai Bo
Another question: If I use  nautygen and generate huge number of graph, how
do I load into sage?
Because in my for loop, I also use other functions such as Sandpile on the
graph generated by nautygen.
Thanks,

On Wed, Mar 20, 2019 at 11:48 PM Jori Mäntysalo (TAU) <
jori.mantys...@tuni.fi> wrote:

> On Thu, 21 Mar 2019, Ai Bo wrote:
>
> > Is there a way to "random access"? For example, access the nth element
> > in the "generator", instead of one by one?
>
> Kind of. As a most time is propably spent by creating Python data
> structures for SageMath, you can use nautygen directly to generate huge
> number of graphs.
>
> As an example, it takes below 5 seconds to generate all biconnected graphs
> on 10 vertices, and I took third last one:
>
> $ nauty26r7/geng 10 -C | tail -3 | head -1
> >A /home/jm58660/lat-koe/nauty26r7/geng -Cd2D9 n=10 e=10-45
> >Z 9743542 graphs generated in 4.59 sec
> I]~~w
>
> and now
>
> sage: g = Graph('I]~~w', format='graph6')
> sage: g.is_biconnected()
> True
>
>
> --
> Jori Mäntysalo
>
> Tampereen yliopisto - Ihminen ratkaisee
>
> --
> 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/QoqD5Ka6068/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.


Re: [sage-devel] Suggestion to speed up nauty_geng()?

2019-03-21 Thread Ai Bo
is this "nauty26r7/geng" a program available?
Also, as Python is slow, any part of the nautygen can be written in other 
language, such as C/C++?

Thanks,
Laura

On Wednesday, March 20, 2019 at 11:48:38 PM UTC-7, Jori Mäntysalo (TAU) 
wrote:
>
> On Thu, 21 Mar 2019, Ai Bo wrote: 
>
> > Is there a way to "random access"? For example, access the nth element 
> > in the "generator", instead of one by one? 
>
> Kind of. As a most time is propably spent by creating Python data 
> structures for SageMath, you can use nautygen directly to generate huge 
> number of graphs. 
>
> As an example, it takes below 5 seconds to generate all biconnected graphs 
> on 10 vertices, and I took third last one: 
>
> $ nauty26r7/geng 10 -C | tail -3 | head -1 
> >A /home/jm58660/lat-koe/nauty26r7/geng -Cd2D9 n=10 e=10-45 
> >Z 9743542 graphs generated in 4.59 sec 
> I]~~w 
>
> and now 
>
> sage: g = Graph('I]~~w', format='graph6') 
> sage: g.is_biconnected() 
> True 
>
>
> -- 
> Jori Mäntysalo 
>
> Tampereen yliopisto - Ihminen ratkaisee

-- 
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.


Re: [sage-devel] Suggestion to speed up nauty_geng()?

2019-03-20 Thread TAU
On Thu, 21 Mar 2019, Ai Bo wrote:

> Is there a way to "random access"? For example, access the nth element 
> in the "generator", instead of one by one?

Kind of. As a most time is propably spent by creating Python data 
structures for SageMath, you can use nautygen directly to generate huge 
number of graphs.

As an example, it takes below 5 seconds to generate all biconnected graphs 
on 10 vertices, and I took third last one:

$ nauty26r7/geng 10 -C | tail -3 | head -1
>A /home/jm58660/lat-koe/nauty26r7/geng -Cd2D9 n=10 e=10-45
>Z 9743542 graphs generated in 4.59 sec
I]~~w

and now

sage: g = Graph('I]~~w', format='graph6')
sage: g.is_biconnected()
True


-- 
Jori Mäntysalo

Tampereen yliopisto - Ihminen ratkaisee

-- 
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.


[sage-devel] Suggestion to speed up nauty_geng()?

2019-03-20 Thread Ai Bo
I am running a program with these lines:
 i =12
 for G in graphs.nauty_geng(str(i) + " -C"):

It is very slow. I know the returned generator is very large. Is there a 
way to speed this up?

Is there a way to "random access"? For example, access the nth element in 
the "generator", instead of one by one?

Thank you!

-- 
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.