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

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

> 

with⁡GraphTheory:

> 

with⁡SpecialGraphs:

> 

P≔PetersenGraph⁡

P≔Graph 1: an undirected graph with 10 vertices and 15 edges

(1)
> 

WienerIndex⁡P

30

(2)
> 

C≔CycleGraph⁡19

C≔Graph 2: an undirected graph with 19 vertices and 19 edges

(3)
> 

WienerIndex⁡C

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