[Computer-go] detecting cross inside an eye

13 views
Skip to first unread message

folkert

unread,
May 10, 2012, 12:11:25 PM5/10/12
to compu...@dvandva.org
Hi,

How do you detect that a cross is inside an eye? (eye? - circle,
connected chain of pieces is what i mean)


Folkert van Heusden

--
Multitail es una herramienta flexible que permite visualizar los "log
file" y seguir la ejecución de comandos. Permite filtrar, añadir
colores, combinar archivos, la visualización de diferencias (diff-
view), etc. http://www.vanheusden.com/multitail/
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com
_______________________________________________
Computer-go mailing list
Compu...@dvandva.org
http://dvandva.org/cgi-bin/mailman/listinfo/computer-go

Álvaro Begué

unread,
May 10, 2012, 12:55:55 PM5/10/12
to compu...@dvandva.org
What do you mean by "cross"?

Rémi Coulom

unread,
May 10, 2012, 12:59:46 PM5/10/12
to compu...@dvandva.org
I suppose he means an empty intersection.

The rule used usually is: all 4 immediate neighbours are of my color and the opponent has no more than two (one on the side) stone(s) in diagonal.

That rule will improve the strength of stop-cur considerably.

Rémi

folkert

unread,
May 10, 2012, 1:32:10 PM5/10/12
to compu...@dvandva.org
What I mean is: say you've got a piece of board with a circle of stones
on it. Now what I've read is that one should not place stones in such a
circle. So the question is: how do you guys detect this?
Also see my question on
http://stackoverflow.com/questions/10531279/check-if-a-point-is-in-a-polygon-which-is-partially-open
which is about this problem I'm trying to describe.

> What do you mean by "cross"?
>
> > How do you detect that a cross is inside an eye? (eye? - circle,
> > connected chain of pieces is what i mean)


Folkert van Heusden

--

Multitail - gibkaja utilita po sledovaniju log-fajlov i vyvoda
kommand. Fil'trovanie, raskrašivanie, slijanie, vizual'noe sravnenie,
i t.d. http://www.vanheusden.com/multitail/

folkert

unread,
May 10, 2012, 1:51:05 PM5/10/12
to compu...@dvandva.org
Yes indeed.

It has been a couple of years since I worked on stop so I've got a fresh
look at it.
Some code is really interesting.

It seems there's already some code in it doing this check.

