**2. Problem definition**

platforms, they are quickly adopting car sharing as a mainstream transportation solution. Investments in new travel patterns have become a priority to enable the transformation of opportunities in the urban mobility segment into new revenue

provided by on-demand mobility platforms, called Quota Traveling Salesman Problem with Passengers, Incomplete Ride, and Collection Time (QTSP-PIC). In this problem, the salesman is the vehicle driver and can reduce travel costs by sharing expenses with passengers. He must respect the budget limitations and the maximum travel time of every passenger. Each passenger can be transported directly to the desired destination or an alternate destination. Lira et al. [4] suggest pro-environmental or money-saving concerns can induce users of a ride-sharing

service to agree to fulfill their needs at an alternate destination.

*Operations Management - Emerging Trend in the Digital Era*

gers transported to a destination similar to the desired one.

of information regarding the instance type and the search space.

MS-*MM*AS by comparing it to other ACO variants proposed in [5].

This study deals with a novel optimization model that can improve the services

The QTSP-PIC can model a wide variety of real-world applications. Cases related to sales and tourism are the most pertinent ones. The salesman must choose which cities to visit to reach a minimum sales quota, and the order to visit them to fulfill travel requests. In the tourism case, the salesman is a tourist that chooses the best tourist attractions to visit during a vacation trip and can use a ride-sharing system to reduce travel expenses. In both cases, the driver negotiates discounts with passen-

The QTSP-PIC was introduced by Silva et al. [5]. They presented a mathematical formulation and heuristics based on Ant Colony Optimization (ACO) [6]. To support the ant algorithms, they proposed a Ride-Matching Heuristic (RMH) and a local search with multiple neighborhood operators, called Multi-neighborhood Local Search (MnLS). They tested the performances of the ant algorithms on 144 instances up to 500 vertices. One of these algorithms, the Multi-Strategy Ant Colony System (MS-ACS), provided the best results. They concluded that their most promising algorithm could improve with learning techniques to choose the source

In this study, a *MAX-MIN* Ant System (*MM*AS) adaptation to the QTSP-PIC, called Multi-Strategy *MAX-MIN* Ant System (MS-*MM*AS), is discussed. *MM*AS improves the design of Ant System [6], the first ACO algorithm, with three important aspects: only the best ants are allowed to add pheromone during the pheromone trail update; use of a mechanism for limiting the strengths of the pheromone trails; and, incorporation of local search algorithms to improve the best solutions. Plenty of recent studies proved good effectiveness of the *MM*AS in correlated problems to QTSP-PIC [7–10]. However, none of these explored the Multi-Strategy (MS)

In the traditional ant algorithms applied to Traveling Salesman Problem (TSP), ants use the arcs' cost as heuristic information [6]. The heuristic information adopted is called visibility. When solving the QTSP-PIC, different types of decisions must be considered: the accomplishment of the minimum quota, management of the ride requests, and minimization of travel costs. The MS idea is to use different mechanisms of visibility for the ants to improve diversification. Every ant decides which strategy to use at random with uniform distribution. The MS proposed in this study extends the original implementation proposed in [5]. MS-*MM*AS also incorporates RMH and MnLS and uses a memory-based technique proposed in [11] to avoid redundant work. In MS-*MM*AS, a hash table stores every solution constructed and used as initial solutions to a local algorithm. When the algorithm constructs a new solution, it starts the local search phase if the new solution is not in the hash table. The benchmark for the tests consisted of 144 QTSP-PIC instances. It was proposed by Silva et al. [5]. Numerical results confirmed the effectiveness of the

streams.

concept.

**78**

The TSP can be formulated as a complete weighted directed graph *G* ¼ ð Þ *N*, *A* where *<sup>N</sup>* is the set of vertices and *<sup>A</sup>* <sup>¼</sup> f g ð Þj *<sup>i</sup>*, *<sup>j</sup> <sup>i</sup>*, *<sup>j</sup>*<sup>∈</sup> *<sup>N</sup>* is the set of arcs. *<sup>C</sup>* <sup>¼</sup> *cij* is the arc-weight matrix such that *cij* is the cost of arc ð Þ *i*, *j* . The objective is to determine the shortest Hamiltonian cycle in *G*. Due to its applicability, many TSP variants deal with specific constraints [12]. Awerbuch et al. [13] presented several quota-driven variants. One of them, called Quota Traveling Salesman Problem (QTSP), is the basis for the problem investigated in this study. In the QTSP, there is a bonus associated with each vertex of *G*. The salesman has to collect a minimum quota of bonuses in the visited vertices. Thus the salesman needs to figure out which cities to visit to achieve the minimum quota. The goal is to find a minimum cost tour such that the sum of the bonuses collected in the visited vertices is at least the minimum quota.

