NetworkX - How to create MultiDiGraph from Shapefile?
问题 I'm just picking up NetworkX and trying to learn how to use it with Shapefiles. Right now I have a .shp with a road network that I want to represent in a Graph with NetworkX, so that I can find the shortest path between 2 GPS points. I tried using this, but the problem is that when I run the write_shp() function I lose edges because DiGraph does not allow more than one edge between the same two nodes. The arrow in the figure below shows an example of an edge I lose by using a DiGraph. So I