Re: Floyd Warshall
- From: "John Thingstad" <john.thingstad@xxxxxxxxx>
- Date: Thu, 30 Aug 2007 16:32:48 +0200
På Thu, 30 Aug 2007 15:45:42 +0200, skrev Geoff Wozniak <geoff.wozniak@xxxxxxxxx>:
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)
Tim Bradshaw wrote some memoize functions you can use.
http://www.tfeb.org/lisp/hax.html#MEMOIZE
.
- References:
- Floyd Warshall
- From: andrea
- Re: Floyd Warshall
- From: Gene
- Re: Floyd Warshall
- From: andrea
- Re: Floyd Warshall
- From: andrea
- Re: Floyd Warshall
- From: Geoff Wozniak
- Floyd Warshall
- Prev by Date: Enforcing Syntax for function/macro
- Next by Date: rotatef mystery
- Previous by thread: Re: Floyd Warshall
- Next by thread: Re: Floyd Warshall
- Index(es):
Relevant Pages
|