Keywords

1 Introduction

Nowadays public security and crime fighting are one of the most important social priorities in all great cities of the world. Despite the enormous quantity of human and material resources that governments assign for this matter, it is still evident the need for alternative mechanisms that allow to increase the effectiveness and efficiency of police forces [4]. One of the main variables that limit this effectiveness is the response time to crime events. Particularly, immediate-reaction events show that the marginal improvements obtained in this matter are not enough to reduce the general criminal incidence of the zone, as well as to substantially modify the perception of insecurity between citizens [7].

A better perspective of this situation can be achieved if the problem is translated to the sphere of prevention instead of reaction. If public forces were capable to anticipate when and where the criminal activity of a specific kind might be increased, a double benefit could be achieved. On one hand, it would be possible to concentrate resources and logistic activity necessary to fight that specific kind of criminal activity in the anticipated place and time. On the other hand, it could be possible to establish dynamically and with solid foundations several of the common parameters of everyday work in public security, such as the specific design of surveillance rounds, the distribution of forces in time and space, and, of course, the development of security operations, or even information and prevention campaigns through massive communication media [10].

Unfortunately, careful creation and planning of patrolling routes covering the highest criminal incidence is usually not carried out, resulting in personnel being established in a zone of responsibility, where a patrol chief decides under his own criteria where to patrol, without a specific order or previous planning. As a consequence, we can foresee two important problems: the first one is that not all major criminal incidence areas are covered, causing lack of security in certain regions; the second problem is the slow reaction time of patrols. When they receive a call for help, they decide their routes based mostly on the personnel’s experience in traversing short, or less transited roads.

Several methods have been developed for tackling the problem of route optimization. The field of multi-robot cooperative tasks provides an interesting set of examples; see [1] for a thorough compendium of several models. Within this approach, we found two major drawbacks. The first one is that some of them are designed for small devices [12], and the second one is that they are designed for automatic execution, and usually they do not allow incorporating certain restrictions pertaining to real world human driving and wide area sectorization. Other approaches are based on workload balancing models [13], local search techniques [16], and agents [2]. However, to our knowledge, ant colony systems, while being known to be effective for finding optimal routes [8, 15], have not been applied to police patrol route planning considering three real needsFootnote 1: (a) finding the optimal route for a patrol to attend an emergency call; (b) finding the optimal route between the current location of a patrol and a set of nearby streets that require surveillance; and finally (c) to find the optimal route for a patrol, so that it can survey different points of major criminal incidence in a specified neighborhood. In the next section, we will present a short introduction to ant colony systems, then in Sect. 3 we describe our proposed method; in Sect. 4 we present experiments with a case study, and finally in Sect. 5 we draw our conclusions.

2 Ant Colony Optimization

Ant Colony Optimization algorithms are models inspired in real ant colonies. Studies show how animals that are almost blind, such as ants, are capable of following the shortest path to their supplies (food) [3]. This is due to the ability ants have to exchange information, since each one of them, while moving, leaves a trace of a substance called pheromone along their path. Thus, while an isolated ant moves essentially in a random way, agents of an ant colony detect the pheromone trace left by other ants, and tend to follow such trace. These ants, in turn, leave their own pheromone along the travelled path, making it more attractive, since the pheromone trace has been reinforced. With time, the pheromone evaporates, causing the trace to weaken. In short, it could be say that the process is characterized by a positive feedback, in which the probability for an ant to choose a path increases with the number of ants that previously have chosen the same path. One of the first known applications of the ant colony system was the travelling salesman problem (TSP) [6], obtaining favorable results. From that algorithm several heuristics have been developed to improve the original algorithm, and have been applied to other problems such as the vehicle routing problem (VRP) [5] and the Quadratic Assignment Problem (QAP) [11].

In this paper we present result of a heuristic based on an improved version of the ant colony optimization (ACO) algorithm called MMAS (Max Min Ant System) [14].

The ACO algorithms are iterative processes. In each iteration, a colony of m ants is deployed, and each one of the ants constitutes a solution to the problem. Ants build solutions in a probabilistic way, being guided by a trace of artificial pheromone, and by information calculated a priori in a heuristic way. The probabilistic rule for traversing nodes on a graph is:

