Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Fixed ...
Browse files Browse the repository at this point in the history
  • Loading branch information
Michele Borassi committed Aug 19, 2015
1 parent 4dba3d9 commit 9c97e28
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/sage/graphs/hyperbolicity.pyx
Expand Up @@ -1210,32 +1210,32 @@ def hyperbolicity(G,
sage: from sage.graphs.hyperbolicity import hyperbolicity
sage: for i in xrange(10): # long time
... G = graphs.RandomBarabasiAlbert(100,2)
... d1,_,_ = hyperbolicity(G,algorithm='basic')
... d2,_,_ = hyperbolicity(G,algorithm='CCL')
... d3,_,_ = hyperbolicity(G,algorithm='CCL+')
... d4,_,_ = hyperbolicity(G,algorithm='CCL+FA')
... d5,_,_ = hyperbolicity(G,algorithm='BCCM')
... l3,_,u3 = hyperbolicity(G,approximation_factor=2)
... if (not d1==d2==d3==d4==d5) or l3>d1 or u3<d1:
... print "That's not good!"
....: G = graphs.RandomBarabasiAlbert(100,2)
....: d1,_,_ = hyperbolicity(G,algorithm='basic')
....: d2,_,_ = hyperbolicity(G,algorithm='CCL')
....: d3,_,_ = hyperbolicity(G,algorithm='CCL+')
....: d4,_,_ = hyperbolicity(G,algorithm='CCL+FA')
....: d5,_,_ = hyperbolicity(G,algorithm='BCCM')
....: l3,_,u3 = hyperbolicity(G,approximation_factor=2)
....: if (not d1==d2==d3==d4==d5) or l3>d1 or u3<d1:
....: print "That's not good!"
sage: from sage.graphs.hyperbolicity import hyperbolicity
sage: import random
sage: random.seed()
sage: for i in range(10): # long time
... n = random.randint(2, 20)
... m = random.randint(0, n*(n-1) / 2)
... G = graphs.RandomGNM(n, m)
... for cc in G.connected_components_subgraphs():
... d1,_,_ = hyperbolicity(cc, algorithm='basic')
... d2,_,_ = hyperbolicity(cc, algorithm='CCL')
... d3,_,_ = hyperbolicity(cc, algorithm='CCL+')
... d4,_,_ = hyperbolicity(cc, algorithm='CCL+FA')
... d5,_,_ = hyperbolicity(cc, algorithm='BCCM')
... l3,_,u3 = hyperbolicity(cc, approximation_factor=2)
... if (not d1==d2==d3==d4==d5) or l3>d1 or u3<d1:
... print "Error in graph ", cc.edges()
....: n = random.randint(2, 20)
....: m = random.randint(0, n*(n-1) / 2)
....: G = graphs.RandomGNM(n, m)
....: for cc in G.connected_components_subgraphs():
....: d1,_,_ = hyperbolicity(cc, algorithm='basic')
....: d2,_,_ = hyperbolicity(cc, algorithm='CCL')
....: d3,_,_ = hyperbolicity(cc, algorithm='CCL+')
....: d4,_,_ = hyperbolicity(cc, algorithm='CCL+FA')
....: d5,_,_ = hyperbolicity(cc, algorithm='BCCM')
....: l3,_,u3 = hyperbolicity(cc, approximation_factor=2)
....: if (not d1==d2==d3==d4==d5) or l3>d1 or u3<d1:
....: print "Error in graph ", cc.edges()
The hyperbolicity of a graph is the maximum value over all its biconnected
components::
Expand Down

0 comments on commit 9c97e28

Please sign in to comment.