The QTSP-PIC is a QTSP variant in which the salesman is the driver of a vehicle and can reduce travel costs by sharing expenses with passengers. There is a travel request, associated with each person demanding a ride, consisting of a pickup and a drop off point, a budget limit, a limit for the travel duration, and penalties associated with alternative drop-off points. There is a penalty associated with each point different from the destination demanded by each person. The salesman can accept or decline travel requests. This model combines elements of ride-sharing systems [14] with alternative destinations [4], and the selective pickup and delivery problem [15].

Let *G N*ð Þ , *A* be a connected graph, where *N* is the set of vertices and *A* ¼ f g ð Þj *i*, *j i*, *j*∈ *N* is the set of arcs. Parameter *qi* denotes the quota associated with vertex *i*∈ *N* and *gi* the time required to collect the quota. *cij* and *tij* denote, respectively, the cost and time required to traverse edge ð Þ *i*, *j* ∈ *A*. Let *L* be the set of passengers. List *li* ⊆*L* denotes the subset of passengers who depart from *i* ∈ *N*. Let *org l*ð Þ and *dst l*ð Þ∈ *N* be the pickup and drop-off points requested by passenger *l*. The salesman departs from city *s* ¼ 1, visits exactly once each city of subset *N*<sup>0</sup> ⊆ *N* and returns to *s*. The quota collected by the salesman must be at least *K* units. Along the trip, the salesman may choose which travel requests to fulfill. The travel costs are shared with vehicle occupants. The number of vehicle occupants, or passengers, cannot exceed *R*. Each passenger *l* ∈*L* imposes a budget limit *wl* and a trip's maximum duration *bl*. Let *hlj* be the penalty to deliver passenger *l* ∈*L* at city *j*∈ *N*, *j* 6¼ *dst l*ð Þ. The value of variable *hlj* is computed in the final cost of the tour if passenger *l* is delivered to city *j*. If *j* ¼ *dst l*ð Þ, then *hlj* ¼ 0. The objective of the QTSP-PIC is to find a Hamiltonian cycle Ψ ¼ *N*<sup>0</sup> , *A*<sup>0</sup> ð Þ such that the ride-sharing cost and eventual penalties are minimized, and the quota constraint is satisfied.

The QTSP is NP-hard [13]. It is a particular case of the QTSP-PIC, in which the list of persons demanding a ride is empty and the time spent to collect the bonus in each vertex is zero. Thus, QTSP-PIC also belongs to the NP-hard class.

Silva et al. [5] presented an integer non-linear programming model for the QTSP-PIC. They defined a solution as *S* ¼ *N*<sup>0</sup> , *Q*<sup>0</sup> , *L*<sup>0</sup> , *H*<sup>0</sup> ð Þ, where *N*<sup>0</sup> is a list of vertices that represents a cycle, Ψ, such that the minimum quota restriction, *K*, is satisfied; *Q*<sup>0</sup> is a binary list in which the *i*-th element is 1 if the salesman collects the bonus from city *i*, *i*∈ *N*<sup>0</sup> ; *L*<sup>0</sup> is a binary list in which the *l*-th element is 1 if the salesman accepts the *l*-th travel request; and *H*<sup>0</sup> is a list of integers in which the *l*-th element is the index of the city where the *l*-th passenger leaves the car. If *L*<sup>0</sup> ½�¼*l* 0, then *H*<sup>0</sup> ½�¼*l* 0. The cost of solution *S*, denoted by *S:cost*, is calculated by Eq. (1).

$$S.cost = \sum\_{i,j \in N'} \frac{c\_{ij}}{1 + \sum\_{l \in L'} v\_{ij}^l} + \sum\_{l \in L'} h\_{l \text{if}\_l'} \tag{1}$$

