Shortest path with NetworkX's shortest_path() function. Here, this function used Dijkstra's algorithm. This algorithm has a wide variety of applications, for example in network routing protocols.
You need Smopy for this recipe. You can install it with pip install git+https://github.com/rossant/smopy. In order for NetworkX to read Shapefile datasets, you also need GDAL/OGR.