graph_tool.rst 5.09 KB
Newer Older
1
2
.. automodule:: graph_tool

Tiago Peixoto's avatar
Tiago Peixoto committed
3
   .. autoclass:: Graph
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106

       .. automethod:: copy

       .. container:: sec_title

           Iterating over vertices and edges

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

       .. automethod:: vertices
       .. automethod:: edges

       .. container:: sec_title

           Obtaining vertex and edge descriptors

       .. automethod:: vertex
       .. automethod:: edge

       .. container:: sec_title

           Number of vertices and edges

       .. automethod:: num_vertices
       .. automethod:: num_edges

       .. container:: sec_title

           Modifying vertices and edges

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

       .. automethod:: add_vertex
       .. automethod:: remove_vertex
       .. automethod:: remove_vertex_if

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

       .. automethod:: add_edge
       .. automethod:: remove_edge
       .. automethod:: remove_edge_if

       The following functions allow for easy removal of vertices of
       edges from the graph.

       .. automethod:: clear
       .. automethod:: clear_vertex
       .. automethod:: clear_edges


       .. container:: sec_title

           Directedness and reversal of edges

       .. note::

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

       .. automethod:: set_directed
       .. automethod:: is_directed

       .. automethod:: set_reversed
       .. automethod:: is_reversed


       .. container:: sec_title

           Creation of new property maps

       .. automethod:: new_property
       .. automethod:: new_vertex_property
       .. automethod:: new_edge_property
       .. automethod:: new_graph_property

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

       .. automethod:: copy_property

       .. automethod:: degree_property_map

       .. container:: sec_title

           Index property maps

       .. autoattribute:: vertex_index
       .. autoattribute:: edge_index
       .. autoattribute:: max_edge_index
       .. automethod:: reindex_edges

       .. container:: sec_title

           Internal property maps

       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.

107
108
109
110
111
112
113
114
       .. note::

           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.
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171

       .. autoattribute:: properties
       .. autoattribute:: vertex_properties
       .. autoattribute:: edge_properties
       .. autoattribute:: graph_properties
       .. automethod:: list_properties


       .. container:: sec_title

           Filtering of vertices and edges.

       See :ref:`sec_graph_filtering` for more details.

       .. note::

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

       .. automethod:: set_vertex_filter
       .. automethod:: get_vertex_filter
       .. automethod:: set_edge_filter
       .. automethod:: get_edge_filter

       .. warning::

          The purge functions below irreversibly remove the filtered
          vertices or edges from the graph, and return it to an
          unfiltered state. Note that, contrary to the functions above,
          these are :math:`O(V)` and :math:`O(E)` operations,
          respectively.

       .. automethod:: purge_vertices
       .. automethod:: purge_edges

       .. container:: sec_title

           Stashing and popping the filter state

       .. automethod:: stash_filter
       .. automethod:: pop_filter

       .. automethod:: get_filter_state
       .. automethod:: set_filter_state

       .. container:: sec_title

           I/O operations

       See :ref:`sec_graph_io` for more details.

       .. automethod:: load
       .. automethod:: save



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

Tiago Peixoto's avatar
Tiago Peixoto committed
190

191
192
193
194
Available subpackages
=====================

.. toctree::
195
   :maxdepth: 1
196

197
   centrality
198
   clustering
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