Dynamic programming problem - optimal route time - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Dynamic programming problem - optimal route time

samonek4samonek4 Posts: 2Member
Hello,

I have following problem to solve:
Please take a look at the photo:
[link=http://www.voila.pl/401/ctbd9/?1][/link]

Input:
4 - number of stations
3 - number of changes between stations
15 3 2 10 7 - time of traveling betwen bus station
2 25 30 1 10 - time of traveling betwen railway station
7 10 5 1 - time to travel from bust station to railwey station
10 8 5 5 - time to travel form railwey station to bus station

Output:
33


I need to solve the problem using dynamic programming.
I write some code in ansi C that works properly but for input files with number of stations larger than 100 the algorithm becoming very very slov. How to solve the task properly? Any Tips?


Paul


Sign In or Register to comment.