Benson's Algorithm

Path: EyesCollection   · Prev: Dead   · Next: LifeAndDeath
    Keywords: Life & Death, Theory

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.

Typically the groups for which it is possible to prove unconditionally life, don't have a very big eyespace - more accurately, the eyespace must not have empty intersections that are not liberties of the surrounding blocks.

Benson's Algorithm doesn't need to consider things like ko or seki, good moves or bad moves, opponent answers, because the matter is only unconditionally alive or not.

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


Algorithm

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. (See also the revised versions 1 and 2.)

"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]

Unconditionally Alive? No.

The reason why this group isn't unconditionally alive is that the two empty points marked with squares aren't liberies of c1.

It is no problem that the point marked with a circle is no liberty of the big chain, because this chain has two (eyespace-)regions (a2 and b1) that fulfill the condition.


[Diagram]

Big Eye Not Unconditionally Alive

The reason why this group is not unconditionally alive is that [circled point] is an empty intersection but not a liberty of the black chain.


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 WC stone and the empty point to its left are together considered one region, and the empty point in this region is adjacent to both black groups.

Of course, though, if suicide is legal then White could clear the 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


Discussion

[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 1

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

Not all empty points in the a c region have to be adjacent to all enclosing c chains. To speak more exactly, to a c chain B in S, there may be empty points not adjacent to in up to N-2 of a total count of N c regions which are adjacent to B. For example:

[Diagram]

All black chains are unconditionnally alive

The marked black chain is adjacent to four "black" regions, so it can be "not adjacent" to some points of two of it. (got confused?)



jvt: of course it can. The two R (R1, R2) are not just any two. rubilia: I don't understand your comment. I didn't mean "cannot be adjacent" but "can be not adjacent". Hopefully, the quotes make my words clear now.:)


rubilia: I didn't know Benson's article yet, but your revised "unconditional life" criteria is almost exactly what I found in 1993 when I was thinking about the same question. (Probably there are several hundreds of us having "discovered" these laws of unconditional life already :) .) Unfortunately, the definition of "c region" given above is way different from what it has established to be used for in the discussion about unified [ext] rulesets. A region may be one-, two-, or three-coloured (or, if containing no point, not coloured at all), and a one-coloured region often is called a "chain" (or "block" in Bensons's terminology). Calling a region which consists of white and empty points only, a "black region", seems misleading.

Though, I do also think that it is not necessary to define Benson's "small c-enclosed", "helthy" nor "vital" regions.

Therefore, and for some other reason (see below), I'd suggest the following wording:

Revised version 2

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

A set S of c regions is unconditionally alive if and only if each element B of S is adjacent to at least two distinctive non-c regions R that satisfy:

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

To implicate that the (at least) two regions (R1, R2, ...) because of which B is unconditionally alive, must not be adjacent to anything else than c regions, I chose all adjacent regions to have to be in S.

This wouldn't really be necessary if an adjacent pair of one empty and one -c point inside a non-c region was said to be "connected", but the general term "connected" in common go player's language is supposed to be understood in a very different way.

Here is an example why this change could be helpful:

[Diagram]

b not alive

Consider (mistakenly) columns b,c,d, including a5, to be R1 and f,g,h, including i5, to be R2.


Another workaround would be to deal with various kinds of "being connected":

Any pair of adjacent points is

I-connected
if and only if the color values of both points are element of I,

where I is any subset of {black, white, empty}.

 I can be
  1. {}             (-> not connecting function),
  2. {b}            (-> common black string forming connection),
  3. {w}            (-> common white string forming connection),
  4. {e}            (-> common territory forming connection),
  5. {b, w}         (-> "non-empty" connection),
  6. {w, e}         (-> "non-black" connection),
  7. {e, b}         (-> "non-white" connection),or
  8. {b, w, e}      (-> plain "being adjacent" connection).

We probably don't need these definitions for the simplified Benson's algorithm, I just want to point out the difficulty with the "connected" term. rubilia


jvt:
About replacing "all c regions adjacent to R are in S" with "all regions adjacent to R are in S". Since 'region' is not defined it does not make this definition clearer. I would keep the 'c' because the same meaning is needed as in the beginning of the sentence "A set S of c regions is..." .
If you agree about the 'c' I would like to keep only your version and remove the other two versions, it would make this page less confusing.
About your example R1 and R2 are clearly not maximum sets of non-black points. So I fail to see how they are relevant.

rubilia: The three single-color "solidly connecting" functions (items 2. to 4. in the list above, see also here) are well-known and don't have to be explained. Though, IMHO, items 6. and 7., which are the ones we need for the "maximum connected" terminus when continuing to use the "all c-regions" phrase, ought to be specified if we want people to understand what we're talking about. I definitely prefer semantical consistency to ambigeousity. For the same reason, I'd even suggest to replace "unconditionally alive" with "pass-alive".

jvt: Yes, but this definitions are still informal. If "maximum connected" needs to be defined, a flood-fill algorithm could be described. Or, for the mathematically minded, "maximum connected" sets are actually the equivalence classes of the transitive closure of one of the "adjacent or same point in the same set of colors" relations.


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:
[Diagram]

Which strings to mark first?

rubilia: To deal with some special cases, this (nice!) algorithm supposingly needs to be modified somehow.

jvt: I will make a simplified version of my Java code and post it here in pseudo-code.



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) 2004 the Authors, published under the OpenContent License V1.0.
[Welcome to Sensei's Library!]
StartingPoints
ReferenceSection
About