Re: Floyd Warshall
- From: Geoff Wozniak <geoff.wozniak@xxxxxxxxx>
- Date: Thu, 30 Aug 2007 06:45:42 -0700
On Aug 30, 4:06 am, andrea <kerny...@xxxxxxxxx> wrote:
Another little thing, I also have a recursive version (the first I
did) which is working fine
BUT, for even a small number of cities (6) it take hours... That's
right because the numeber of function calls is factorial, but I think
there should be some ways to eliminate many calls...
Ideas?
Look into a technique called memoization.
http://en.wikipedia.org/wiki/Memoization
Check out Norvig's book Paradigms of Artificial Intelligence
Programming (PAIP) for a decent example. (section 9.6)
.
- Follow-Ups:
- Re: Floyd Warshall
- From: John Thingstad
- Re: Floyd Warshall
- References:
- Floyd Warshall
- From: andrea
- Re: Floyd Warshall
- From: Gene
- Re: Floyd Warshall
- From: andrea
- Re: Floyd Warshall
- From: andrea
- Floyd Warshall
- Prev by Date: Re: Lisp Interpreter in ActionScript 3
- Next by Date: Enforcing Syntax for function/macro
- Previous by thread: Re: Floyd Warshall
- Next by thread: Re: Floyd Warshall
- Index(es):
Relevant Pages
|