# Clustering with Nature-Inspired Algorithm Based on Territorial Behavior of Predatory Animals
## 3 Proposed Approach  
Observing solitary, territorial predators, for example, tigers (_Panthera tigris_), can yield interesting results concerning the shape of their territories and hunting areas. Female tigers tend to form separate, convex territories around areas densely populated with their prey, which can be intuitively considered a natural example of clustering of prey. Each territory is marked unambiguously by a single female individual by their scent and other marks they left, but should an individual left an area for a time long enough, and those marks will fade, leaving the territory ownerless. In this paper, the approach imitating the behavior of tigers (or other similar solitary, territorial predators such as lynxes) is proposed. The generalization of their behavior is proposed as follows:1. Clustering is done by the set of (individuals). Each individual has their single position in the given space of instances. This point is always the position of one of the instances and represents the prey the individual is currently hunting. Each individual aims to create a cluster representing their territory. 2. Individuals perform jumps between the prey during consecutive turns. On each turn, each individual jumps to a semi-randomly chosen point in the set from the fraction of their closest points, unmarked by other individuals. 3. Upon a jump, the individual marks the point they jumped to. From now, it is considered a part of their territory (i.e., their cluster). 4. After an individual performs a vast number of jumps far from a point they marked, the traces they left fade, and the location becomes unmarked once again. 5. After all points are marked by individuals, small adjustments are made to simulate fading of areas left behind and making their shape more convex and condensed. The algorithm generally consists of two phases--the search phase and the correction phase. During the search, individuals create their initial territories (clusters), that are later corrected to simulate the changes that occur in nature. The general pseudo-code of the algorithm can be expressed as in Algorithm 1. In the formulation of the algorithm the following notation was used:  
* _dataSet_ consists of \(N\) points, each having their _position_ and _cluster_ (initialized as _null_);
* \(k\) is the number of clusters to partition the set into--it has to be predetermined in advance;
* \(t_{search}\) is a fraction of the set that will be taken into consideration while determining the next jump of an individual;
* \(t_{correct}\) is a is a fraction of the set that will be taken into consideration while determining if it should be corrected;
* \(b\), \(M_{0}\) and \(S\) are the parameters of the exponential function used in determining the jump weights;
* _alpha_ is the multiplier factor for correction that simulates the reluctance of changing a set during the correction phase;
* \(correctionRuns\) is the number of times the correction phase is applied;
* \(F\) is correction function. Its arguments are \(D_{mean}\); the mean distance of points from a given cluster and \(p\), the percentage amount of points from a certain cluster in total points surrounding a point;
* \(t\) determines how long does an individual needs to stray from a point it marked for it to become an unmarked point again;
* the algorithm requires the initialization of \(k\); individuals. In this example, their numbers are also the number of their clusters, while the ID of a point is its index. The first phase (search phase) is performed in turns, during which individuals perform 'jumps' between unmarked points. An example of few first steps for a simple, small set is shown in the Figure 1. During this phase, the following steps are performed:  
1. Each individual \(I_{i}\) considers \(t_{search}*N\) closest points.