On Thu, Apr 2, 2009 at 5:14 AM,  <w...@swcp.com> wrote:
> Isaac,
>
> I implemented about 6 way to track liberties,
> a couple years ago, and measured the running
> performance, and by far the best is also the
> simplest: keep an array of liberties for each
> chain, and do a simple linear search.
>
> This may seem slow, but it has a couple real
> advantages. First, it works with the cache
> to maximize locality. Second it is very simple.
>

This is what I do too. I never bothered with bit-arrays but possibly
that's simply because I fail to see how you can merge two chains and
count liberties in O(1).

You can find my implementation in the reference-bots I made. The file
that counts liberties (and does a bit of other house-keeping) is here:

https://plug-and-go.dev.java.net/source/browse/plug-and-go/TesujiRefBot/source/tesuji/games/go/reference/monte_carlo/MCLibertyAdministration.java?rev=267&view=markup

Mark
_______________________________________________
computer-go mailing list
computer-go@computer-go.org
http://www.computer-go.org/mailman/listinfo/computer-go/

Reply via email to