In the case of a directed graph the distance <math>d(u,v)</math> between two vertices <math>u</math> and <math>v</math> is defined as the length of a shortest directed path from <math>u</math> to <math>v</math> consisting of arcs, provided at least one such path exists. Notice that, in contrast with the case of undirected graphs, <math>d(u,v)</math> does not necessarily coincide with <math>d(v,u)</math>, and it might be the case that one is defined while the other is not. | In the case of a directed graph the distance <math>d(u,v)</math> between two vertices <math>u</math> and <math>v</math> is defined as the length of a shortest directed path from <math>u</math> to <math>v</math> consisting of arcs, provided at least one such path exists. Notice that, in contrast with the case of undirected graphs, <math>d(u,v)</math> does not necessarily coincide with <math>d(v,u)</math>, and it might be the case that one is defined while the other is not. |