Hi,
 

> - Try networkx : 
> sage: import networkx 
> sage: g=graphs.PetersenGraph().networkx_graph() 
> sage: networkx.diameter(g) 
> 2 
>
> - You tell me that you will review the patch, and you have it in a 
> couple of hours at most.  
>

> Of course the second way out is the only one that actually solves the 
> problem :-P
>

Thanks for offering -- I can try to review it. (In the old world, I'd say I 
can certainly review it,) But I first have to dig through the documentation 
of how to review a patch. But I will try doing so then... 

> (Did you see my followup question? Any idea what goes on there?) 
>
> Well, you gave an example of code with undefined variables. Soooooooo 
> unless you tell me what "cov" is the only answer I could give you in 
> my previous email is "beware of labels" :-P 
> Your "cov" list is 25000 elements long. If I try the same with normal 
> objects (integers), I get : 
>
> sage: cov = [(randint(0,5000),randint(0,5000)) for i in range(25000)] 
> sage: %timeit Graph(cov) 
> 1 loops, best of 3: 847 ms per loop 
>
> Which is still quite slow, admittedly... 
>

sage: cov
[[((1, 3, 5), (0, 2, 4)), ((2, 3, 5), (0, 1, 4))],
 [((1, 3, 5), (0, 2, 4)), ((1, 4, 5), (0, 2, 3))],
 [((2, 3, 5), (0, 1, 4)), ((3, 4, 5), (0, 1, 2))],
 [((1, 4, 5), (0, 2, 3)), ((2, 4, 5), (0, 3, 1))],
 [((2, 4, 5), (0, 3, 1)), ((3, 4, 5), (0, 1, 2))]]

 so my covers are unlabelled graphs with vertices indexed by tuples (of 
size <10) of tuples (of size < 6) of integers.

But my impression is that "G = Graph(cov)" should not take considerably 
longer than "G = Graph(); G.add_edges(cov)", independent on what cov is, as 
long as the outcome is indeed the same.

Thx, C.

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to