Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Game on the tree, cutting branch

We have a forest of rooted trees. Two players makes alternating moves according to the following rule: one move is to cut vertex and all its children. Player which makes last move (no vertices remain) wins.

How can we compute Grundy function for the positions in the game?

Suppose we have a trees and we need to say whether current position is winning or losing?

like image 256
Anton Postnikov Avatar asked Mar 05 '11 08:03

Anton Postnikov


1 Answers

This is the Hackenbush game. I highly recommend this article, which covers Grundy numbers with great clarity and thoroughly discusses hackenbush toward the end.

like image 124
Daniel Lubarov Avatar answered Nov 09 '22 04:11

Daniel Lubarov