graph_tool.rst 4.82 KB
Newer Older
1
.. automodule:: graph_tool
2
3
   :no-members:
   :no-undoc-members:
4

Tiago Peixoto's avatar
Tiago Peixoto committed
5
   .. autoclass:: Graph
6
7
    :no-members:
    :no-undoc-members:
8

9
    .. automethod:: copy
10

11
    .. container:: sec_title
12

13
       Iterating over vertices and edges
14

15
    See :ref:`sec_iteration` for more documentation and examples.
16

17
18
    .. automethod:: vertices
    .. automethod:: edges
19

20
    .. container:: sec_title
21

22
       Obtaining vertex and edge descriptors
23

24
25
    .. automethod:: vertex
    .. automethod:: edge
26

27
    .. container:: sec_title
28

29
       Number of vertices and edges
30

31
32
    .. automethod:: num_vertices
    .. automethod:: num_edges
33

34
    .. container:: sec_title
35

36
       Modifying vertices and edges
37

38
39
    The following functions allow for addition and removal of
    vertices in the graph.
40

41
42
    .. automethod:: add_vertex
    .. automethod:: remove_vertex
43

44
45
    The following functions allow for addition and removal of
    edges in the graph.
46

47
48
    .. automethod:: add_edge
    .. automethod:: remove_edge
49
    .. automethod:: add_edge_list
50

51
52
    .. automethod:: set_fast_edge_removal
    .. automethod:: get_fast_edge_removal
Tiago Peixoto's avatar
Tiago Peixoto committed
53

Tiago Peixoto's avatar
Tiago Peixoto committed
54
    The following functions allow for easy removal of vertices and
55
    edges from the graph.
56

57
58
59
    .. automethod:: clear
    .. automethod:: clear_vertex
    .. automethod:: clear_edges
60
61


62
    .. container:: sec_title
63

64
       Directedness and reversal of edges
65

66
    .. note::
67

68
69
70
       These functions do not actually modify the graph, and are fully
       reversible. They are also very cheap, and have an :math:`O(1)`
       complexity.
71

72
73
    .. automethod:: set_directed
    .. automethod:: is_directed
74

75
76
    .. automethod:: set_reversed
    .. automethod:: is_reversed
77
78


79
    .. container:: sec_title
80

81
       Creation of new property maps
82

83
84
85
86
    .. automethod:: new_property
    .. automethod:: new_vertex_property
    .. automethod:: new_edge_property
    .. automethod:: new_graph_property
87

88
89
    New property maps can be created by copying already existing
    ones.
90

91
    .. automethod:: copy_property
92

93
    .. automethod:: degree_property_map
94

95
    .. container:: sec_title
96

97
       Index property maps
98

99
100
101
102
    .. autoattribute:: vertex_index
    .. autoattribute:: edge_index
    .. autoattribute:: max_edge_index
    .. automethod:: reindex_edges
103

104
    .. container:: sec_title
105

106
       Internal property maps
107

108
109
110
111
    Internal property maps are just like regular property maps, with
    the only exception that they are saved and loaded to/from files
    together with the graph itself. See :ref:`internal property maps <sec_internal_props>`
    for more details.
112

113
    .. note::
114

115
116
117
118
119
120
       All dictionaries below are mutable. However, any dictionary
       returned below is only an one-way proxy to the internally-kept
       properties. If you modify this object, the change will be
       propagated to the internal dictionary, but not
       vice-versa. Keep this in mind if you intend to keep a copy of
       the returned object.
121

122
123
124
125
126
127
128
129
    .. autoattribute:: properties
    .. autoattribute:: vertex_properties
    .. autoattribute:: vp
    .. autoattribute:: edge_properties
    .. autoattribute:: ep
    .. autoattribute:: graph_properties
    .. autoattribute:: gp
    .. automethod:: list_properties
130
131


132
    .. container:: sec_title
133

134
       Filtering of vertices and edges.
135

136
    See :ref:`sec_graph_filtering` for more details.
137

138
    .. note::
139

140
141
142
       These functions do not actually modify the graph, and are fully
       reversible. They are also very cheap, and have an :math:`O(1)`
       complexity.
143

144
    .. automethod:: set_filters
145
146
147
148
    .. automethod:: set_vertex_filter
    .. automethod:: get_vertex_filter
    .. automethod:: set_edge_filter
    .. automethod:: get_edge_filter
149
    .. automethod:: clear_filters
150

151
    .. warning::
152

153
      The purge functions below irreversibly remove the filtered
154
155
156
      vertices or edges from the graph. Note that, contrary to the
      functions above, these are :math:`O(V)` and :math:`O(E)`
      operations, respectively.
157

158
159
    .. automethod:: purge_vertices
    .. automethod:: purge_edges
160

161
    .. container:: sec_title
162

163
       I/O operations
164

165
    See :ref:`sec_graph_io` for more details.
166

167
168
    .. automethod:: load
    .. automethod:: save
169
170
171



Tiago Peixoto's avatar
Tiago Peixoto committed
172
173
   .. autoclass:: GraphView
       :show-inheritance:
Tiago Peixoto's avatar
Tiago Peixoto committed
174
175
176
   .. autoclass:: Vertex
   .. autoclass:: Edge
   .. autoclass:: PropertyMap
Tiago Peixoto's avatar
Tiago Peixoto committed
177
178
   .. autoclass:: PropertyArray
       :show-inheritance:
Tiago Peixoto's avatar
Tiago Peixoto committed
179
       :no-members:
Tiago Peixoto's avatar
Tiago Peixoto committed
180
       :members: prop_map
Tiago Peixoto's avatar
Tiago Peixoto committed
181
182
183
   .. autofunction:: load_graph
   .. autofunction:: group_vector_property
   .. autofunction:: ungroup_vector_property
184
   .. autofunction:: infect_vertex_property
Tiago Peixoto's avatar
Tiago Peixoto committed
185
   .. autofunction:: edge_endpoint_property
Tiago Peixoto's avatar
Tiago Peixoto committed
186
187
188
   .. autofunction:: value_types
   .. autofunction:: show_config

Tiago Peixoto's avatar
Tiago Peixoto committed
189

190
191
192
193
Available subpackages
=====================

.. toctree::
194
   :maxdepth: 1
195

196
   centrality
197
   clustering
198
   collection
199
200
201
   community
   correlations
   draw
202
   flow
Tiago Peixoto's avatar
Tiago Peixoto committed
203
204
205
   generation
   run_action
   search_module
206
   spectral
207
   stats
Tiago Peixoto's avatar
Tiago Peixoto committed
208
   topology
209
   util