Graph - Square of a directed graph
Yes, that's exactly what it means. E^2
should contain (u,v)
iff E
contains (u,v)
or there is w
in V
, such that E
contains both (u,w)
and (w,v)
.
In other words, E^2
according to the new definition is the union of E
and E^2
according to the old definition.
Regarding to your last question: it doesn't matter what other paths between u
and v
exist (if they do). So, if there are two paths between u
and v
, one with 2 edges and one with 3 edges, then (u,v)
should be in E^2
(according to both definitions).