I have this requirement. Where I have to create one application that will save the following data ( Source City, Destination City, travel time) as one record and I have the option to save this in any DB I want(Relational, NoSQL, graph based).
Now user can query the application by giving the source and destination city and I have to find the shortest path in terms of minimum connection and shortest path in terms of minimum time for the given source and destination.
Can anyone please help how can I implement this logic at DB level, because even If I think of implementing this using Dijkstra's algorithm in java. I will have to fetch all the records from the DB to create the graph every time user makes a new search.
Any help in terms of approach/logic will help. Thanks