# HG changeset patch
# User dcoudert <david.coudert@inria.fr>
# Date 1357168829 -3600
# Node ID 77bc622f946ced0ce818727c97d7a549ad256dc5
# Parent e27261c504d051224740d33cea91baf74b947d0a
trac #13808 -- combinations patch
diff --git a/sage/graphs/hyperbolicity.pyx b/sage/graphs/hyperbolicity.pyx
a
|
b
|
|
368 | 368 | for u,v in G.edge_iterator(labels=None): |
369 | 369 | ggnx.add_edge(u,v) |
370 | 370 | |
371 | | from sage.combinat.combinat import combinations_iterator |
| 371 | from sage.combinat.combination import Combinations |
372 | 372 | cdef list elim = [] |
373 | 373 | cdef set L = set() |
374 | 374 | |
… |
… |
|
383 | 383 | # update the list of vertices of degree at most max_degree. |
384 | 384 | u = L.pop() |
385 | 385 | X = ggnx.neighbors(u) |
386 | | if all(ggnx.has_edge(v,w) for v,w in combinations_iterator(X,2)): |
| 386 | if all(ggnx.has_edge(v,w) for v,w in Combinations(X,2).list()): |
387 | 387 | elim.append(u) |
388 | 388 | ggnx.remove_node(u) |
389 | 389 | for v,d in ggnx.degree_iter(X): |
… |
… |
|
803 | 803 | Comparison of results:: |
804 | 804 | |
805 | 805 | sage: from sage.graphs.hyperbolicity import hyperbolicity |
806 | | sage: for i in xrange(10): # long test |
| 806 | sage: for i in xrange(10): # long time |
807 | 807 | ... G = graphs.RandomBarabasiAlbert(100,2) |
808 | 808 | ... d1,_,_ = hyperbolicity(G,algorithm='basic') |
809 | 809 | ... d2,_,_ = hyperbolicity(G,algorithm='cuts') |