[Welcome to Sensei's Library!]

StartingPoints
ReferenceSection
About


Paths
EyesCollection

Referenced by
GoPrograms
ToBeMasterEdited
EyeDefinitionDisc...
GeneralEyeDefinition

Homepages
HuOfKGS

 

Instant Eye Tester
Path: EyesCollection   · Prev: EyeShapeEyeSpaceDiscussion   · Next: Alive
  Difficulty: Advanced   Keywords: Shape, Life & Death

There was once a discussion among Go programmers and others in the newsgroup rec.games.go as to whether or not you could tell if an eye was real or not without searching the game tree to see if the group could die. It turns out you don't need to do such a search, assuming that the group has only single-point eyes.

First, a few definitions.


Paths

A path from stone A to stone B exists if there is a direct, solid connection (in the legal, Go sense) between the stones:

[Diagram]
Diag.: A simple path

Here, there is a path between the two marked stones.

In addition, a path can skip over a single space as if it was filled by a stone of that color. So:


[Diagram]
Diag.: A path

and


[Diagram]
Diag.: Another path


Also, note that:

[Diagram]
Diag.: A bendy path

is also a path.

Properties of Paths

Paths have some nice mathematical properties which will simplify things:

  • There is a path from B to A if and only if there is a path from A to B.
  • If there is a path from A to B, and there is a path from B to C, then there is a path from A to C.

Strings

The next level of abstraction is the string.

Let S be a set of stones on the board. S is a string if and only if, for all A,B in S there is a path between A and B.

The following examples should clarify:


[Diagram]
Diag.: An obvious string

[Diagram]
Diag.: Also a string

[Diagram]
Diag.: Not a string


Dieter Verhofstadt: why is this concept introduced? It's never used in the rest of this section.

Matt Noonan: It's been a while since I wrote this, but I think that in the section below, when I say "group" what I meant was "string". Still, it's only to justify the method, and not really needed to operate it.


Eyes (True, False, and Otherwise)

Finally, we can define real eyes and false eyes in a static way.

Let an eye be any point which is surrounded on all four sides by stones of the same color. Let these four stones be called A, B, C and D, and define the set L = {A, B, C, D}

When talking about a real eye, what we mean is that the stones that define it are all connected to the same group. Therefore:

Let E be the eye to be tested, and let L be defined as above. An eye is a real eye if and only if for all x,y in L there exists a path between x and y, provided that the path does not go through E right away (since this would allow jumping across the eye to connect x and y directly).

If E is an eye and E is not a real eye, then E is a false eye.

Because of the properties for paths given above, it follows that rather than testing up to 12 paths per eye, it is sufficient to only test 6: A-B, B-A, A-C, C-A, A-D, and D-A (the restriction on the starting move for the path breaks the commutativity of the paths).


David Peklak: The restriction should rather say that the path must never pass through E, and not only at the first step. Otherwise this would be a real eye:

[Diagram]
Diag.: One real eye ???

Because I can always start the path going to another stone and jump the eye later. So if my assumption is correct, the commutativity of the paths holds again and only three tests are necessary.



Examples:

[Diagram]
Diag.: Two real eyes

[Diagram]
Diag.: Two real eyes

[Diagram]
Diag.: One real eye


This method can even correctly give the status of this four-group beast:

[Diagram]
Diag.: Result of a rare joseki


Some friends and I have played around a little with extending the concept of "eye" to larger eyeshapes, but haven't put enough work in to generalize these techniques, though it looks at least somewhat promising.

Not exactly practical for everyday playing, but maybe interesting to the Go-programmers and bored players out there.. :)

-- Matt Noonan


David Peklak: I think I found a more simple aproach that works without searching and defines unsettled eyes as false eyes: Say the black eye "E" is surrounded by the black stones A, B, C and D has to be checked: Imagine white stones occupying all liberties of A, B, C and D as far as this is possible without putting white stones in atari. If neither A, B, C or D are in atari now, the eye is real, otherwise it is false.


Check out the logical definition in Eye Definition Discussion. -- Dieter


[Diagram]
Diag.: Unsettled Group

FCS: Hmm... seems to me that there is only one real eye here and that the shape is unsettled. Whoever plays at a first will win.

Matt Noonan: It's true that the algorithm counts unsettled eyes as real eyes, but the main idea was to find false eyes without search, so there is a sort of implicit assumption that no more moves will be made. Perhaps it is better suited to automatically finding dead stones at the end of a game?



Bill Spight: What if a path were defined to go only through stones or eyes of the same color?

[Diagram]
Diag.: Half eye

Then the marked point would not be an eye, because there is no path from the marked stone to the other Black stones, except through that point right away.

Also, between false eyes and real eyes are fractional eyes. See "Eyespace Values in Go" by Howard Landman, in Games of No Chance.


[Diagram]
Diag.: Computationally undefined

jsha: The above definition is not computationally useful, because you must determine all other eyes first. For instance, it is impossible to determine the status of this group using the above method. Each marked point is an eye only if the other marked point is an eye.


[Diagram]
Diag.: Not strictly alive until black "a"

What about this: Select a maximal group of chains that are all connected by eyes (real or false). Those eyes will be considered Unsettled Eyes. For each eye, do the eye test above, but a path cannot pass through an empty space unless it is an Unsettled Eye. If an eye fails the test, it is a False Eye. If no eye fails the test, the remaining eyes are all Real Eyes. If any eye fails the test, do the eye test on each remaining Unsettled Eye again. Repeat until you no longer find any more False Eyes. This algorithm also has some problems in that it can't pick out groups which have a string of false eyes but are alive (see diagram), but under the strict definition of "cannot be killed under an arbitrarily long sequence of consecutive moves by opponent," such groups aren't really alive anyhow.



Anyway, more to the point:

[Diagram]
Diag.: Unsettled Eye

There is the question about what to call this shape (a ponnuki?). (Charles: You can call it a diamond - but ponnuki is definitely misleading.) I'd call it an eye in the absence of white stones. Perhaps the procedure can be expanded to find real, false and undefined eyes? This might not be possible without search, though.



See also the pages in the Eyes Collection.



Path: EyesCollection   · Prev: EyeShapeEyeSpaceDiscussion   · Next: Alive
This is a copy of the living page "Instant Eye Tester" at Sensei's Library.
(C) the Authors, published under the OpenContent License V1.0.