Statistics
| Branch: | Revision:

iof-tools / networkxMiCe / networkx-master / doc / release / api_1.6.rst @ 5cef0f13

History | View | Annotate | Download (3.35 KB)

1
*********************************
2
Version 1.6 notes and API changes
3
*********************************
4

    
5
This page reflects API changes from networkx-1.5 to networkx-1.6.
6

    
7
Please send comments and questions to the networkx-discuss mailing list:
8
http://groups.google.com/group/networkx-discuss .
9

    
10
Graph Classes
11
-------------
12

    
13
The degree* methods in the graph classes (Graph, DiGraph, MultiGraph,
14
MultiDiGraph) now take an optional weight= keyword that allows computing
15
weighted degree with arbitrary (numerical) edge attributes.  Setting 
16
weight=None is equivalent to the previous weighted=False.
17

    
18

    
19
Weighted graph algorithms
20
-------------------------
21

    
22
Many 'weighted' graph algorithms now take optional parameter to 
23
specify which edge attribute should be used for the weight
24
(default='weight') (ticket https://networkx.lanl.gov/trac/ticket/573)
25

    
26
In some cases the parameter name was changed from weighted, to weight.  Here is
27
how to specify which edge attribute will be used in the algorithms:
28

    
29
- Use weight=None to consider all weights equally (unweighted case)
30

    
31
- Use weight='weight' to use the 'weight' edge attribute
32

    
33
- Use weight='other' to use the 'other' edge attribute 
34

    
35
Algorithms affected are:
36

    
37
to_scipy_sparse_matrix, 
38
clustering,
39
average_clustering,
40
bipartite.degree,
41
spectral_layout,
42
neighbor_degree,
43
is_isomorphic,
44
betweenness_centrality,
45
betweenness_centrality_subset,
46
vitality,
47
load_centrality,
48
mincost,
49
shortest_path,
50
shortest_path_length,
51
average_shortest_path_length
52

    
53

    
54
Isomorphisms
55
------------
56

    
57
Node and edge attributes are now more easily incorporated into isomorphism
58
checks via the 'node_match' and 'edge_match' parameters.  As part of this
59
change, the following classes were removed::
60

    
61
    WeightedGraphMatcher
62
    WeightedDiGraphMatcher
63
    WeightedMultiGraphMatcher
64
    WeightedMultiDiGraphMatcher
65

    
66
The function signature for 'is_isomorphic' is now simply::
67

    
68
    is_isomorphic(g1, g2, node_match=None, edge_match=None)
69

    
70
See its docstring for more details.  To aid in the creation of 'node_match'
71
and 'edge_match' functions, users are encouraged to work with::
72

    
73
    categorical_node_match
74
    categorical_edge_match
75
    categroical_multiedge_match
76
    numerical_node_match
77
    numerical_edge_match
78
    numerical_multiedge_match
79
    generic_node_match
80
    generic_edge_match
81
    generic_multiedge_match
82

    
83
These functions construct functions which can be passed to 'is_isomorphic'.
84
Finally, note that the above functions are not imported into the top-level
85
namespace and should be accessed from 'networkx.algorithms.isomorphism'.
86
A useful import statement that will be repeated throughout documentation is::
87

    
88
    import networkx.algorithms.isomorphism as iso
89

    
90
Other
91
-----
92
* attracting_components
93

    
94
  A list of lists is returned instead of a list of tuples.
95

    
96
* condensation
97

    
98
  The condensation algorithm now takes a second argument (scc) and returns a   
99
  graph with nodes labeled as integers instead of node tuples.
100

    
101
* degree connectivity
102

    
103
  average_in_degree_connectivity and average_out_degree_connectivity have 
104
  have been replaced with 
105

    
106
  average_degree_connectivity(G, source='in', target='in')
107

    
108
  and
109

    
110
  average_degree_connectivity(G, source='out', target='out')
111

    
112
* neighbor degree
113

    
114
  average_neighbor_in_degree and  average_neighbor_out_degreey have 
115
  have been replaced with 
116

    
117
  average_neighbor_degree(G, source='in', target='in')
118

    
119
  and
120

    
121
  average_neighbor_degree(G, source='out', target='out')
122