[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [computer-go] Chains and liberties
Mark Boon wrote:
> GNU Go's approxlib() seems similar to my getNLib() function. getNlib()
> actually gets the number of liberties and their locations of a stone (or
> stones) when passed a coordinate where there's a stone, otherwise the
> number of liberties when a stone would be played there. I also pass a
> 'maximum', so it stops as soon as it finds more than the required amount.
> This uses the flood-fill principle discussed earlier. There's also a
> getRlib(), wich takes captures into account, similar to your accuratelib().
Yes, we have `maxlib' limit too.
> Isn't your chainlinks*() already held by 'neighborlist' in your chain
> structure, as Arend Bayer showed? It seems natural, if the chain
> datastructure already contains liberty-lists and stone-lists,
> neighbour-lists seems a very natural extension. It's also data that's very
> fast and easy to generate while you're at it, and can be useful for
> tactical search. I haven't found a clever reversal yet though... so the
> reversal slows down the chain module a bit at the moment and I didn't think
> the speed was great to begin with. So until I find a faster reversal I've
> separated it out by conditional compilation. It depends also how generally
> useful it is. Sometimes it's more efficient to do just-in-time computations
> instead of preparing all in advance.
chainlinks() simply copies data from board structure into the passed
array. I guess the main reason is that we don't want to think whether
we'd like to alter some values returned by chainlinks() this time or
not (i.e. whether we actually need to copy or can just access board
structure as read-only.)
The other two functions, chainlinks2() and chainlinks3() _have_ to copy
neighbors, because they return only neighbors with exactly N liberties
or at most N liberties (while board structure has all neighbors stored.)
So basically, this functions do not compute anything themselves, they
just use data that is incrementally updated in the code that plays
moves.
Paul
_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/