MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Hash Table for self avoiding random walks


On Mon, May 5, 2008 at 8:47 AM, W_Craig Carter <ccarter at mit.edu> wrote:
> Hello JM,
>
>  I may be misunderstanding your question completely, so I am sorry if
>  this suggestion is off target:
>
>  atrail := Module[{trail}, NestWhile[takeStep, {{{0, 0, 0}}, trail},
>  (Length[availableSteps[#]] > 0) &]]
>
>  Table[atrail,{4}]

This is exactly what I was looking for.  I knew there was a simple
step I was missing.  About 5 minutes after posting, I came up with a
similar solution:

atrail = NestWhile[takeStep, {{{0, 0, 0}}, Unique[]},
(Length[availableSteps[#]] > 0) &]

JM


  • Prev by Date: Re: Dashing[{}]
  • Next by Date: Re: Dashing[{}]
  • Previous by thread: Hash Table for self avoiding random walks
  • Next by thread: Re: Hash Table for self avoiding random walks