<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A multidimensional °ocking algorithm for clustering spatial data</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Antonio Augimeri, Gianluigi Folino, Agostino Forestiero and Giandomenico Spezzano Institute for High Performance Computing and Networking</institution>
          ,
          <addr-line>ICAR-CNR</addr-line>
        </aff>
      </contrib-group>
      <fpage>16</fpage>
      <lpage>20</lpage>
      <abstract>
        <p>|In this paper, we describe the e±cient implementation of M-Sparrow, an adaptive °ocking algorithm based on the biology-inspired paradigm of a °ock of birds. We extended the classical °ock model of Reynolds with two new characteristics: the movement in a multi-dimensional space and di®erent kinds of birds. The birds, in this context, are used to discovery point having some desired characteristics in a multidimensional space. A critical point of the algorithm is the e±cient search of the k-neighbors in a multidimensional space. This search was e±ciently implemented using the ANN libraries.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Ants'colonies, °ocks of birds, termites, swarms of bees</title>
      <p>
        etc. are agent-based insect models that exhibit a collective
intelligent behavior (swarm intelligence) [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] that may be
used to de¯ne new distributed clustering algorithms.
In these models, the emergent collective behavior is the
outcome of a process of self-organization, in which insects
are engaged through their repeated actions and
interaction with their evolving environment. Intelligent behavior
frequently arises through indirect communication between
the agents using the principle of stigmergy [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. This
mechanism is a powerful principle of cooperation in insect
societies. According to this principle an agent deposits
something in the environment that makes no direct
contribution to the task being undertaken but it is used to
in°uence the subsequent behavior that is task related. Swarm
intelligence (SI) models have many features in common
with Evolutionary Algorithms (EA). Like EA, SI models
are population-based. The system is initialized with a
population of individuals (i.e., potential solutions). These
individuals are then manipulated over many iteration steps
by mimicking the social behavior of insects or animals, in
an e®ort to ¯nd the optima in the problem space. Unlike
EAs, SI models do not explicitly use evolutionary
operators such as crossover and mutation. A potential solution
simply '°ies' through the search space by modifying itself
according to its past experience and its relationship with
other individuals in the population and the environment.
      </p>
      <p>These algorithms show a high level of robustness to
change by allowing the solution to dynamically adapt
itself to global changes by letting the agents self-adapt to
the associated local changes.</p>
      <p>
        In this paper, we present a prototype using a new
algorithm based on the concepts of a °ock of birds that move
together in a complex manner with simple local rules, to
explore multidimensional spaces for searching interesting
objects. The algorithm is an extension of the classical °ock
model of Reynolds with two new characteristics: the
movement in a multi-dimensional space and di®erent kinds of
birds. The birds, in this context, are used to discovery
point having some desired characteristics in a
multidimensional space. The implementation is based on SWARM [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ],
a software package for multi-agent simulation of complex
systems, developed at the Santa Fe Institute.
      </p>
      <p>From an e±ciency point of view the most critical point of
the algorithm is the e±cient search of the k-neighbors (i.e.
the cardinality of the neighborhood) in a multidimensional
space. This search was e±ciently implemented using the
ANN (Approximate Nearest Neighbor) libraries.</p>
      <p>The remainder of this paper is organized as follows.
Section 2 describes the adaptive °ocking algorithm, section 3
shows how the approach was applied to multidimensional
spaces. Section 4 shows some interesting experimental
results about the e±ciency of the algorithm and its e±cacy in
¯nding interesting patterns. Finally section 5 draws some
conclusions.</p>
      <sec id="sec-1-1">
        <title>II. The adaptive flocking algorithm</title>
        <p>
          The classical °ocking model, introduced by Reynolds [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ],
moves in a two dimensional space and all the birds have
the same characteristics. In the next subsections, we
describe the two extensions introduced in M-Sparrow, the
use of birds having di®erent characteristics (represented by
di®erent colors) and the movement in a multidimensional
space.
        </p>
        <sec id="sec-1-1-1">
          <title>A. Reynolds' original °ock model</title>
        </sec>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>The °ocking algorithm was originally proposed by</title>
      <p>Reynolds as a method for mimicking the °ocking
behavior of birds on a computer both for animation and as a
way to study emergent behavior. Flocking is an example
of emergent collective behavior: there is no leader, i.e., no
global control. Flocking behavior emerges from the local
interactions. Each agent has direct access to the
geometric description of the whole scene, but reacts only to °ock
mates within a certain small radius. The basic °ocking
model consists of three simple steering behaviors:
separation, cohesion and alignment.</p>
      <p>Separation gives an agent the ability to maintain a
certain distance from others nearby. This prevents agents
from crowding too closely together, allowing them to scan
a wider area. Cohesion gives an agent the ability to cohere
(approach and form a group) with other nearby agents.</p>
      <p>Steering for cohesion can be computed by ¯nding all agents
in the local neighborhood and computing the average
position of the nearby agents. The steering force is then
applied in the direction of that average position. Alignment
gives an agent the ability to align with other nearby
characters. Steering for alignment can be computed by ¯nding
all agents in the local neighborhood and averaging together
the 'heading' vectors of the nearby agents.</p>
      <p>B. An adaptive colored °ocking algorithm
adaptively adjusted as the agents change their color
moving to explore data until they reach the goal.</p>
      <p>
        Green and yellow agents compute their movement
observing the positions of all other agents that are at most
at some ¯xed distance (dist max ) from them and applying
the rules of Reynolds' [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] with the following modi¯cations:
² Alignment and cohesion do not consider yellow agents,
      </p>
      <p>since they move in a not very attractive zone.
² Cohesion is the resultant of the heading towards the
average position of the green °ockmates (centroid), of
the attraction towards red agents, and of the repulsion
by white agents.
² A separation distance is maintained from all the</p>
      <p>agents, whatever their color is.</p>
      <p>Agents will move towards the computed destination with a
speed depending from their color: green agents will move
more slowly than yellow agents since they will explore
denser zones of clusters. An agent will speed up to leave
an empty or uninteresting region whereas it will slow down
to investigate an interesting region more carefully. The
variable speed introduces an adaptive behavior in the
algorithm. In fact, agents adapt their movement and change
their behavior (speed) on the basis of their previous
experience represented from the red and white agents.</p>
      <p>M-SPARROW extends the Reynolds' °ocking algorithm,
described in the previous subsection, considering four
different kinds of agents, classi¯ed on the basis of some
properties of data in their neighborhood. These di®erent kinds
are characterized by a di®erent color: red, revealing
interesting patterns in the data, green, a medium one, yellow, a
low one, and white, indicating a total absence of patterns.</p>
      <p>In practise, the °ock follows an exploring behavior in which
individual members (agents) to ¯rst explore the
environment searching for goals whose positions are not known a
priori, and then, after the goals are located, all the °ock
members should move towards these goals. Agents search for i=1 : : : MaxIterations
the goals in parallel and signal the presence or the lack of foreach agent (yellow, green)
signi¯cant patterns into the data to other °ock members, age=age+1;
by changing color. The main idea behind our approach is if (age &gt; Max Life)
to take advantage of the colored agent in order to explore generate new agent();die();
more accurately the most interesting regions (signaled by endif
the red agents) and avoid the ones without clusters (sig- if (not visited (current point))
naled by the white agents). Red and white agents stop property = compute property(current point);
moving in order to signal this type of regions to the oth- mycolor= color agent(property);
ers, while green and yellow ones °y to ¯nd more dense endif
clusters. Indeed, each °ying agent computes its heading by end foreach
taking the weighted average of alignment, separation and
cohesion (as illustrated in ¯gure 1). The entire °ock then
moves towards the agents (attractors) that have discovered
interesting regions to help them, avoiding the
uninteresting areas that are instead marked as obstacles. The color
is assigned to the agents by a function associated with the
data analyzed. In practice, the agent computes the
property of the explored point and then it chooses the color
(and the speed) in accordance to the simple rules showed
in table I. end for</p>
      <p>So red, reveals a high density of interesting patterns in
the data, green, a medium one, yellow, a low one, and Fig. 2. The pseudo-code of M-SPARROW.
white, indicates a total absence of patterns. The color is
used as a communication mechanism among °ock members During simulations a cage e®ect, was observed; in fact,
to indicate them the roadmap to follow. The roadmap is some agents could remain trapped inside regions
surforeach agent (yellow, green)</p>
      <p>dir= compute dir();
end foreach
foreach agent (all)
switch (mycolor)f
case yellow, green: move(dir, speed(mycolor)); break;
case white: stop(); generate new agent(); break;
case red: stop(); generate new close agent(); break; g
end foreach
rounded by red or white agents and would have no way
to go out, wasting useful resources for the exploration. So,
a limit on their life was imposed to avoid this e®ect; hence,
when their age exceeded a determined value (maxLife) they
were killed and were regenerated in a new randomly chosen
position of the space.</p>
      <sec id="sec-2-1">
        <title>C. Exploring multidimensional spaces</title>
        <p>
          We wanted use our adaptive °ocking algorithm in
order to explore multidimensional space for searching point
having desired properties. A continuous data point can be
represented in a multidimensional Euclidean space, simply
normalizing its attributes. Our algorithm can search for
any kind of properties. In particular, we describe a useful
property for the task of clustering. Given a radius (Eps)
and a minimum number (MinPts) of points. A core point
is a point with at least MinPts number of points in an
Epsneighborhood of the itself. Searching points having these
characteristic could be useful for di®erent task (i.e.
dbscan [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] use these points to perform the task of clustering
databases). In the experimental section, we will show the
evaluation of our algorithm in e®ectively cope with this
task.
        </p>
        <p>In the following, we give a more formal description of the
extension of the °ocking algorithm to the multidimensional
space. Consider a multidimensional space with dimension
d. Each bird k can be represented as a point in this space,
having coordinates xk1; xk2; : : : ; xkd and having direction
µk1; µk2; : : : ; µkd, where µki represent the angle between the
new direction of the bird k (computed using the rules of
the previous subsection) and the axis i. Each bird moves
following the the rules of the previous subsection having
speed vk. Then, for each iteration t, the new position of
the bird k can be computed as:</p>
        <p>
          ANN (Approximate Nearest Neighbor) [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ] is a library
written in C++, which supports data structures and
algorithms for both exact and approximate nearest neighbor
searching in high dimensional spaces. As showed in ¯gure
4, we integrated ANN libraries using Java Native
Interface with M-Sparrow in order to e±ciently compute the
neighbors necessary to our algorithm.
xki(t + 1) = xki(t) + vk £ cki
        </p>
        <p>(1)
these formulas can be computed as a generalization of
the three-dimensional case illustrated in ¯gure 3.</p>
        <p>From a computational point of view, a critical point of
our algorithm is the e±cient search of the k-neighbors
in a multidimensional space. Computing exact nearest
neighbors can be very expensive when dimension increases.</p>
        <p>
          In two previous papers, we demonstrated the goodness
where cki represents the projection along the i axis of our algorithm in discovering clusters with di®erent sizes,
of the direction of the boid k. Note that each compo- shapes in noise data [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] and also with di®erent densities [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]
nents is obtained summing the respective three compo- in a two dimensional space.
nents of alignment, separation and cohesion (i.e. cki = Now, we want to show how the algorithm works in a
c alignmentki + c separationki + c cohesionki). In a mul- multidimensional space. We have built two dataset, each
tidimensional space, we can compute the components as: one constituted by two gaussian distributions with di®erent
densities of 1500 points. The ¯rst was three dimensional
d¡1 and the latter four dimensional. We run our algorithm
usck1 = Y cos(µkj ) ing 200 birds for 600 iterations with k = 50 and radius =
        </p>
        <p>j=1 20. It succeeds in separating almost perfectly the two
gausd¡1 (2) sian distributions in both the cases. The three dimensional
cki = sin(µki¡1) Y cos(µkj ) i = 2 : : : d case is illustrated in ¯gure 5.</p>
        <p>j=i Furthermore, we want to verify the e±ciency of the ANN
based implementation and then we run our algorithm
comparing execution times of the latter ANN-based version
with the previous that used brute force computation for
searching the k-neighbors. The results of this comparison
for a three dimensional case are reported in ¯gures 6 a and
b. Experiments show that the ANN libraries outperforms
the brute force approach in all the cases and the
di®er</p>
        <p>III. Experimental results
ence is really considerable when the number of neighbors
to search is greater than 50. If we consider datasets with
dimension larger than 3, ANN outperforms the brute force
approach by at least two order of magnitude, also for small
values of k.</p>
        <sec id="sec-2-1-1">
          <title>IV. Conclusions</title>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>We have presented an e±cient implementation of an</title>
      <p>adaptive °ocking algorithm that e±ciently search
multidimensional spaces. The implementation is based on the
ANN libraries performing an e±cient search of the k
neighbors. Experiments showed that the algorithm is able to
separate clusters in multidimensional spaces and it
outperforms the previous brute force approach in terms of
execution time.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Sunil</given-names>
            <surname>Arya</surname>
          </string-name>
          ,
          <string-name>
            <given-names>David M.</given-names>
            <surname>Mount</surname>
          </string-name>
          , Nathan S. Netanyahu, Ruth Silverman, and
          <string-name>
            <surname>Angela</surname>
            <given-names>Y. Wu.</given-names>
          </string-name>
          <article-title>An optimal algorithm for approximate nearest neighbor searching ¯xed dimensions</article-title>
          .
          <source>Journal of ACM</source>
          ,
          <volume>45</volume>
          (
          <issue>6</issue>
          ):
          <volume>891</volume>
          {
          <fpage>923</fpage>
          ,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Eric</given-names>
            <surname>Bonabeau</surname>
          </string-name>
          , Marco Dorigo, and
          <string-name>
            <given-names>Guy</given-names>
            <surname>Theraulaz</surname>
          </string-name>
          .
          <article-title>Swarm intelligence: From natural to arti¯cial systems</article-title>
          .
          <source>J. Arti¯cial Societies and Social Simulation</source>
          ,
          <volume>4</volume>
          (
          <issue>1</issue>
          ),
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Martin</given-names>
            <surname>Ester</surname>
          </string-name>
          ,
          <string-name>
            <surname>Hans-Peter Kriegel</surname>
            , Jorg Sander, and
            <given-names>Xiaowei</given-names>
          </string-name>
          <string-name>
            <surname>Xu</surname>
          </string-name>
          .
          <article-title>A density-based algorithm for discovering clusters in large spatial databases with noise</article-title>
          .
          <source>In Proc. 2nd Int. Conf. on Knowledge Discovery and Data Mining</source>
          , pages
          <volume>226</volume>
          {
          <fpage>231</fpage>
          ,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Gianluigi</given-names>
            <surname>Folino</surname>
          </string-name>
          , Agostino Forestiero, and
          <string-name>
            <given-names>Giandomenico</given-names>
            <surname>Spezzano</surname>
          </string-name>
          .
          <article-title>Swarming agents for discovering clusters in spatial data</article-title>
          . ispdc,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Gianluigi</given-names>
            <surname>Folino</surname>
          </string-name>
          and
          <string-name>
            <given-names>Giandomenico</given-names>
            <surname>Spezzano</surname>
          </string-name>
          .
          <article-title>An adaptive °ocking algorithm for spatial clustering</article-title>
          .
          <source>In PPSN</source>
          , pages
          <volume>924</volume>
          {
          <fpage>933</fpage>
          ,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>P.P.</given-names>
            <surname>Grass</surname>
          </string-name>
          .
          <article-title>La Reconstruction du nid et les Coordinations InterIndividuelles chez Beellicositermes Natalensis et Cubitermes sp</article-title>
          . La Thorie de la Stigmergie :
          <article-title>Essai d'interprtation du Comportement des Termites Constructeurs in Insect</article-title>
          .
          <source>Soc. 6</source>
          . Morgan Kaufmann,
          <year>1959</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>N.</given-names>
            <surname>Minar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Burkhart</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Langton</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Askenazi</surname>
          </string-name>
          .
          <article-title>The swarm simulation system, a toolkit for building multi-agent simulations</article-title>
          ,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Craig</surname>
            <given-names>W.</given-names>
          </string-name>
          <string-name>
            <surname>Reynolds</surname>
          </string-name>
          .
          <article-title>Flocks, herds and schools: A distributed behavioral model</article-title>
          .
          <source>In SIGGRAPH '87: Proceedings of the 14th annual conference on Computer graphics and interactive techniques</source>
          , pages
          <volume>25</volume>
          {
          <fpage>34</fpage>
          , New York, NY, USA,
          <year>1987</year>
          . ACM Press.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>