Calculate the average distance over all pairs of nodes in a graph

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?

Thanks

-
 The tag graph is intended for questions about graphs of functions, see the tag-wiki and the tag-excerpt. (The tag-excerpt is also shown when you are adding a tag to a question.) There is a separate tag for graph-theory. – Martin Sleziak Mar 20 at 12:58

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.