home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.programming      Programming issues that transcend langua      57,431 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 55,471 of 57,431   
   Tim Rentsch to Darioes   
   Re: Problem C++ gas tank refuel   
   21 Dec 21 08:55:46   
   
   From: tr.17687@z991.linuxsc.com   
      
   Darioes  writes:   
      
   > Im programing a new exerciese that i need to do for a college   
   > project, in C++.   
   >   
   > That project consists in implementing an algorithm that just goes   
   > the minimal ways, not like Dijkstra's algorithm but something   
   > similar:  You are have a car, that needs to go from France to Corea   
   > and you need to refil your gas tank . You need to pick the minimal   
   > ways so that the car's fuel tank is as low as possible.   
      
   Assuming that I understand correctly what you are looking for,   
   this problem is a standard graph shortest path problem.  The   
   only difference is adding a new link to a path uses MAX rather   
   than addition.  The "distances" involved are still monotonic,   
   so the conventional algorithm works, just using MAX rather than   
   plus.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca