Search the web
Sign In
New User? Sign Up
abalone_prog · Abalone
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Incremental compactness   Message List  
Reply | Forward Message #9 of 96 |
Re: Incremental compactness


> --- In abalone_prog@yahoogroups.com, "Colin Springer" <colin@m...>
> wrote:
> I don't get the initial premise of your argument . "for 1D it is
> easy to update the mass center (agreed), and also the compactness"
> incrementally.

A friend of mine asked the same question. I wrote a few LaTeX lines to
explain the method. I hope they are more clear.



\section{Math}

Let $I$ denote all possible locations. Let $B \subset I$ denote the
locations occupied by friendly pieces. Define $x(i)$ as the x-coordinate
of location $i$. The number of friendly pieces on the board is defined
$n = |B|$.

\subsection{Initial}

Center of mass $c$ and Manhattan distance $m$ is computed.
$$
c = \sum_{i \in B} { x(i) \over n }
$$

$$
m(c) = \sum_{i \in B} | x(i) - c |
$$

Note that $m(c)$ is expressed as a function of $c$. It is desireable to
be able to have a different target point than the center of mass. Werner
found that the average of the black center of mass, the white center
of mass,
and the center of the board worked better. When the computer was
winning, it could gradually decrease the influcence from the center of
the board.

\subsection{Incremental}

The ideas behind incremental computation is:

\begin{itemize}

\item Center of mass is easy to compute incrementally.

\item If $c$ is any variable, the Manhanntan distance $m(c)$ is a
piecewise
linear function, whith breaks every time $c$ corresponds to a location
where
pieces are situated. This will always be integer locations.

\item $m(c)$ can be expressed as $m(\floor{ c }) + \delta m(c)$ where
$\delta m(c)$ is easy to compute incrementally.

\end{itemize}


If moving a piece from $f$ to $t$ the new values $c_2, m_2$ can be
computed from the old $c_1, m_1$.

It is straight forward to compute the new center of mass $c_2$:

$$
c_2 = c_1 + { x(t) - x(f) \over n }
$$

To compute the Manhattan distance, we use the helper variables $s$ and
$w$. The Manhattan distance for point $\floor{c}$ is denoted $s$ and the
slope of $m(c)$ is denoted $w$. Both variables are static most of the
time.

$$
h(x) = | \{ i \in B | x(i) = x \} |
$$
$$
s = m(\floor{c})
\qquad
w = \sum_{x \leq \floor{c} } h(x)
- \sum_{x > \floor{c} } h(x)
$$
$$
m(c) = s + w ( c - \floor{c} )
$$

If $\floor{c_1} \neq \floor{c_2}$ then we must update $s$ and $w$ before
computing $m(c)$. Note that $s_2$ is dependent on $w_2$ if $c_2 <
\floor{c_1}$.

$$
\begin{array}{lll}
s_2 = s_1 + w_1
& w_2 = w_1 - 2 h(\floor{c_1})
& \textrm{if } \floor{c_2} = \floor{c_1} + 1 \\
s_2 = s_1 - w_2
& w_2 = w_1 + 2 h(\floor{c_1})
& \textrm{if } \floor{c_2} = \floor{c_1} - 1 \\
\end{array}
$$







Sat Feb 5, 2005 12:56 pm

peer_sommerlund
Offline Offline
Send Email Send Email

Forward
Message #9 of 96 |
Expand Messages Author Sort by Date

In my opinion, the single most important part of AbaPro is its measure of compactness. This can be computed for the marbles of each player as the average...
peso@...
peer_sommerlund
Offline Send Email
Dec 17, 2003
6:24 am

No doubt I'm being thick, but I don't get the initial premise of your argument . "for 1D it is easy to update the mass center (agreed), and also the...
Colin Springer
ColinSpringer
Offline Send Email
Dec 17, 2003
3:25 pm

... wrote: I don't get the initial premise of your argument . "for 1D it is easy to update the mass center (agreed), and also the compactness" incrementally. ...
peso@...
peer_sommerlund
Offline Send Email
Dec 17, 2003
5:24 pm

... A friend of mine asked the same question. I wrote a few LaTeX lines to explain the method. I hope they are more clear. \section{Math} Let $I$ denote all...
peer_sommerlund
Offline Send Email
Feb 5, 2005
12:58 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help