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

5
6
7
8
   .. container:: sec_title

      Basic classes

Tiago Peixoto's avatar
Tiago Peixoto committed
9
   .. autoclass:: Graph
10
11
    :no-members:
    :no-undoc-members:
12

13
    .. automethod:: copy
14

15
    .. container:: sec_title
16

17
       Iterating over vertices and edges
18

19
    See :ref:`sec_iteration` for more documentation and examples.
20

21
22
    Iterator-based interface:

23
24
    .. automethod:: vertices
    .. automethod:: edges
25

26
27
28
29
30
31
32
33
34
35
36
    Array-based interface:

    .. automethod:: get_vertices
    .. automethod:: get_edges
    .. automethod:: get_out_edges
    .. automethod:: get_in_edges
    .. automethod:: get_out_neighbours
    .. automethod:: get_in_neighbours
    .. automethod:: get_out_degrees
    .. automethod:: get_in_degrees

37
    .. container:: sec_title
38

39
       Obtaining vertex and edge descriptors
40

41
42
    .. automethod:: vertex
    .. automethod:: edge
43

44
    .. container:: sec_title
45

46
       Number of vertices and edges
47

48
49
    .. automethod:: num_vertices
    .. automethod:: num_edges
50

51
    .. container:: sec_title
52

53
       Modifying vertices and edges
54

55
56
    The following functions allow for addition and removal of
    vertices in the graph.
57

58
59
    .. automethod:: add_vertex
    .. automethod:: remove_vertex
60

61
62
    The following functions allow for addition and removal of
    edges in the graph.
63

64
65
    .. automethod:: add_edge
    .. automethod:: remove_edge
66
    .. automethod:: add_edge_list
67

68
69
    .. automethod:: set_fast_edge_removal
    .. automethod:: get_fast_edge_removal
Tiago Peixoto's avatar
Tiago Peixoto committed
70

Tiago Peixoto's avatar
Tiago Peixoto committed
71
    The following functions allow for easy removal of vertices and
72
    edges from the graph.
73

74
75
76
    .. automethod:: clear
    .. automethod:: clear_vertex
    .. automethod:: clear_edges
77

78
79
80
81
82
    After the removal of many edges and/or vertices, the underlying
    containers may have a capacity that significantly exceeds the size
    of the graph. The function below corrects this.
    
    .. automethod:: shrink_to_fit
83

84
    .. container:: sec_title
85

86
       Directedness and reversal of edges
87

88
    .. note::
89

90
       These functions do not actually modify the graph, and are fully
91
       reversible. They are also very cheap, with an :math:`O(1)`
92
       complexity.
93

94
95
    .. automethod:: set_directed
    .. automethod:: is_directed
96

97
98
    .. automethod:: set_reversed
    .. automethod:: is_reversed
99
100


101
    .. container:: sec_title
102

103
       Creation of new property maps
104

105
106
    .. automethod:: new_property
    .. automethod:: new_vertex_property
107
    .. automethod:: new_vp
108
    .. automethod:: new_edge_property
109
    .. automethod:: new_ep
110
    .. automethod:: new_graph_property
111
    .. automethod:: new_gp
112

113
114
    New property maps can be created by copying already existing
    ones.
115

116
    .. automethod:: copy_property
117

118
    .. automethod:: degree_property_map
119

120
    .. container:: sec_title
121

122
       Index property maps
123

124
125
    .. autoattribute:: vertex_index
    .. autoattribute:: edge_index
126
    .. autoattribute:: edge_index_range
127
    .. automethod:: reindex_edges
128

129
    .. container:: sec_title
130

131
       Internal property maps
132

133
134
135
136
    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.
137

138
    .. note::
139

140
141
142
143
144
145
       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.
146

147
148
149
150
151
152
153
154
    .. autoattribute:: properties
    .. autoattribute:: vertex_properties
    .. autoattribute:: vp
    .. autoattribute:: edge_properties
    .. autoattribute:: ep
    .. autoattribute:: graph_properties
    .. autoattribute:: gp
    .. automethod:: list_properties
