Graph |
|
For a graph in the first sense - points and edges - we can define a distance function between vertices x and y of a graph by taking the length of the shortest path from x to y. Such a distance function defines a metric on the vertices, and thus we get a metric space. If we put non-negative weights on the edges and define the function d(x,y) to be the minimal sum of weights taken over all possible paths from x to y we again get a metric space with the elements being the vertices of the graph.