Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can one calculate the average distance on a graph with 5 nodes?
Is there a simple way to find the average?
Can some one share some examples?


share|cite|improve this question
What's the configuration of the graph? – CodyBugstein Jun 10 '14 at 8:16

Your question is very vague.

If you have a graph on 5 nodes then you can probably calculate the distances between all the pairs of vertices manually and then divide the result by 10

If you happen to have a large graph you can construct the all pair distance matrix (using for example this algorithm) and then sum all the entries of the matrix and divide by the number of all pairs of vertices.

Additionally, if you happen to know the Wiener index of your graph you just divide the index by $n(n-1)$ where $n$ is the number of vertices of your graph.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.