ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ruby-talk
ruby-talk
Re: Cookie Monster!
by Kai Krakow other posts by this author
May 9 2008 4:06AM messages near this date
Re: Cookie Monster! | Re: Cookie Monster!
>  > Seems like a comp sci homework problem to me, as it is a classic example
>  > of where you can use dynamic programming.  Seehttp://en.wikipedia.org/wiki/Dynamic_prog
ramming
> 
>  Actually It's not homework. You don't normally get homework at my age.
>  Just something I thought would be interesting..
> 
>  > I think it's a perfect quiz for Ruby Quiz.
> 
>  Ah ok, shows how wrong I was.. I'll submit something to Ruby Quiz.
>  Thanks.

Shouldn't this easily and optimally solvable with Dijkstra's
algorithm:
http://en.wikipedia.org/wiki/Dijkstra's_algorithm

Dijkstra solves the problem bottom-up, solving smaller problems first
and then solve the next bigger problem. One just has to make sure to
negate the optimizer condition and to walk north and west (because
Dijkstra's algorithm returns the previous nodes of the path, not the
next nodes). This should be in sense of "dynamic programming" as
mentioned before.

Regards,
Kai
Thread:
Lee Jarvis
Quentin Sabah
Kai Krakow
Robert Klemme

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved