GraphTheory
WienerIndex
find the Wiener index of a graph
Calling Sequence
Parameters
Description
Definition
Examples
Compatibility
WienerIndex(G)
G
-
graph
WienerIndex returns the Wiener index of a graph G.
If G is disconnected, then WienerIndex returns infinity.
The Wiener index of a graph is the sum of the lengths of the shortest paths between all pairs of vertices in the graph.
with⁡GraphTheory:
with⁡SpecialGraphs:
P≔PetersenGraph⁡
P≔Graph 1: an undirected graph with 10 vertices and 15 edge(s)
WienerIndex⁡P
30
C≔CycleGraph⁡19
C≔Graph 2: an undirected graph with 19 vertices and 19 edge(s)
WienerIndex⁡C
38
The GraphTheory[WienerIndex] command was introduced in Maple 2024.
For more information on Maple 2024 changes, see Updates in Maple 2024.
See Also
AllPairsDistance
Diameter
DijkstrasAlgorithm
Distance
Eccentricity
Download Help Document