# MeanGraphDistance

gives the mean distance between all pairs of vertices in the graph g.

MeanGraphDistance[{vw,}]

uses rules vw to specify the graph g.

# Details and Options

• MeanGraphDistance is also known as the average path length.
• is the average length of all shortest paths between vertices of g.

# Examples

open allclose all

## Basic Examples(2)

Find the mean distance between vertices in a graph:

Mean graph distance of the WattsStrogatz model as a function of rewiring probability:

## Scope(7)

MeanGraphDistance works with undirected graphs:

Directed graphs:

Weighted graphs:

Multigraphs:

Mixed graphs:

Use rules to specify the graph:

MeanGraphDistance works with large graphs:

## Options(2)

### Method(2)

By default, edge weights are used to determine graph distance:

Use Method->"UnitWeight" to ignore edge weights:

## Applications(4)

A network of American football games between Division IA colleges during regular season fall 2000. The average number of games linking one team to another is about 2.5:

It takes a few more than five clicks on average to navigate from one symbol to another using the See Also links in the Wolfram Language documentation:

Distribution of the number of co-appearances linking two randomly selected actors in a small-size Kevin Bacon game:

Average number of co-appearances linking two actors:

Distribution of the average number of relations connecting two people in a WattsStrogatzGraphDistribution social network model:

Compute the probability that the average exceeds 3:

## Properties & Relations(5)

MeanGraphDistance gives the off-diagonal mean of GraphDistanceMatrix:

Compute the off-diagonal mean when the diagonal of GraphDistanceMatrix is 0:

The mean graph distance is greater than or equal to 1:

It can be less than 1 for weighted graphs:

The mean graph distance of g is 1 iff g is a complete graph:

Use CompleteGraphQ to test for complete graphs:

The mean graph distance of a disconnected graph is Infinity:

Use ConnectedGraphQ to test for connected graphs:

MeanGraphDistance can be used to find the GraphLinkEfficiency:

Wolfram Research (2012), MeanGraphDistance, Wolfram Language function, https://reference.wolfram.com/language/ref/MeanGraphDistance.html (updated 2015).

#### Text

Wolfram Research (2012), MeanGraphDistance, Wolfram Language function, https://reference.wolfram.com/language/ref/MeanGraphDistance.html (updated 2015).

#### CMS

Wolfram Language. 2012. "MeanGraphDistance." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/MeanGraphDistance.html.

#### APA

Wolfram Language. (2012). MeanGraphDistance. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MeanGraphDistance.html

#### BibTeX

@misc{reference.wolfram_2024_meangraphdistance, author="Wolfram Research", title="{MeanGraphDistance}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/MeanGraphDistance.html}", note=[Accessed: 13-August-2024 ]}

#### BibLaTeX

@online{reference.wolfram_2024_meangraphdistance, organization={Wolfram Research}, title={MeanGraphDistance}, year={2015}, url={https://reference.wolfram.com/language/ref/MeanGraphDistance.html}, note=[Accessed: 13-August-2024 ]}