155
156


157
    .. container:: sec_title
158

159
       Filtering of vertices and edges.
160

161
    See :ref:`sec_graph_filtering` for more details.
162

163
    .. note::
164

165
166
167
       These functions do not actually modify the graph, and are fully
       reversible. They are also very cheap, and have an :math:`O(1)`
       complexity.
168

169
    .. automethod:: set_filters
170
171
172
173
    .. automethod:: set_vertex_filter
    .. automethod:: get_vertex_filter
    .. automethod:: set_edge_filter
    .. automethod:: get_edge_filter
174
    .. automethod:: clear_filters
175

176
    .. warning::
177

178
      The purge functions below irreversibly remove the filtered
179
180
181
      vertices or edges from the graph. Note that, contrary to the
      functions above, these are :math:`O(V)` and :math:`O(E)`
      operations, respectively.
182

183
184
    .. automethod:: purge_vertices
    .. automethod:: purge_edges
185

186
    .. container:: sec_title
187

188
       I/O operations
189

190
    See :ref:`sec_graph_io` for more details.
191

192
193
    .. automethod:: load
    .. automethod:: save
194
195


Tiago Peixoto's avatar
Tiago Peixoto committed
196
197
   .. autoclass:: GraphView
       :show-inheritance:
Tiago Peixoto's avatar
Tiago Peixoto committed
198
199
200
   .. autoclass:: Vertex
   .. autoclass:: Edge
   .. autoclass:: PropertyMap
Tiago Peixoto's avatar
Tiago Peixoto committed
201
202
   .. autoclass:: PropertyArray
       :show-inheritance:
Tiago Peixoto's avatar
Tiago Peixoto committed
203
       :no-members:
Tiago Peixoto's avatar
Tiago Peixoto committed
204
       :members: prop_map
205
206
207
208
209

   .. container:: sec_title

      I/O functions
                 
Tiago Peixoto's avatar
Tiago Peixoto committed
210
   .. autofunction:: load_graph
211
   .. autofunction:: load_graph_from_csv
212
213
214
215
216

   .. container:: sec_title

      Property map operations

Tiago Peixoto's avatar
Tiago Peixoto committed
217
218
   .. autofunction:: group_vector_property
   .. autofunction:: ungroup_vector_property
Tiago Peixoto's avatar
Tiago Peixoto committed
219
   .. autofunction:: map_property_values
220
   .. autofunction:: infect_vertex_property
Tiago Peixoto's avatar
Tiago Peixoto committed
221
   .. autofunction:: edge_endpoint_property
Tiago Peixoto's avatar
Tiago Peixoto committed
222
223
   .. autofunction:: incident_edges_op
   .. autofunction:: perfect_prop_hash
Tiago Peixoto's avatar
Tiago Peixoto committed
224
225
   .. autofunction:: value_types

226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
   .. container:: sec_title

      OpenMP control

   .. autofunction:: openmp_enabled
   .. autofunction:: openmp_get_num_threads
   .. autofunction:: openmp_set_num_threads
   .. autofunction:: openmp_get_schedule
   .. autofunction:: openmp_set_schedule


   .. container:: sec_title

      Misc

   .. autofunction:: show_config
Tiago Peixoto's avatar
Tiago Peixoto committed
242

243
244
245
246
Available subpackages
=====================

.. toctree::
247
   :maxdepth: 1
248

249
   centrality
250
   clustering
251
   collection
252
253
   correlations
   draw
254
   flow
Tiago Peixoto's avatar
Tiago Peixoto committed
255
   generation
256
   inference
Tiago Peixoto's avatar
Tiago Peixoto committed
257
   search_module
258
   spectral
259
   stats
Tiago Peixoto's avatar
Tiago Peixoto committed
260
   topology
261
   util