Considering the context of ant algorithms applied to the TSP, when moving through the graph *G*, artificial ants tend to follow paths with higher pheromone deposits rates. As ants tend to deposit pheromone along the path they follow, as more ants choose the same path, the pheromone rate tends to increase in these paths. This cooperation mechanism induces artificial ants to find good solutions, as it works as a shared memory that is continuously updated and can be consulted by

*Multi-Strategy* MAX-MIN *Ant System for Solving Quota Traveling Salesman…*

The base-line of the Ant Colony Optimization is the algorithm Ant System [6]. In the TSP application, *N* is the set of vertices to visit. Ants construct solutions iteratively. Every iteration, the ant chooses the next vertex based on heuristic information, *η*, and pheromone trails, *τ*. Initially, pheromone trails have the same amount of pheromone, *τ*0, computed by Eq. (2), where *n* is the number of vertices

The *k*-th ant iteratively adds new vertices to the solution. The algorithm uses Eq. (3) to compute the probability of the *k*-th ant to move from vertex *i* to *j* at the

*ij* <sup>¼</sup> ð Þ *<sup>n</sup>* � *Cost D*ð Þ �<sup>1</sup> (2)

*cij* is the heuristic factor, *τij*ð Þ*t* is the pheromone in arc ð Þ *i*, *j*

*<sup>β</sup>* h i , *<sup>j</sup>*∈Λ*<sup>k</sup>* (3)

*ij* (5)

(6)

in *N* and *Cost D*ð Þ is the value of the TSP tour built by a greedy heuristic.

in the *t*-th iteration, and Λ*<sup>k</sup>* is the list of vertices not visited by the *k*-th ant. Coefficients *α* and *β* weight the influence of the pheromone and heuristic information, respectively. They are user-defined parameters. If *α* ¼ 0, the probability computed by Eq. (3) depends only on the heuristic information. So, the ant algorithm behaves like a greedy method. If *β* ¼ 0, ants tend to select paths with higher pheromone levels. It may lead the algorithm to early

stagnation. So, balancing the values of *α* and *β* is critical to guarantee a suitable

*<sup>τ</sup>ij*ð Þ*<sup>t</sup>* � �*<sup>α</sup>* � *<sup>η</sup>ij* h i*<sup>β</sup>*

*<sup>w</sup>* <sup>∈</sup>Λ*<sup>k</sup>* ½ � *<sup>τ</sup>iw*ð Þ*<sup>t</sup> <sup>α</sup>* � ½ � *<sup>η</sup>iw*

<sup>Δ</sup>*τij* <sup>¼</sup> <sup>X</sup>*<sup>m</sup>*

The ant algorithms proposed after AS improved its implementation design with elitist pheromone update strategies and local search algorithms to improve solutions [6]. Two well-known variants of AS are the Ant Colony System

(ACS) [20] and *MAX-MIN* Ant System [21]. Silva et al. [5] presented AS and ACS adaptations for the QTSP-PIC. Section 3.1 presents the *MAX-MIN* Ant System

1

*k*¼1

Eqs. (4) and (5) show the formulas used to update pheromone trails, where *ρ* is the evaporation coefficient, *Cost W<sup>k</sup>* � � is the cost of the route *W<sup>k</sup>* built by the *k*-th

*ij* is the pheromone deposited on arc ð Þ *i*, *j* by the *k*-th ant, computed by

Δ*τ<sup>k</sup>*

*Cost W<sup>k</sup>* � � , if arc ð Þ *<sup>i</sup>*, *<sup>j</sup>* <sup>∈</sup> *<sup>W</sup><sup>k</sup>:*

0, otherwise*:*

*τij* ¼ ð Þ� 1 � *ρ τij* þ *ρ* � Δ*τij*, *ρ* ∈½ � 0, 1 (4)

*τ*0

every ant in the colony [19].

*DOI: http://dx.doi.org/10.5772/intechopen.93860*

*<sup>t</sup>*-th iteration, where *<sup>η</sup>ij* <sup>¼</sup> <sup>1</sup>

search strategy [5].

ant, and Δ*τ<sup>k</sup>*

algorithm.

**81**

expression (6).

ϒ*k ij*ðÞ¼ *t*

P

Δ*τij* ¼

8 < :

### **3. Ant Colony Optimization**

