Dijsktra with contrains
Hi folks, im implementing a program to find a train route from one city to another. All information about direct train between cities is in the database. Problem is: providing users want to go from one city to another, and they'd like to depart not earlier than departureTime and arrive no later than arriveTime.
I used Dijsktra to find the best route which will take users to their destination at earliest time.
But now, there's one more constrain: users want the best route which take them there as soon as possible IN CONDITION that they don't have to change train maxChanges time. And that is when i got lost. Because the answer i found previously is not neccessarily the route statifies the second requirement.
Eg: User wants to go from A-->C, depart at or after 10.00 and arrive before or at 19.00
Dijsktra without second requirement, i found a best route A-->B-->C which departs at A at 10.30 and arrive at C at 16.00
But if user wants no train changes, the best route would be A-->C directly, departs at A at 12.30 and arrive at C at 17.30
I dont know if using Dijsktra can help solving this problem.
Any ideas, Please !!!!
Cheers

