Algorithms

Moderators: None (Apply to moderate this forum)
Number of threads: 402
Number of posts: 786

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Dynamic programming - optiaml rute time Posted by samonek4 on 17 May 2012 at 9:30 AM
Hello,

I have following problem to solve:
Please take a look at the photo:


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


Thread Tree
samonek4 Dynamic programming - optiaml rute time on 17 May 2012 at 9:30 AM



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.