Before revision:  For this, the relation between any two nodes is characterized by the length of the shortest path between them , including the special case when there is no such path.
After revision:  For this, the relation between two nodes as the length of the shortest path between them , including the special case when there is no such path.