Abstract
Diverse movement patterns may be identified when we study a set of moving entities. One of these patterns is known as a Vformation for it is shaped like the letter V. Informally, a set of entities shows a Vformation if the entities are located on one of their two characteristic lines. These lines meet in a position where there is just one entity considered the leader of the formation. Another movement pattern is known as a circular formation for it is shaped like a circle. Informally, circular formations present a set of entities grouped around a center in which the distance from these entities to the center is less than a given threshold. In this paper we present a model to identify Vformations and circular formations with outliers. An outlier is an entity which is part of a formation but is away from it. We also present a model to identify doughnut formations, which are an extension of circular formations. We present formal rules for our models and an algorithm for detecting outliers. The model was validated with NetLogo, a programming and modeling environment for the simulation of natural and social phenomena.
1. Introduction
Diverse movement patterns may be identified when we study a set of moving entities, for example, a flock of birds [1] and a school of fish [2]. One of these patterns is known as a Vformation for it is shaped like the letter V; see Figure 1. Another movement pattern is known as a circular formation for it is shaped like a circle; see Figure 2.
Informally, a set of entities shows a Vformation if the entities are located on one of their two characteristic lines. The lines meet in a position where there is just one entity considered the leader of the formation [3]. Several authors have analyzed Vformations. In [4, 5], there is an attempt to explain from a physical point of view the reasons why certain species of birds, such as Canadian geese (Branta canadensis), red knots (Calidris canutus), and plovers (Calidris alpina), tend to fly this way.
Other authors try to simulate Vformations at a computational level. For instance, Nathan and Barbosa [6] propose a model based on rules that allows us to generate Vformations depending on specific parameters. The authors validated their model using NetLogo [7], a programming and modeling environment to simulate natural and social phenomena.
On the other hand, a circular formation is a set of entities grouped around a common center and where the entities’ distance to the center is less than a given threshold. Regarding related works with circular formations, we identified the following.
In [8] the authors experimented with a set of data referring to the movement of different animal species. It was found that despite being in different ecosystems, species follow similar behavioral patterns. The authors also tried to model general grouping behaviors of fish, birds, insects, and even people. One of these behaviors is circular formation in which they identified physical forces: attraction, repulsion, alignment, and frontal interaction.
On the other hand, researchers in the field of robotics and in control theory, inspired by social grouping phenomena and by the patterns of birds and fish, have developed applications to coordinate the movement of multivehicle systems. Among these patterns are circular [9] and Vformations; see Figure 3.
(a)
(b)
On the other hand, regardless of the type of formation, Reynolds [2, 10] proposes a computer model of coordinated animal motion for bird flocks and fish schools. His model considers three simple rules that act upon individuals: (i) separation: steer to avoid crowding local flockmates, (ii) alignment: steer towards the average heading of local flockmates, and (iii) cohesion: steer to move toward the average position of local flockmates.
Although the previous works allow the simulation of a set of moving entities, they are not aimed at the explicit identification of Vformations and circular formations. The identification of these types of formations may be useful in fields as zoology, to analyze the movement of birds [3] and fish [11], and in the military and videogames where squadrons of combat planes, ships, and robots usually assume these types of formations [3, 12]. Vformations also usually appear in stock markets (stock prices) [13]. In this direction the model of Andersson et al. [14], although it is not aimed at the explicit identification of formations, identifies an entity leader in a set of moving entities. We use their model as the basis for identifying Vformations and circular formations, as we will show in our paper.
This paper is organized as follows. In Section 2, we present our models for Vformations and circular and doughnut formations, which are an extension of circular formations. In Section 3, we present support for outliers in our models. In Section 4, we present experiments. In Section 5, we conclude the paper and propose future works.
2. VFormations and Circular and Doughnut Formations
2.1. Andersson’s Model
Next, we present the essential elements of Andersson’s model [14].
Consider a set of entities that move in a space, usually in a region during a time interval . This space is represented by the Euclidian plane. Time is represented continuously. denotes an infinite set of timepoints: . On the other hand, denotes a finite set of discrete timepoints . Every represents a timestep and corresponds to a timepoint in which the position of a moving entity (and perhaps other data) was recorded. A unittimeinterval is an open interval between two consecutive timesteps, that is, , for all , .
The coordinates of an entity at a timepoint are given by a pair of functions and , both having the signature Real. Andersson assumes that between two consecutive timesteps an entity moves along a straight line with constant direction and constant velocity. This assumption has been adopted in other works (see [15–17] for a discussion). Therefore, in such a model in order to be practical enough, the recording frequency of the positions of moving objects should be adapted to the nature of each domain. For example, when detecting bird formations the elapsed time between two consecutive timesteps should not be longer than 30 seconds.
Consider an entity at a timepoint , where , , ; then the direction of at , denoted by , is the angle specified by the straight line segment that goes from , to ; see Figure 4. The angle is between . Andersson declares the direction of an entity at a timestep to be undefined, because at a timestep an entity might change its direction (for more details see [14]).
The front region of an entity is a region associated with at a timepoint , where , , , which represents the perception region of an entity, for example, a visual or an auditive range. The front region of is defined as follows: consider three straight line segments , , and, , each of length . Each segment has an endpoint at . The direction of the segment is . Segments and form angles of and with regard to segment , respectively. The circular sector (a wedgeshaped region) with a radius , delimited by and , makes up the front region of at and it is denoted by front(e_i, t); see Figure 5.
An entity is in front of an entity , at a timepoint , where , , , if is in the front region of , that is, if is inside front(e_i, t); this is denoted and we say that follows is a follower of at . We consider an additional restriction to establish that one entity follows another: let ; then entity follows entity at if (i) and (ii) ; see Figure 6. An entity is said to follow an entity during a time interval , where and are timepoints in , if and only if follows at , for all , .
An entity is said to be a leader of a formation during a time interval , where and are timepoints in , if (i) does not follow any entity during and (ii) is at least followed by entities at each timepoint , . It is said that there is a leadership pattern if is a leader of at least entities for at least unittimeintervals.
2.2. VFormations
Consider the formation in Figure 7 where entities displayed a Vformation at a timepoint , and is the leader entity. Note that if we applied Andersson’s model [14] to this formation, we would observe that no entity contains in its front region. Therefore, this example shows that Andersson’s model [14] is inadequate to identify leadership patterns in these types of formations, unless we consider a wide front region for each entity, as shown in Figure 8. Thus, the entities on the extremes, and , will require a wide front region to be able to contain the leader entity ; this is not a realistic assumption in Vformations since an entity’s visual field is not usually that wide [4].
In the following section, we extend Andersson’s model to identify leadership patterns in Vformations.
2.3. VFormation Model
Let be a set of moving entities at a timepoint , card. is a Vformation at if the following hold.(i)There exist nonempty subsets and of such that , , , and , where is said to be the leader entity of the formation.(ii)Entities in tend to form a straight line at .(iii)Entities in tend to form a straight line at .(iv)Straight lines and meet at position , .(v) (the smallest angle defined by straight lines and at ).Regarding conditions (ii) and (iii), to establish if a set of entities tend to form a straight line, we use Pearson’s correlation coefficient [18]. Thus, given a set of points , indicates how much they adjust to a straight line (linearity degree). ; if , then points tend to form a straight line. is calculated as shown in (1). A threshold may be specified by the user to indicate the linearity degree required for the lines of the formation; that is, : To obtain the equation for each straight line characteristic of the formation ( and ) we may apply the equations that correspond to the straight line which most suits a set of points ; see (2). Table 1 presents the results for the formation in Figure 9: Regarding condition (v), is calculated as follows: we get straight lines and from the formation and find the smallest angle between them as follows. is the positive angle in that is specified by the line segment that goes from to , where is the position of (leader entity) according to equation for and is the position of , according to equation for . is the positive angle in that is specified by the line segment that goes from to , where is the position of (leader entity) according to equation for and is the position of , , according to equation for .Let ; then if , and , otherwise. For example, in the formation in Figure 9, rad (40.36°), rad (294.44°), and rad (254.08°); thus, rad (105.91°).
In an analogous way to leadership patterns, we say that there is a Vformation pattern if the set of moving entities shows a Vformation for at least unittimeintervals.
2.4. Circular and Doughnut Formations
In this section, we present a formal model to identify circular formations. We also present doughnut formations, which are an extension of circular formations.
2.4.1. Circular Formation Model
Let be a set of moving entities at a timepoint . Let be the minimum circle that encloses the entities in and let be its radius and let () be its center (Welzl [19] and Megiddo [20] have showed that this circle can be found in linear time). is a circular formation at if(i) (a usergiven radius with center at ),(ii)the minimum number of members in the formation is .In Figure 10, we show a circular formation with 9 members.
2.4.2. Doughnut Formation Model
Let be a set of moving entities at a timepoint . Let be the minimum circle that encloses the entities in and let be its radius and its center. is a doughnutformation at if(i) (external radius, a usergiven radius with center at ),(ii)for each entity of the formation its distance regarding is greater than (internal radius, a usergiven radius with center at , ),(iii)the minimum number of members in the formation is .Note that a circular formation is a particular case of a doughnut formation, where . In Figure 11, we show a doughnut formation with 8 members.
Circular and doughnut patterns are also defined in an analogous way to a Vformation pattern.
3. Outliers
Informally, for Vformations an outlier is an entity which is away from its characteristic lines, and for circular formations it is an entity found beyond the radius of the formation .
3.1. Outliers in VFormations
There are sets of entities which tend to display a Vformation; they may have at a timepoint entities which are away from their characteristic lines and which, therefore, affect Pearson’s coefficient. These entities are called outliers [22, 23].
There are numerous methods to detect outliers in different domains [24]. Listing 1 presents an algorithm that receives an array of entities (lineMembers) which form a characteristic line of a formation at a timepoint . The algorithm determines if, after removing a maximum number of entities on the given array, the Pearson’s coefficient surpasses a given threshold . For example, if it is permitted to remove a maximum of two entities from a characteristic line of the formation, it is considered that the entities in Figure 12 display a Vformation having two outliers on each characteristic line. Then, the algorithm receives the minimum value of Pearson’s coefficient which should be met and a maximum percentage of entities (percentageOutliers) which are permitted to be removed from the array of entities. This percentage is calculated with regard to the total number of entities .