In the Ant Colony Optimization, artificial ants build and share information about the quality of solutions achieved with a communication scheme similar to what occurs with some real ants species. Deneubourg et al. [16] investigated the behavior of Argentine ants and performed some experiments, where there were two bridges between the nest and a food source. He observed that the ants initially walked on the two bridges at random, depositing pheromone in the paths. Over time, due to random fluctuations, the pheromone concentration of one bridge was higher than the other. Thus, more ants were attracted to that route. Finally, the whole colony ended up converging towards the same route. The behavior of artificial ants preserves four notions of the natural behavior of ants:


Pheromone is a chemical structure of communication [17]. According to Dorigo et al. [18], pheromone enables the process of stigmergy and self-organization in which simple agents perform complex and objective-oriented behaviors. Stigmergy is a particular form of indirect communication used by social insects to coordinate their activities [18].

*Multi-Strategy* MAX-MIN *Ant System for Solving Quota Traveling Salesman… DOI: http://dx.doi.org/10.5772/intechopen.93860*

Considering the context of ant algorithms applied to the TSP, when moving through the graph *G*, artificial ants tend to follow paths with higher pheromone deposits rates. As ants tend to deposit pheromone along the path they follow, as more ants choose the same path, the pheromone rate tends to increase in these paths. This cooperation mechanism induces artificial ants to find good solutions, as it works as a shared memory that is continuously updated and can be consulted by every ant in the colony [19].

The base-line of the Ant Colony Optimization is the algorithm Ant System [6]. In the TSP application, *N* is the set of vertices to visit. Ants construct solutions iteratively. Every iteration, the ant chooses the next vertex based on heuristic information, *η*, and pheromone trails, *τ*. Initially, pheromone trails have the same amount of pheromone, *τ*0, computed by Eq. (2), where *n* is the number of vertices in *N* and *Cost D*ð Þ is the value of the TSP tour built by a greedy heuristic.

$$
\pi^0\_{\vec{\eta}} = (\pi \times \text{Cost}(D))^{-1} \tag{2}
$$

The *k*-th ant iteratively adds new vertices to the solution. The algorithm uses Eq. (3) to compute the probability of the *k*-th ant to move from vertex *i* to *j* at the *<sup>t</sup>*-th iteration, where *<sup>η</sup>ij* <sup>¼</sup> <sup>1</sup> *cij* is the heuristic factor, *τij*ð Þ*t* is the pheromone in arc ð Þ *i*, *j* in the *t*-th iteration, and Λ*<sup>k</sup>* is the list of vertices not visited by the *k*-th ant. Coefficients *α* and *β* weight the influence of the pheromone and heuristic information, respectively. They are user-defined parameters. If *α* ¼ 0, the probability computed by Eq. (3) depends only on the heuristic information. So, the ant algorithm behaves like a greedy method. If *β* ¼ 0, ants tend to select paths with higher pheromone levels. It may lead the algorithm to early stagnation. So, balancing the values of *α* and *β* is critical to guarantee a suitable search strategy [5].

$$\Upsilon\_{ij}^{k}(t) = \frac{\left[\tau\_{ij}(t)\right]^a \cdot \left[\eta\_{ij}\right]^\beta}{\sum\_{w \in \Lambda^k} \left[\left[\tau\_{iw}(t)\right]^a \cdot \left[\eta\_{iw}\right]^\beta\right]}, \qquad j \in \Lambda^k \tag{3}$$

Eqs. (4) and (5) show the formulas used to update pheromone trails, where *ρ* is the evaporation coefficient, *Cost W<sup>k</sup>* � � is the cost of the route *W<sup>k</sup>* built by the *k*-th ant, and Δ*τ<sup>k</sup> ij* is the pheromone deposited on arc ð Þ *i*, *j* by the *k*-th ant, computed by expression (6).

$$
\pi\_{\vec{\eta}} = (\mathbf{1} - \rho) \times \tau\_{\vec{\eta}} + \rho \times \Delta \tau\_{\vec{\eta}}, \qquad \rho \in [0, 1] \tag{4}
$$

$$
\Delta \tau\_{ij} = \sum\_{k=1}^{m} \Delta \tau\_{ij}^{k} \tag{5}
$$

$$\Delta \tau\_{\vec{\eta}} = \begin{cases} \frac{1}{\text{Cost}\left(\mathbf{W}^k\right)}, & \text{if } \text{arc}\left(i, j\right) \in \mathbf{W}^k. \\\ 0, & \text{otherwise}. \end{cases} \tag{6}$$

