gutman_index#
- graph_tool.structure.gutman_index(g, weights=None)[git][source]#
Return the Gutman index of the graph.
- Parameters:
- g
Graph Graph to be used. Edge directions are ignored.
- weights
EdgePropertyMap(optional, default:None) Edge weights (lengths).
- g
- Returns:
- G
float The Gutman index \(\sum_{u<v}k_uk_v d_{uv}\) [gutman-selected-1994], where \(k_u\) is the degree, or \(\infty\) if the graph is not connected.
- G
See also
schultz_indexVariant with sums of degrees
wiener_indexSum of the distances between all pairs
hyper_wiener_indexWiener index that also includes squared distances
Notes
The Gutman index [gutman-selected-1994] is
\[\mathrm{Gut} = \sum_{u<v}k_uk_v\,d(u, v),\]where the sum runs over the unordered pairs of distinct vertices, \(k_u\) is the total degree of \(u\) (the sum of its in- and out-degrees, for directed graphs), and \(d(u, v)\) is the length of a shortest path between \(u\) and \(v\), ignoring the edge directions (the number of its edges, or the sum of their weights). In the degrees, parallel edges are counted with their multiplicity and a self-loop contributes two, as in the handshake lemma; neither affects the distances. If the graph is not connected, \(\mathrm{Gut} = \infty\). The distances are computed as in
hyper_wiener_index().Parallel implementation.
If enabled during compilation, this algorithm will run in parallel using OpenMP. See the parallel algorithms section for information about how to control several aspects of parallelization.
References
[gutman-selected-1994] (1,2)Ivan Gutman, “Selected properties of the Schultz molecular topological index”, Journal of Chemical Information and Computer Sciences 34, 1087-1089 (1994), DOI: 10.1021/ci00021a009 [sci-hub, @tor]
Examples
>>> g = gt.collection.data["karate"] >>> print(gt.gutman_index(g)) 22959.0