Not entirely sure if it is correct:
- if there are 4 direct neighbours of my color and the number of
opponent stones in the diagonal <= x
or
- if there are 4 direct neighbours of opponent color and the number of
my stones in diagonal <= x
where:
- if the eye is at the left row or the right row or the uppr row or
bottom row, then x = 0 (so if is on the edge), else x=1 (but i expect
that '1' to be a typo which should've been 2)

What do you think? It is slightly different because of the edge-check,
is that edge bogus?

Thanks
Folkert van Heusden

--
MultiTail er et flexible tool for å kontrolere Logfiles og commandoer.
Med filtrer, farger, sammenføringer, forskeliger ansikter etc.

Álvaro Begué

unread,
May 10, 2012, 1:57:04 PM5/10/12
to compu...@dvandva.org
On Thu, May 10, 2012 at 1:32 PM, folkert <fol...@vanheusden.com> wrote:
> What I mean is: say you've got a piece of board with a circle of stones
> on it. Now what I've read is that one should not place stones in such a
> circle. So the question is: how do you guys detect this?
> Also see my question on
> http://stackoverflow.com/questions/10531279/check-if-a-point-is-in-a-polygon-which-is-partially-open
> which is about this problem I'm trying to describe.

Let me start with a joke. An engineer and a mathematician take part in
a contest where they are asked to surround as much land as possible
with a certain amount of wood. The engineer comes out with a svelte
fence design and manages to surround 2 hectares. Very impressive. The
mathematician then builds a tiny fence around himself and defines his
side of the fence as "out".

Back to go, the diagram on the stackoverflow post suggests that you
are trying to identify the surrounded areas of the board. Keep in mind
that what is "inside" and what is "outside" is somewhat arbitrary, as
illustrated by the joke. For instance, imagine a chain connecting the
North and the South of the board. Which side is in and which one is
out? You can slowly move a configuration where in and out are clear
into the one I just described, so the definition will break down at
some point. Perhaps it's better to simply think about "connected
components", even though typical positions contain one large one that
most people would consider "outside".

So you are trying to compute the connected components of the graph
formed by the non-black (say) points on the board. Several algorithms
to solve this problem are discussed here:
http://en.wikipedia.org/wiki/Connected_component_%28graph_theory%29#Algorithms

But if you are simply trying to stop your random playouts from
plugging their own eyes, listen to Rémi.


Álvaro.

Álvaro Begué

unread,
May 10, 2012, 2:04:12 PM5/10/12
to compu...@dvandva.org
On Thu, May 10, 2012 at 1:51 PM, folkert <fol...@vanheusden.com> wrote:
> Yes indeed.
>
> It has been a couple of years since I worked on stop so I've got a fresh
> look at it.
> Some code is really interesting.
>
> It seems there's already some code in it doing this check.
>
> Not entirely sure if it is correct:
> - if there are 4 direct neighbours of my color and the number of
>  opponent stones in the diagonal <= x
> or
> - if there are 4 direct neighbours of opponent color and the number of
>  my stones in diagonal <= x
> where:
> - if the eye is at the left row or the right row or the uppr row or
>  bottom row, then x = 0 (so if is on the edge), else x=1 (but i expect
> that '1' to be a typo which should've been 2)

You only need to check the first rule (i.e., don't play on points that
look like your own eyes). And it does look like Rémi got the language
slightly wrong. The rule should be: All 4 immediate neighbours are of
my color and the opponent has no more than one (zero on the side)
stone(s) in diagonal.


Álvaro.

Rémi Coulom

unread,
May 10, 2012, 2:38:13 PM5/10/12
to compu...@dvandva.org
On 10 mai 2012, at 20:04, Álvaro Begué wrote:
>
> You only need to check the first rule (i.e., don't play on points that
> look like your own eyes). And it does look like Rémi got the language
> slightly wrong. The rule should be: All 4 immediate neighbours are of
> my color and the opponent has no more than one (zero on the side)
> stone(s) in diagonal.

Yes, of course. Sorry for the confusion.

Rémi

dave....@planet.nl

unread,
May 10, 2012, 4:29:21 PM5/10/12
to compu...@dvandva.org
Or all 4 immediate neighbours are of my color and my opponent occupies less than half of the diagonal neighbours (works in the center and on the sides and corners).
Dave


Van: computer-...@dvandva.org namens Álvaro Begué
Verzonden: do 10-5-2012 20:04
Aan: compu...@dvandva.org
Onderwerp: Re: [Computer-go] detecting cross inside an eye

folkert

unread,
May 13, 2012, 4:57:38 PM5/13/12
to compu...@dvandva.org
Hi all,

Thanks for all the replies.
Did some testing: replaced the old group-detection (which gave a lot of
false positives) by a more conservative one: dramatic elo-rating
(0_9-003). Then I took out all the group (circle) detection code and
currently looks as if this makes quiet a difference: 0_3_002b has an elo
rating of 1244 after 402 games played.
See: http://keetweej.vanheusden.com/stats/stop-cur-elo-cgos.png

I'm now also running amigogtp, fuego and simplego to make the statistics
more interesting. Don: maybe it is interesting to let users add some
metadata to the accounts. I already mentioned an url of the website of
the program but also the process-type/count/ram/speed.

http://www.vanheusden.com/stop/


Folkert van Heusden

--
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com
Reply all
Reply to author
Forward
0 new messages