Find the shortest Path to a Set of Vertexes in a Graph.

The problem is as follows:

Consider an undirected, connected graph G and a set of vertexes V within the same graph. What is the shortest distance from a given vertex w to V. The distance is measured by counting the number of edges within a path.

For example in the following graph

0--1--2--3--5
| | | |
6 7--8--9

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store