Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Anybody here know his way around HashLife?

11 views
Skip to first unread message

FeepingCreature

unread,
Jul 26, 2008, 5:55:46 AM7/26/08
to
I'm trying to understand the recursion algorithm, but I'm a little confused - if the recursion call returns a new node, one level down .. how do I replace the tree with the complete next-gen tree?

I _think_ it's expand tree -> replace with next generation, but I'm not sure.

Any clarification?

--feep

ddd

unread,
Jul 28, 2008, 4:40:58 AM7/28/08
to

A good explanation is at:
http://www.ddj.com/cpp/184406478

FeepingCreature

unread,
Jul 28, 2008, 5:01:09 AM7/28/08
to

I know, but it doesn't seem to answer my question. Still thanks.

--feep

migacr

unread,
Aug 6, 2008, 1:00:23 PM8/6/08
to
>  --feep- Masquer le texte des messages précédents -
>
> - Afficher le texte des messages précédents -

In hashlife, all nodes are kept in memory in the hashtable along with
the result of their next-node computation (this is the memoization
principle). No nodes are really "replaced", the recursion algorithm
allocates a new node only if it has not been computed before.

Hope this helps (but the article in ddj is excellent, I confirm).

Mike.

FeepingCreature

unread,
Aug 7, 2008, 4:55:17 AM8/7/08
to

I know, and I figured that part out by now ^^ But thanks.

Next question .. how does the "compute 2^level steps ahead" thing work? If only the center square is updated, won't the information in the surrounding squares be invalid? ._·

Sorry for my confusion.

migacr

unread,
Aug 7, 2008, 1:38:11 PM8/7/08
to
> Sorry for my confusion.- Masquer le texte des messages précédents -

>
> - Afficher le texte des messages précédents -

Yes the information would be invalid with a simple recursion on the
center square, but the algorithm is a more complex one : the center
square is the result of the computation of 4 l-1 squares that are
themselves resulting of 9 l-2 squares of the same size that overlap
the final center square, as Tomas explains in his article.
One thing important before starting the recursion is you have to
"uproot" the original node so you do not have any live cells outside
of the level-2 center square for the recursion algorithm to work.

FeepingCreature

unread,
Aug 7, 2008, 5:59:42 PM8/7/08
to

Yes, I know that.

The point where I get confused is how to scale this approach to multistep calculations - I know they're theoretically possible, but not how.

migacr

unread,
Aug 8, 2008, 5:43:09 AM8/8/08
to
> The point where I get confused is how to scale this approach to multistep calculations - I know they're theoretically possible, but not how.- Masquer le texte des messages précédents -

>
> - Afficher le texte des messages précédents -

If you mean by multistep to make a computation for a number of
generations that is not a power of 2, you have to call the recursion
for each power of 2 factor of this number, starting from lowest to
highest, and to check that your root node is sufficiently uprooted
before each call.

FeepingCreature

unread,
Aug 8, 2008, 6:56:45 AM8/8/08
to

By Multistep I mean that if you have a level-n tree node, you can use it to calculate 2^n generations forward in one step. I don't see how this is possible, if only the center node is updated during every step. Or are the local nodes uprooted before the calculation as well?

migacr

unread,
Aug 8, 2008, 8:55:48 AM8/8/08
to
> By Multistep I mean that if you have a level-n tree node, you can use it to calculate 2^n generations forward in one step. I don't see how this is possible, if only the center node is updated during every step. Or are the local nodes uprooted before the calculation as well?- Masquer le texte des messages précédents -

>
> - Afficher le texte des messages précédents -

uprooting is only necessary when 2^level = generation, ie at the first
step because the recursion algorithm is made at level-2 instead of
level-1.

0 new messages