Example 1. Consider the set of entities in Figure 13 which would form a straight line if entities and were not considered; that is, and are outliers.
Input algorithm parameters:
, and percentageOutliers = 20%.
Step 1. Equation of : .
Step 2. nbrOutliers = .
Step 3. and .
Step 4. lineMembers .
Step 5. Pearson = PearsonCoefficient (lineMembers) = 1.
Step 6. ; then return outliers = [].
The algorithm determines that entities and are outliers. Then, we conclude that entities , and tend to form a straight line with Pearson’s coefficient greater than 0.99.
3.2. Outliers in Circular Formations
Let be a set of moving entities at a timepoint . Consider an entity such that is a circular formation and the distance from to () (center of the minimum circle that encloses the entities in ) is greater than at . This entity may be considered as a member of the formation which is temporally away from it; that is, is an outlier. To identify this type of entities, we introduce a parameter , where . An entity is considered an outlier at a timepoint if its distance to (, ) is greater than and less than ; see Figure 14.
Since the distancing of the outlier entity from the formation is temporal, an analyst may introduce a second parameter to control the maximum continuous time of permitted distancing. That is, if an entity separates from a circular formation at a timepoint , then, to be considered an outlier, it will have to reincorporate () to the formation before . This same aspect can also be considered for outliers in Vformations.
An analyst can also specify a maximum permitted number of outliers maxNumberOutliers in the formation. This value can be calculated from a percentage (percentageOutliers) with regard to the total number of entities in the formation.
3.3. Outliers in Doughnut Formations
Let be a set of moving entities at a timepoint . Consider an entity such that is a doughnut formation. For doughnut formations we consider two types of outliers: external and internal. An entity is considered an external outlier at if its distance to () (center of the minimum circle that encloses the entities in ) is greater than and less than , where . On the other hand, is considered an internal outlier at if is less than ; see Figure 15.
Analogously to circular formations, and maxNumberOutliers values may be specified, not only for external outliers but also for internal outliers.
4. Experiments and Discussion
4.1. Experiment for VFormations
For our experiment, we used Nathan’s model [6] implemented in NetLogo in order to generate Vformations. NetLogo is a programmable modeling environment for simulating natural and social phenomena that have been used in previous works [14, 25].
We worked with a population of 15 entities. The dimensions of the Euclidian plane where the entities move were and , where the unit of measure for distance in NetLogo is a patch. To generate Vformations, we used the parameters in Table 2. These parameters allow us to define aspects related to vision and movement of the entities in Nathan’s model.
For outlier detection, we considered for our model the following parameters: and percentageOutliers = 20%. Our experiment began from tick 40199 and ended at tick 40400, because in Nathan’s model the generation of Vformations requires a stabilization time (tick 40199 in our experiment, a tick is the unit of measure for time in NetLogo). Timesteps were taken in intervals of 20 ticks, for if we consider a smaller step, a change in the position and direction of an entity would be practically imperceptible. Thus, the total number of steps was 10. Figure 16 shows the position of entities at ticks 40200, 40220, 40380, and 40400 and Table 3 summarizes our results.
(a)
(b)
(c)
(d)
4.1.1. Analysis of VFormation Results
According to the results shown in Table 3, our model classified several sets of entities as Vformations. These results agree with what was expected since Nathan’s model had already stabilized and Vformations were being generated effectively for those times. Moreover, it was necessary to apply the outlier detection algorithm just in two ticks (at ticks 40380 and 40400, see entities in brackets in Table 3, second column). On the other hand, we found that formations showed a high linearity degree since Pearson’s coefficients in all cases were greater than 0.92.
We also applied Andersson’s model. We considered and for the front region of each entity the parameters in Table 2; that is, patches (vision distance) and rad (103°) (vision cone). Andersson’s model only identified formations of two and three entities. This is reasonable as explained in Section 2.2 (see Figure 8). In addition, his model does not give information about the shape of the formation that it identifies; even if we considered a wider front region, his model would not indicate that a formation is, for example, shaped.
4.2. Experiments for Circular and Doughnut Formations
For experiments with circular and doughnut formations, we also worked in NetLogo and used Wilensky’s model [26] (a model inspired in Reynolds’ work [10]), which generates randomized formations of entities in NetLogo.
We worked with a population of 102 entities. The dimensions of the Euclidian plane where the entities move were and . To generate formations, we used the parameters in Table 4.
The model was executed on 1200 consecutive ticks (one run) and we conducted an analysis of circular formations and doughnut formations every 400 ticks. We considered that a set of entities showed a circular/doughnut pattern if the set showed a circular/doughnut formation during all the run (1200 ticks). A total of 100 runs were conducted. The parameters used to detect circular and doughnut formations are shown in Tables 5 and 6. Table 7 summarizes our results for the 100 runs. Figure 17 shows the results for one of the runs.
(a)
(b)
(c)
(d)
4.2.1. Analysis of Experiments for Circular and Doughnut Formations
According to the results shown in Table 7, the model classified several sets of entities as circular formations and around three remained throughout the 1200 ticks of a run. Regarding doughnut formations, the model detected around two formations that remained during the 1200 ticks of a run. These results agree with what was expected since Wilensky’s model had already stabilized in NetLogo.
With respect to Andersson’s model, we considered and the parameters in Table 2. His model identified 752 formations during the 100 runs, a value that is greater than the total number of circular and doughnutformations identified during the 100 runs. This is reasonable because with (note that the average number of entities in his formations was four) it is expected that any set of at least three entities that are close to each other (considering patches) will be identified as a formation. However, as our previous experiments with Vformations, his model is unable to indicate the shape of a formation that it identifies.
5. Conclusions and Future Work
In this paper, we propose two models:(I)a model to identify Vformations with outliers. The model considers the location of entities to determine if they form this type of formation during a time interval;(II)a model to identify circular formations with outliers. The model considers the location of entities to determine if they form this type of formation during a time interval. In addition, we proposed an extension to identify doughnut formations with outliers.The rules for model (I) are flexible since they allow Vformations which are not necessarily perfectly aligned, in accordance with the real world. Furthermore, we consider outliers in V, circular, and doughnut formations, that is, members of the formation that could be temporarily away from it. Our experimental results in NetLogo showed that our models identified these types of formations in such simulation environment where they were generated. We also showed that when we applied Andersson’s model, his model did not give information about the shape of the formation that it identified; that is, his model suffers from lack of semantic information about shape formations.
Regarding future work, we plan to conduct a series of experiments in the stock market where Vformations usually appear [13]. Moreover, we plan to extend our models to identify isolated entities, that is, entities that even if they are considered members of a formation, they follow their own path and do not influence the path of other entities [27]. We also plan to propose models to identify patterns such as convergence, that is, a set of entities that converge or approach a place; divergence, that is, a set of entities that disperse or move away from a place [28], and selforganization, that is, a set of entities that move as a formation without there being a leader or an entity guiding the rest [29] or that this leader is unknown to the members [30–32].
Conflict of Interests
The authors declare that there is no conflict of interests regarding the publication of this paper.
Acknowledgment
This paper presents preliminary results of the project “Apoyo al Grupo de Sistemas Inteligentes WebSINTELWEB” with Quipú code 205010011129, developed at the Universidad Nacional de Colombia, Sede Medellín.