[Welcome to Sensei's Library!]

StartingPoints
ReferenceSection
About


Paths
EyesCollection

Referenced by
EyeDefinitionDisc...
Alive
UnconditionalLife
ComputerGo

 

Benson's Algorithm
Path: EyesCollection   · Prev: Dead   · Next: LifeAndDeath
    Keywords: Life & Death

Benson's algorithm is a rigorous and static (i.e. no search is needed) method for recognizing stones that are uncapturable even if the attacker is allowed to play an infinite number of times in a row (i.e. the defender always passes). This is called unconditional life in Benson's paper [1], a confusing name for something that has no equivalent in traditional Go terminology.

The algorithm is only used by a few specific life-and-death programs and modules.

Perhaps you could describe the algorithm? I have a rough mental idea of how it would work, but I'm not sure... -- Karl Knechtel

jvt: I don't want to paraphrase, so here is a completely rewritten and much simpler version.

"c" stands for Black or White, "-c" for the opposite color. Each point of the board is, of course, either black, white or empty.

A c chain is a non-empty maximum connected set of c points.

A c region is a non-empty maximum connected set of -c and empty points.

A c chain B is unconditionally alive if it is adjacent to at least two c regions R that satisfy:

  1. all empty points in R are adjacent to B,
  2. all chains adjacent to R are unconditionally alive, barring circularity [2].

Note: proof depends on suicide being forbidden by the rules.


Sketch of Proof

(1) prevents the attacker from filling all liberties of an unconditionally alive chain in 2 adjacent regions, because of the no-suicide rule. (2) prevents the attacker from making liberties by capturing another chain adjacent to the same region. And two liberties ensure the chain will never be in atari.


Disclaimer

I don't claim these definitions are the same as in the original article [1] by David Benson. Besides I don't define small c-enclosed regions, healthy regions, nor vital regions.

The requirement about a c region's interior being filled with -c stones has been intentionally removed because of my different definition of regions.


Examples

[Diagram]
1: the white chain is unconditionally alive.

[Diagram]
2: none of the chains is unconditionally alive.


AshleyF One confusion I had when I first read the paper was with the discussion of how simply filling liberties (legally) to determine status would still require search. Benson says, "The obvious algorithm for determining whether a block is safe is to attempt to play stones on the intersections. … While the full search tree may be pruned by some elementary considerations of ‘inside’ and ‘outside’ liberties, in more complex situations the lookahead requirement is still large." Example:

[Diagram]
Unconditionally Alive?

Here, the order of filling liberties is important and even outside vs. inside doesn't help.


[Diagram]
Not Unconditionally Alive (continued 1)

[Diagram]
Not Unconditionally Alive (continued 2)

[Diagram]
Big Eye Not Unconditionally Alive

AshleyF I had thought that he was only talking about big eyes where internal liberties may be adjacent to only other empty points, and in that case you could fill without suicide, but no:


[Diagram]
Unconditionally Alive? No.

He means that the circled point makes it an unsafe eye for the BC group (although that group does have two other eyes and so can’t be captured first). The key is the point marked with a square, which makes it unsafe for BS and this stone has only one other eye, so it’s dead and unravels the whole lot.



AshleyF A clarifying example is useful for understanding why the algorithm depends on suicide being disallowed:

[Diagram]
Not Unconditionally Alive

This is not unconditionally alive because the marked point is not immediately adjacent to BS and so that stone has only one safe eye.


[Diagram]
Unconditionally Alive

This, however, is found to be unconditionally alive by Benson's Algorithm. The W stone and the empty point to the left are together considered one region and the empty point in the region is adjacent to both black groups.

Of course, though, if suicide is legal then White could clear her stone and be back to the previous diagram.



References

[1] Benson, D.B., Life in the Game of Go. Information Sciences, Vol.10, pp.17-29, 1976. Reprinted (with corrections) in

   Computer Games II
   David N. L. Levy (ed.)
   Springer-Verlag, 1987
   ISBN 0-387-96609-9

[ext] Original Paper
[ext] David Dyer's eye shape library


[2] Jan: Doesn't this introduce a circularity? Take this example:

[Diagram]
Should be unconditionally alive, right?

There is only one chain, and three regions - one large one and two of one point each. However when I apply the definition, I get the following:

The large region doesn't count (not all empty points are adjacent to the chain) so we turn our attention to the two small regions. The first requirement checks out OK, but for the other one, we need to know whether our chain is unconditionally alive. But that was the question we were asking in the first place.

I think the second requirement needs to be reworded like this: all other chains adjacent to R are unconditionally alive Did I miss anything here?

jvt: You are right. But there is still some indirect circularity remaining because you can have c1 - R1 - c2 - R2 - c1. (c = chain, R = region).

Benson uses "transitive closure" to convey the meaning of recursivity without circularity. I am not sure how to express this more clearly. Is "barring circularity" clear enough?

Reading again Benson's paper, I see his definition applies to a set of chains, not a single chain, to avoid the circularity problem. My definition needs re-wording:


Revised version

A c chain is unconditionally alive if and only if it is a member of a set S of c chains so that each element B of S is adjacent to at least two c regions R that satisfy:

  1. all empty points in R are adjacent to B,
  2. all c chains adjacent to R are in S.

Remark

All empty points in one of the two c regions R1, R2 don't have to be adjacent to all enclosing c chains. For example:

[Diagram]
All black chains are unconditionnally alive


The actual algorithm

Using these criteria "backwards" as an elimination test may be more effective for an algorithm. A graph of regions and chains of the same color is generated, then it's like pulling a thread. False eyes don't satisfy the criteria and get eliminated. That's the way I did it in my Java programming experiments, anyway.

KarlKnechtel: That's very much what I had in mind with my contribution to the EyeDefinitionDiscussion, actually. :) I think this algorithm works:
  • Define a s string as a maximum connected set of s points, where s is one of {black, white, empty}.
  • Draw the graph where each vertex is in one-to-one correspondence with the strings on the board. The edges should connect identically each pair of vertices which correspond to adjacent strings. Each vertex may also have a 'mark' associated with it; every vertex is initially unmarked.
  • Repeat until no change is made on any iteration:
    • Unmark every empty string.
    • For each empty string: if all the adjacent unmarked strings are of the same colour, mark the empty string. The marked empty strings are temporarily considered "eyes".
    • For each non-empty string: if there is no more than one adjacent, empty, marked string, mark the string. The marked non-empty strings are identified as "not unconditionally alive".

See also the Eyes Collection of pages.



Path: EyesCollection   · Prev: Dead   · Next: LifeAndDeath
This is a copy of the living page "Benson's Algorithm" at Sensei's Library.
(OC) 2003 the Authors, published under the OpenContent License V1.0.