~ubuntu-branches/ubuntu/trusty/python-networkx/trusty-proposed

« back to all changes in this revision

Viewing changes to networkx/tests/generators/random_graphs.txt

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Brulebois
  • Date: 2009-02-28 13:36:24 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090228133624-9l5rwi1ftlzc7b0l
* Upload to unstable now that lenny is released (yay).
* Fix FTBFS with python-support 0.90.3: no longer rely on its internal
  behaviour, and xnow set tests/test.py executable right after “setup.py
  install” (Closes: #517065).
* Drop executable bits from bz2 files.
* Update Vcs-* fields: move from DPMT's svn to collab-maint's git.
* Remote DPMT from Uploaders, following Piotr Ożarowski's request.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Generators - Random Graphs
2
 
----------------------------
3
 
 
4
 
>>> from networkx import *
5
 
>>> from networkx.generators.random_graphs import *
6
 
 
7
 
 
8
 
Smoke test the random graphs
9
 
----------------------------
10
 
 
11
 
>>> G=gnp_random_graph(100,0.25)
12
 
>>> G=binomial_graph(100,0.25)
13
 
>>> G=erdos_renyi_graph(100,0.25)
14
 
>>> G=fast_gnp_random_graph(100,0.25)
15
 
>>> G=gnm_random_graph(100,20)
16
 
>>> G=dense_gnm_random_graph(100,20)
17
 
 
18
 
>>> G=watts_strogatz_graph(10,2,0.25)
19
 
>>> len(G)
20
 
10
21
 
>>> G.number_of_edges()
22
 
10
23
 
>>> G=watts_strogatz_graph(10,4,0.25)
24
 
>>> len(G)
25
 
10
26
 
>>> G.number_of_edges()
27
 
20
28
 
 
29
 
>>> G=newman_watts_strogatz_graph(10,2,0.0)
30
 
>>> len(G)
31
 
10
32
 
>>> G.number_of_edges()
33
 
10
34
 
>>> G=newman_watts_strogatz_graph(10,4,0.25)
35
 
>>> len(G)
36
 
10
37
 
>>> G.number_of_edges() >= 20
38
 
True
39
 
 
40
 
 
41
 
>>> G=barabasi_albert_graph(100,1)
42
 
>>> G=powerlaw_cluster_graph(100,1,1.0)
43
 
 
44
 
 
45
 
>>> G=random_regular_graph(10,20)
46
 
>>> G=random_regular_graph(3,21)
47
 
Traceback (most recent call last):
48
 
...
49
 
NetworkXError: n * d must be even
50
 
 
51
 
>>> constructor=[(10,20,0.8),(20,40,0.8)]
52
 
>>> G=random_shell_graph(constructor)        
53
 
 
54
 
>>> s=random_powerlaw_tree_sequence(10,gamma=3,tries=1000)
55
 
>>> s=random_powerlaw_tree(10,gamma=3,tries=1000)
56