Maybe you can use A* algorithm as a better alternative to dijkstra and use the metric function ( heuristic ) of a* to group or flag your vertices in an appropriate way.
Change due to assessment.
I think there is no appropriate algorithm doin that. Because you need to span the whole graph before knowing which connections are established. With the metric or heuristic approach you can predict some kind of grouping during the evolvement of the graph by defining rules for grouping within your metric function.
Best regards.