~ubuntu-branches/ubuntu/precise/python-networkx/precise

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Sandro Tosi
  • Date: 2010-02-26 00:20:57 UTC
  • mfrom: (1.3.1 upstream) (5.1.2 experimental)
  • Revision ID: james.westby@ubuntu.com-20100226002057-c4s3jshtx2o36wtx
Tags: 1.0.1-1
* New upstream release; thanks to Yaroslav Halchenko for the report;
  Closes: #565319
* debian/control
  - take maintainership back under DPMT umbrella; thanks to Cyril Brulebois
    for his work
  - adjust Vcs-{Svn, Browser} to point to DPMT location
  - bump Standards-Version to 3.8.4
    + added debian/README.source
  - replace b-d-i on python-all-dev with python only
  - use HTTP (and not HTTPS) for Homepage field
  - rephrased short description; thanks to Rogério Brito for the report;
    Closes: #557895
* debian/pyversions
  - minimum version set to 2.5
* debian/copyright
  - updated upstream copyright authors and license information
  - update copyright notice for packaging
* debian/watch
  - updated to report numerical (with dots) releases
* debian/patches/20_fix_broken_svn_keyboards
  - removed, fixed upstream
* debian/patches/20_example_dirs_remove
  - don't created empty dirs for examples no more present

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
>>> from networkx import *
8
8
>>> from networkx.generators.degree_seq import *
9
9
>>> from networkx.algorithms.isomorphism.isomorph import graph_could_be_isomorphic
10
 
>>> is_isomorphic=graph_could_be_isomorphic # use fast but weak isomorphism checker
11
10
 
12
11
configuration_model
13
12
-------------------
42
41
>>> is_valid_degree_sequence(z)
43
42
True
44
43
 
 
44
>>> DG=configuration_model(z,create_using=DiGraph())
 
45
Traceback (most recent call last):
 
46
...
 
47
NetworkXError: Directed Graph not supported
 
48
 
45
49
>>> G=havel_hakimi_graph(z)
46
50
>>> G=configuration_model(z)
47
51
>>> z=[1000,3,3,3,3,2,2,2,1,1,1]
48
52
>>> is_valid_degree_sequence(z)
49
53
False
50
54
 
 
55
 
51
56
expected_degree_graph
52
57
---------------------
53
58
empty graph has empty degree sequence
68
73
>>> is_isomorphic(G1,G2)
69
74
True
70
75
 
 
76
>>> DG=expected_degree_graph(z,create_using=DiGraph())
 
77
Traceback (most recent call last):
 
78
...
 
79
NetworkXError: Directed Graph not supported
71
80
 
72
81
 
73
82
Havel-Hakimi Construction
100
109
True
101
110
>>> G=havel_hakimi_graph(z)
102
111
 
 
112
>>> G=havel_hakimi_graph(z,create_using=DiGraph())
 
113
Traceback (most recent call last):
 
114
...
 
115
NetworkXError: Directed Graph not supported
 
116
 
 
117
>>> G=havel_hakimi_graph(z,create_using=MultiGraph())
 
118
Traceback (most recent call last):
 
119
...
 
120
NetworkXError: Havel-Hakimi requires simple graph
 
121
 
 
122
 
103
123
Degree Sequence Tree
104
124
--------------------
105
125
 
112
132
>>> len(G.edges())==sum(z)/2
113
133
True
114
134
 
 
135
>>> G=degree_sequence_tree(z,create_using=DiGraph())
 
136
Traceback (most recent call last):
 
137
...
 
138
NetworkXError: Directed Graph not supported
 
139
 
115
140
>>> z=[1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 4]
116
141
>>> is_valid_degree_sequence(z)
117
142
False
188
213
>>> degs == z
189
214
True
190
215
 
 
216
>>> DG=li_smax_graph(z,create_using=DiGraph())
 
217
Traceback (most recent call last):
 
218
...
 
219
NetworkXError: Directed Graph not supported
 
220
 
191
221
 
192
222
S-metric
193
223
--------