The ant algorithms proposed after AS improved its implementation design with elitist pheromone update strategies and local search algorithms to improve solutions [6]. Two well-known variants of AS are the Ant Colony System (ACS) [20] and *MAX-MIN* Ant System [21]. Silva et al. [5] presented AS and ACS adaptations for the QTSP-PIC. Section 3.1 presents the *MAX-MIN* Ant System algorithm.

salesman departs from city *s* ¼ 1, visits exactly once each city of subset *N*<sup>0</sup>

and eventual penalties are minimized, and the quota constraint is satisfied.

each vertex is zero. Thus, QTSP-PIC also belongs to the NP-hard class.

The QTSP is NP-hard [13]. It is a particular case of the QTSP-PIC, in which the list of persons demanding a ride is empty and the time spent to collect the bonus in

> , *Q*<sup>0</sup> , *L*<sup>0</sup>

; *L*<sup>0</sup> is a binary list in which the *l*-th element is 1 if the

<sup>þ</sup> <sup>X</sup> *l*∈*L*0 *hlH*<sup>0</sup>

Silva et al. [5] presented an integer non-linear programming model for the

vertices that represents a cycle, Ψ, such that the minimum quota restriction, *K*, is satisfied; *Q*<sup>0</sup> is a binary list in which the *i*-th element is 1 if the salesman collects the

salesman accepts the *l*-th travel request; and *H*<sup>0</sup> is a list of integers in which the *l*-th

½�¼*l* 0. The cost of solution *S*, denoted by *S:cost*, is calculated by Eq. (1).

*cij* <sup>1</sup> <sup>þ</sup> <sup>P</sup>

In the Ant Colony Optimization, artificial ants build and share information about the quality of solutions achieved with a communication scheme similar to what occurs with some real ants species. Deneubourg et al. [16] investigated the behavior of Argentine ants and performed some experiments, where there were two bridges between the nest and a food source. He observed that the ants initially walked on the two bridges at random, depositing pheromone in the paths. Over time, due to random fluctuations, the pheromone concentration of one bridge was higher than the other. Thus, more ants were attracted to that route. Finally, the whole colony ended up converging towards the same route. The behavior of artifi-

*l*∈*L*0*v<sup>l</sup> ij*

element is the index of the city where the *l*-th passenger leaves the car. If *L*<sup>0</sup>

*<sup>S</sup>:cost* <sup>¼</sup> <sup>X</sup>

cial ants preserves four notions of the natural behavior of ants:

• Predilection for trails with pheromone concentration;

• Concentration of the amount of pheromone in shorter trails;

• Communication between ants through the pheromone deposit.

Pheromone is a chemical structure of communication [17]. According to Dorigo et al. [18], pheromone enables the process of stigmergy and self-organization in which simple agents perform complex and objective-oriented behaviors. Stigmergy is a particular form of indirect communication used by social insects to coordinate

• Pheromone deposit on the traveled trail;

*i*, *j*∈ *N*0

QTSP-PIC is to find a Hamiltonian cycle Ψ ¼ *N*<sup>0</sup>

*Operations Management - Emerging Trend in the Digital Era*

QTSP-PIC. They defined a solution as *S* ¼ *N*<sup>0</sup>

bonus from city *i*, *i*∈ *N*<sup>0</sup>

**3. Ant Colony Optimization**

their activities [18].

**80**

then *H*<sup>0</sup>

returns to *s*. The quota collected by the salesman must be at least *K* units. Along the trip, the salesman may choose which travel requests to fulfill. The travel costs are shared with vehicle occupants. The number of vehicle occupants, or passengers, cannot exceed *R*. Each passenger *l* ∈*L* imposes a budget limit *wl* and a trip's maximum duration *bl*. Let *hlj* be the penalty to deliver passenger *l* ∈*L* at city *j*∈ *N*, *j* 6¼ *dst l*ð Þ. The value of variable *hlj* is computed in the final cost of the tour if passenger *l* is delivered to city *j*. If *j* ¼ *dst l*ð Þ, then *hlj* ¼ 0. The objective of the

⊆ *N* and

½�¼*l* 0,

*<sup>l</sup>* (1)

, *A*<sup>0</sup> ð Þ such that the ride-sharing cost

, *H*<sup>0</sup> ð Þ, where *N*<sup>0</sup> is a list of
