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?
This is the Hackenbush game. I highly recommend this article, which covers Grundy numbers with great clarity and thoroughly discusses hackenbush toward the end.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With