shortest path between groups of vertices