I have created a directed graph from the nodes stored within my Postgres db but the resulting graph doesn't seem to be fully connected and as a result my shortest path algorithm is not able to find a path between start and end nodes.
When creating a graph, using networkx, from the nodes stored in my db (created by OSM2PO), I iterate through them adding edges to targets and their cost.
Am I along the correct lines, with using this graph creation algorithm? I have seen examples of converting OSM to graphs using the XML format and understand how they are iterating through the ways to populate the graph. What I don't understand is when using my implementation, there are multiple nodes of the same type referring to different 'edges' or paths to different target nodes, how is the algorithm just going through the database and connecting source to targets not working.