$$ p_{ij}^{k} \left( t \right) = \frac{{\left[ {\tau_{ij} (t)} \right]^{\alpha } \cdot \left[ {\eta_{ij} } \right]^{\beta } }}{{\mathop \sum \nolimits_{{l \in N_{i}^{k} }} \left[ {\tau_{il} (t)} \right]^{\alpha } \cdot \left[ {\eta_{lj} } \right]^{\beta } }} $$
(1)

where \( p_{ij}^{k} \left( t \right) \) is the probability, in a t iteration of the algorithm, the k ant currently situated in city i, chooses city j as the next stop. N is the set of cities not yet visited by the ant k. \( \tau_{ij} (t) \) is the amount of pheromone accumulated on the arc (i,j) of the network at the t iteration. \( \eta_{ij} \) is the heuristic information for which, in the case of TSP, the inverse of the distance between i and j cities. \( \alpha \) and \( \beta \) are parameters of the algorithm to be adjusted.

When all ants have built a solution, pheromone must be updated on each arc. The formula for this is:

$$ \begin{aligned} & \tau_{ij} \left( {t + 1} \right) = \left( {1 - \rho } \right)\cdot\tau_{ij} \left( t \right) + \cdot \tau_{ij}^{best} , \\ & \varDelta \tau_{ij}^{best} = \left\{ {\begin{array}{*{20}c} {\frac{1}{{L^{best} }}\quad if\;the\;arc\;\left( {i,j} \right)\;belongs\;to\;T^{best} } \\ {0\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad otherwise} \\ \end{array} } \right. \\ \end{aligned} $$
(2)

Where \( \rho \) is the pheromone evaporation coefficient. \( T^{best} \) can be the best solution found at the moment, or the best solution found in the current iteration. The level of pheromone should be in a range \( \left[ {T_{min} ,T_{max} } \right]. \) These limits are established in order to avoid stagnation in the search of solutions. All pheromone is initialized with \( T_{max} \). After updating the pheromone, a new iteration can be started. The final result is the best solution found over all iterations.

This gives us a global view of the MMAS algorithm. In the next section we will present its application to the problem of human and material resources for patrolling routes. We aim to a three-folded purpose: (a) To find the optimal route between a patrol’s current location, and a point where a call for help has been raised. (b) To find optimal routes for patrolling a small set of nearby streets in a neighborhood, and finally (c) To find optimal routes for patrolling different points of major criminal incidence in a specified neighborhood.

3 Proposed Methodology

We will illustrate our methodology with the example case of a neighborhood of the municipality of Cuautitlán Izcalli, México. This neighborhood was selected considering the current geographic level for assignment of patrolling routes. In Fig. 1 the structure at street level can be seen. Patrols must cover the points considered as the most important ones.

Fig. 1.
figure 1

Structure showing streets of a neighborhood in Cuautitlán Izcalli, México

Then, the street structure is transformed to a directed graph \( G = (V,E) \), where \( V \) is a set of vertices or nodes [9]. In our case, those are the crossings between streets. See Fig. 2. \( E \) is a set of arcs connecting the set of nodes, and represent the streets conforming the neighborhood. Each one of these represents the direction a street has. The obtained final graph can be seen in Fig. 3.

Fig. 2.
figure 2

Vertices located on each intersection of streets

Fig. 3.
figure 3

Graph obtained from street structure from a real neighborhood

Our solution employs the algorithm MAX-MIN Ant [14] with modifications to the original restrictions for the TSP for which it was originally presented. Compared to the original TSP, we are interested on having N ants with certain routes that represent the number of available units. In the original problem, we have only one individual. We adapted the MMAS as shown in Fig. 4.

Fig. 4.
figure 4

Pseudocode for the MMAS algorithm. Asterisks show the steps to be modified for the random walk baseline comparison

4 Experiments and Results

In this section we present three experiments developed with MMAS for solving patrolling routes optimization problems as described in previous paragraphs. After several tests, we found the optimal parameters shown in Table 1. We compared our results against a random walk baseline, which consists basically on using the algorithm shown in Fig. 4 without using formulas (1) and (2), i.e., using a plain random roulette with equal probabilities, and not using pheromones at all.

Table 1. Parameters used in the MMAS algorithm

4.1 Goal A: Target Route Optimization

The goal of this experiment is to optimize routes that were created as a preventive perimeter given an alert call in a point or specific street. For this purpose, 5 points in the map’s neighborhood were randomly selected, as well as a common starting point. See Fig. 5 and Table 2.

Fig. 5.
figure 5

Selected alerts in experiment A

Table 2. Results obtained from experiment A

We can see in all cases that the optimal route was automatically found by the ant colony algorithm, while the random walk algorithm did not converge to the optimal solution after the same number of iterations (50), except for Alert 2. For Alerts 1 to 4 the random walk algorithm obtained a route, but for Alert 5 the maximum number of iterations was reached without finding a route to the target node.

4.2 Goal B: Route Optimization

The goal of this experiment is to find optimal routes for patrolling a small set of nearby streets in a neighborhood. This kind of routes is generally assigned to individual patrols.

For this experiment, three different surveillance areas were selected, each one with 6 nearby points, located randomly in the studied neighborhood, as well as a common point, see Fig. 6. It is important to note that the selected areas were managed independently, and that this experiment aims to illustrate the optimal route from a specific point to a particular area, and so, it does not model interaction with other areas. Optimal routes are shown in Table 3. Our Ant Colony algorithm was able to find all optimal routes for this experiment, whereas the random walk baseline found routes for Alerts 2 and 3, but they were not optimal. See Table 4.

Fig. 6.
figure 6

Selected areas in experiment B from the sample neighborhood

Table 3. Optimal routes for experiment B
Table 4. MMAS vs. Random walk routes for experiment B

Found routes are ready to be implemented in a real patrolling scenario. Routes like these were calculated for all neighborhoods of the municipality of Cuautitlán Izcalli, always finding optimal routes.

4.3 Goal C: Diverse Patrolling Areas Optimization

The goal of this experiment is to find optimal routes for patrolling diverse areas that are distributed throughout the whole neighborhood. For this experiment, the algorithm was executed to find two optimal routes. Each one of them must pass through three different surveillance areas. Each area is integrated with 4 nearby points, randomly selected from the studied neighborhood. All routes depart from a common initial point. See Fig. 7.

Fig. 7.
figure 7

Areas to be covered by the routes sought in Experiment C

All optimal routes shown in Table 5 were found by our Ant Colony Algorithm, while the Random walk algorithm was not able to find a route covering the requested route points within the specified number of iterations. In general, several routes were calculated for all neighborhoods in the municipality of Cuautitlán Izcalli, always finding optimal routes, implying the proposed algorithm is a reliable way of calculating patrolling routes given important points to be covered. These points can be obtained from daily operation of patrolling routes planning sessions.

Table 5. Optimal routes for experiment C

5 Conclusions and Future Work

This work has shown the advantage of using evolutionary techniques in the optimization of patrolling routes, obtaining promising results. Based on the carried experiments, we found that ant colony based algorithms are efficient and effective for optimizing several kinds of patrolling routes. In all cases we were able to find an optimal route within a limited number of iterations, while the random walk algorithm found an optimal route in only a few cases. For Patrolling Area Optimization, the random walk algorithm was not able to find a patrolling route within the specified number of iterations. These experiments show that computing the probability of transition for an ant based on a pheromone component, improves the ability of an exploration algorithm to find a feasible solution in short time.

The problems tackled in our experiments are extendable to cover many problems arising currently in great urban zones of the world. A drawback that we found is that processing time increases considerably as the number of points to be visited is greater, so that we would need to explore other improvements if we needed to consider a wider area patrolling planning. Fortunately, this is not the case in most real problems, since large cities tend to divide in sectors their patrolling forces. Around 50 iterations were needed to find an optimal route with our method. The baseline method was not able to find an optimal route within this number of iterations. Further experimentation with the baseline algorithm for finding the needed number of iterations to obtain an optimal route (if possible) has been left as future work.

Also as future work, we plan considering traffic factors affecting patrolling maneuvers, as well as considering other factors impeding free vehicular transit and thus, affect the response time of a patrol.