WienerIndex - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


GraphTheory

  

WienerIndex

  

find the Wiener index of a graph

 

Calling Sequence

Parameters

Description

Definition

Examples

Compatibility

Calling Sequence

WienerIndex(G)

Parameters

G

-

graph

Description

• 

WienerIndex returns the Wiener index of a graph G.

• 

If G is disconnected, then WienerIndex returns infinity.

Definition

• 

The Wiener index of a graph is the sum of the lengths of the shortest paths between all pairs of vertices in the graph.

Examples

withGraphTheory:

withSpecialGraphs:

PPetersenGraph

PGraph 1: an undirected graph with 10 vertices and 15 edge(s)

(1)

WienerIndexP

30

(2)

CCycleGraph19

CGraph 2: an undirected graph with 19 vertices and 19 edge(s)

(3)

WienerIndexC

38

(4)

Compatibility

• 

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