0

I have a project for school where I have to find the shortest route available between two Nodes using Floyd Warshall and Dijkstra Algorithms. All well and good however, further to this I have to provide an amendment to both algorithms so that the optimal route for multiple tasks is computed.

The scenario is based on a public transport pickup/dropoff. For example: you would have a person wanting to go from C to B, and another from D to B, and maybe another from C to F.

The concept is to always start from node A, and compute the optimal route for catering all requests.

Anyone with an idea of the right direction to approach this?

tshepang
  • 12,111
  • 21
  • 91
  • 136
  • 1
    It sounds like the traveling salesman problem http://en.wikipedia.org/wiki/Travelling_salesman_problem – Khaelex Apr 04 '14 at 19:20
  • The problem looks computationally hard. How many nodes do you have? How many pickup/dropoff requests do you have? – Niklas B. Apr 04 '14 at 19:46
  • Hi Niklas, number of nodes is selected at runtime and they are generated. EACH node is connected to every other node with a 2-way "road" however the distance is (original distance + or - 50%) to counter the direct route always being the best choice. Also, any number of requests. But all requests will have a pickup and dropoff location. – Joseph Grech Apr 04 '14 at 20:03
  • Hello Khaelid, it looks a lot close to being the solution. However, from what I picked up the TSP does not consider having to pick up a passenger from >A< before going to where he is to be dropped off. – Joseph Grech Apr 06 '14 at 12:11
  • Just so you know, I have altered Dijkstra to start from a Point (A) and find the closest objective (objectives are stored in a collection as complete/incomplete). Upon reaching this objective, Dijkstra loops again, starting from this new point, to the next closest objective. – Joseph Grech Apr 18 '14 at 12:39

0 Answers0