Rework dijkstra modules to be able to create graphs from different inputs.