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,454 of 57,431   
   Ben Bacarisse to Darioes   
   Re: Problem C++ gas tank refuel   
   15 Dec 21 12:59:20   
   
   From: ben.usenet@bsb.me.uk   
      
   Darioes  writes:   
      
   > Hi guys,   
   >   
   > 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.   
      
   That last phrase is a little confusing.  The stages that make up the   
   final route have costs, and the route with the minimum cost is to be   
   found.   
      
   Look up depth first search.  I would do this recursively.  Keep a note   
   of the least cost so far and update it every time the search reaches the   
   destination.  When a search exceeds the least cost so far, update it.   
   Lots of details remain for you to work out...   
      
   --   
   Ben.   
      
   --- 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