A Compact Model for the Clustered Orienteering Problem

: Background: The Clustered Orienteering Problem is an optimization problem faced in last-mile logistics. The aim is, given an available time window, to visit vertices and to collect as much profit as possible in the given time. The vertices to visit have to be selected among a set of service requests. In particular, the vertices belong to clusters, the profits are associated with clusters, and the price relative to a cluster is collected only if all the vertices of a cluster are visited. Any solving methods providing better solutions also imply a new step towards sustainable logistics since companies can rely on more efficient delivery patterns, which, in turn, are associated with an improved urban environment with benefits both to the population and the administration thanks to an optimized and controlled last-mile delivery flow. Methods: In this paper, we propose a constraint programming model for the problem, and we empirically evaluate the potential of the new model by solving it with out-of-the-box software. Results: The results indicate that, when compared to the exact methods currently available in the literature, the new approach proposed stands out. Moreover, when comparing the quality of the heuristic solutions retrieved by the new model with those found by tailored methods, a good performance can be observed. In more detail, many new best-known upper bounds for the cost of the optimal solutions are reported, and several instances are solved to optimality for the first time. Conclusions: The paper provides a new practical and easy-to-implement tool to effectively deal with an optimization problem commonly faced in last-mile logistics.


Introduction
The Orienteering Problem (OP) was introduced in [1,2] in the 1980s.In an interpretation of the problem from the viewpoint of logistics, there is a single vehicle, leaving from and returning to a depot, which serves a set of customers, each one associated with a spacial location and profit, with such a profit collected upon visiting the location.The travel times among the locations are known, deterministic, and given.However, not all the customers can typically be serviced, since the vehicle mission cannot be longer than a given maximum time.The aim of the problem is to maximize the total profit collected by the vehicle in the available time.The problem has attracted a lot of attention due to its practical implications, and many variations of the original problem have been introduced over the years.We refer the interested reader to [3][4][5][6] for exhaustive reviews of the scientific literature on these problems.Optimization approaches for last-mile logistics, in general, have become more and more popular in recent years due to the dramatic increase in e-commerce [7], which automatically generates a great need for effective operational solutions [8][9][10][11][12].
A generalization of the OP, called the Clustered Orienteering Problem (COP), was originally proposed in [13], and is the topic of the present study.There is a set of customers that are grouped into clusters.Associated with each cluster there is a profit, which is collected once all customers of the cluster are visited.A classic application of the COP is in last-mile distribution in the retail sector: sometimes contracts allow collection of the profit only if all the warehouses (or shops) of a chain (cluster) are visited.Another typical application is again in last-mile logistics, which is about the collection of goods from the customers in order to aggregate them for further shipping.In this case, the profit is collected only if all the goods planned to be aggregated together (typically to form a container) are collected, otherwise the shipment cannot happen and there is a delay.The growth of e-commerce associated with globalization gives a measure of the impact on the pollution of the activities associated with these logistics problems.It is safe to state that any improvement on their solution is a clear step towards a more sustainable society.
The COP should not be confused with the Set Orienteering Problem [14,15], which shares the same input information, but with a different objective, namely, the profit is collected once a single vertex of a cluster is visited.This problem was introduced to model a different family of last-mile logistics applications.
The first algorithmic approaches to solve the COP were proposed in [13], where exact solving approaches, based on a mixed-integer linear program (MILP) and on a branch-andcut method were proposed.In the same paper, three different variations of a tabu search heuristic were also proposed to deal with those instances that could not be effectively be treated by the exact solvers.More recently, other heuristic approaches were discussed, respectively, in [16], where a hybrid heuristic (HH) method was proposed, and in [17], where the authors propose a hybrid evolutionary algorithm (HEA).A cutting plane method was introduced as an exact method in [18] for the Clustered Team Orienteering Problem, a version of the COP with multiple vehicles.In the same paper, a generalization of the heuristic algorithm HH is also discussed.A summary of the contributions of these works can be found in Table 1.

Paper Exact Methods Heuristic Methods Multiple Trucks
Angelelli et al. [13] Yes Yes No Yahiaoui et al. [16] No Yes No Yahiaoui et al. [18] Yes Yes Yes Wu et al. [17] No Yes No This paper

Yes No No
In the present work-which is along the line of recent successful applications of constraint programming (CP) to other last-mile logistic problems [19,20]-we introduce a novel exact solving method for the COP, which is able to take advantage of the technologies available in modern solvers and modern hardware.The results achieved indicate that the new approach is able to provide state-of-the-art results, notwithstanding an implementation complexity that is substantially lower than that of the exact methods previously available in the literature, with improved upper bounds for the optimal cost of several instances, and many instances closed here for the first time.
The real-world implications of our results in terms of last-mile logistics derive from the availability of the new tool we make available to practitioners, which allows them to have a better understanding and higher-quality solutions while carrying out operational planning.This, coupled with a better strategic organization, can lead to a more optimized and harmonized logistics, leading to direct social benefits for citizens (higher quality service), providers (less costs), and the cities themselves (less traffic in the urban environment).

Problem Description
Let G = (V, A) be a directed graph, where V = {0} ∪ C is the set of vertices of the graph and A is the set of arcs.The depot (starting and ending point of the route) is vertex 0, while C is the set of locations of the customers.A set of m + 1 clusters C 0 , C 1 , . . ., C m is given, such that C i ⊆ C ∀i ∈ {0, 1, . . ., m} and they cover C: ( m i=0 C i = C).Notice that clusters can overlap.Each vertex j ∈ C is part of at least one cluster, but it can be part of several.A profit p i is associated with each cluster C i , and such a profit is collected only if all the vertices j ∈ C i are visited.Cluster C 0 contains only the depot 0 and has a null profit.A travel time c jk is associated with each arc (j, k) ∈ A, representing travel times, and a maximum time T max is given.The Clustered Orienteering Problem (COP) consists of finding a route on vertices V with a total travel time not longer than T max that maximizes the total profit collected.In the remainder of the paper, we assume-consistently with the previous literature-that the travel times satisfy triangle inequalities.An example with a COP instance and a relative solution is provided in Figure 1.The squared node 0 is the depot, while the other vertices are customers.Clusters are represented as coloured rectangles, with the associated profit depicted in a corner.Travel times are omitted for the sake of simplicity, together with the threshold T max .A tour with a total profit of 90 is drawn in black.

A Model Based on Constraint Programming
The COP can be described through the following constraint programming model, designed according to the syntax of the Google OR-Tools [21] CP-SAT solver [22].The idea behind the model is to define for each cluster a representative vertex, which will be used to easily identify the visited clusters and to define constraints effectively.Let r i be the representative of cluster C i .Such a vertex is either selected as one of the vertices belonging solely to cluster C i or, if such a vertex does not exist, by adding the artificial vertex a i to the cluster C i (and to the vertex set V), with distances defined as follows.Let b i ̸ = a i an arbitrary vertex from C i , then we define c a i b i = 0 and c ja i = c jb i , c a i j = +∞ ∀j ∈ V\{a i , b i }.
In such a way, node a i can be freely be visited without increasing the length of the tour as soon as node b i is visited.Building on Figure 1, an example of the creation of an artificial representative vertex is provided in Figure 2, together with the sketch of a relative solution.
In the model, a binary variable x ij , with i, j ∈ V, takes value 1 if vertex i is visited right before vertex j in the solution tour, and value 0 otherwise.In case a vertex i ∈ C is not visited, then x ii is set to 1, and 0 otherwise.max ∑ i∈C p i ¬x r i r i (1) The objective function (1) maximizes the profit collected in the tour.Constraint (2) imposes that the tour associated with the active x variables forms a feasible circuit.This is imposed by the CP-SAT statement AddCircuit that also ensures that x ii = 1 for each variable i ∈ C not touched by the circuit itself.Constraint (3) is a budget constraint requiring that the length of the tour described by the active x variables has a length of, at most, T max .Constraints (4) use the AddImplication statement (here represented as =⇒) and impose that if a vertex of a cluster is not visited, then also the representative of the cluster cannot be visited.As a consequence, a representative vertex can be visited only if all the nodes of its cluster are visited.This is necessary in order not to overestimate the profit collected in the objective function.Constraints (5) finally define the domain of the variables.

Computational Experiments
After having introduced the benchmark set adopted in Section 4.1 and described the experimental settings in Section 4.2, in Section 4.3 we position the new model within the exact methods that have previously appeared in the literature.In Section 4.4, the new best-known results obtained by the model CP are detailed.

Benchmark Instances
The benchmark instances commonly adopted in the previous COP literature for the exact algorithms are those proposed in [13] and are available at [23].They are derived from the classic TSPLIB95 instances available at [24].The instances have a number of vertices ranging between 42 and 318 (as indicated in the names), and the following elements have been added and reflected into the names to make them suitable for the COP (on top of slightly modifying some of the distance matrices): • Clusters: the number of clusters (field s in the instance name) takes the value of 10, 15, 20, or 25; • Profits: the profit of a given vertex is generated in two alternative ways (g1 or g2 in the instance name) based either on the number of vertices in a cluster, or on a pseudo-random value, as explained in details in [13] • Threshold: two different values are considered for T max (q2 or q3 in the instance name), which are obtained by considering a fraction of the optimal value of the original TSPLIB95 problem from which the instance is derived, as described in [13].

Experimental Settings
In this section, we present the results obtained by solving the model we proposed in Section 3 via the CP-SAT solver [22] version 9.8 using standard settings on a computer running an Intel Core i7 12700F processor and equipped with 32 GB of RAM.A maximum computation time of 3600 is allowed for each run, and the solver is launched from scratch without any clue about bounds previously calculated.Notice that we decided to leave out all the preprocessing rules described in [18] when solving the model described in Section 3. The reason is that the remaining rules were either not helping the solver or extremely time-consuming to calculate, and anyway, relying on previously calculated upper and lower bounds, which are normally not available in real applications, when a new instance is faced.
The results are compared with those obtained by all the other methods available in the literature that we are aware of.
The other exact methods we consider are as follows: • The mixed-integer linear program BASIC presented in [13], with experiments run on a computer with an Intel Xeon W3680 CPU and 12 GB of RAM, using CPLEX 12.2 [25] as a MILP solver.A maximum computation time of 3600 is allowed for each run; • The branch-and-cut algorithm COP-CLU presented in [13], with experiments run on a computer with an Intel Xeon W3680 CPU and 12 GB of RAM, using CPLEX 12.2 [25] as a MILP solver.A maximum computation time of 3600 is allowed for each run; • The branch-and-cut algorithm CUT-PLA presented in [18], with experiments run on a computer with an Intel Xeon(R) E2-2670 and 128 GB of RAM, using CPLEX 12.6 [25] as a MILP solver.A maximum computation time of 3600 is allowed for each run.
Unfortunately, for this method, only aggregated results are available.
Concerning heuristic approaches, we consider the following: • The three different tabu search methods COP-TS- * discussed in [13] with experiments run on a computer with an Intel Xeon W3680 CPU and 12 GB of RAM; • The hybrid heuristic HH approach discussed in [16] (see also [18]) with experiments run on a computer with an Intel Xeon X7542 CPU; • The hybrid evolutionary algorithm HEA presented in [17] with experiments run on a computer with an Intel Core i5-8400 CPU and 16 GB RAM.

Comparison with Exact Methods
A first comparison of the results obtained by the CP model compared to all the other exact solvers available in the literature, in terms of success and optimality gap, is presented in Table 2.For each of the exact methods considered, the results after one hour of computation are reported, covering for each class of instances the number of instances solved to optimality over the 16 ones in each group (# Opt); the average optimality gap (Gap %), calculated as 100(UB(m) − LB(m))/UB(m) where UB(m) and LB(m) are the upper and lower bounds retrieved by the generic method m at the end of the 3600 s; the average computation time (Sec).
Before commenting the results, some considerations have to be made.First, the different experiments are taken from different papers and made on different computers and using different solvers.These settings inevitably affect the comparison, but we believe the main conclusions remain valid independently of these (inevitable) perturbations.Moreover, no preprocessing rule is used by the methods BASIC, COP-CLU and CP, while an extremely time-consuming preprocessing phase is carried out before CUT-PLA.It involves the solution of multiple maximum clique problems [26], multiple smaller COPs, and relies on pre-calculated tight bounds for the original problem.Unfortunately, the time spent on these very time-consuming activities is not accounted for within the computation times reported.In our opinion, this gives the method CUT-PLA a clear advantage, turning the comparison against it biased.We report the results anyway for the sake of completeness.The aggregated results presented in Table 2 indicate that the new model CP is competitive with the state-of-the-art exact solvers discussed in the literature.In particular, the statistics indicate that the CP model is able to provide the smallest optimality gap of all the methods, notwithstanding it does not take advantage of the aggressive preprocessing run before the solver CUT-PLA.The latter has slightly better results in terms of the average number of instances solved to optimality, and shorter computation times, although the time of the heavy preprocessing run for CUT-PLA is not accounted for in these figures.The methods BASIC and COP-CLU appear to deliver worse performance, although the fact that for some groups of instances they are the best, indicate that a clear dominance among the approaches is not present.
In Figures 3 and 4, a graphical representation of the results of Table 2 is proposed, in terms of average optimality gaps and computation times.The instances are presented in a non-decreasing order of size, in order to allow considerations on the scalability for the different approaches.For this purpose, quadratic trend lines are also inserted in the charts.Figure 3 suggests that our proposal CP is the one scaling better among the methods, having a fairly flat curvature of the trend line.In detail, CP emerges as the most effective method on the larger instances, while CUT-PLA is superior on the small and medium ones-always keeping in mind the preprocessing advantage of the latter method mentioned before.The method COP-CLU presents the worst figures in terms of scaling.It is finally interesting to observe the presence of a cluster of hard instances, difficult to solve for all the methods considered, with a size around 150.
Figure 4 highlights that the approach CP we propose appears to have a similar trend to BASIC and COP-CLU in terms of average computation times, although with different spikes, sometimes worse, sometimes better, with a trend line worse than that of BASIC but better than that of COP-CLU.Although it is not possible to draw accurate conclusions about the method CUT-PLA due to the unknown time spent by the method in preprocessing, it appears to be the fastest of all, but with a degradation in performance associated with the larger instances that poses doubts on scalability, as highlighted by the least promising trend line of all.
The detailed results obtained by solving the model CP are available in Appendix A for future reference.

Improved Best-Known Results
In this section, we compare the results retrieved by CP with the best-known lower and upper bounds for the optimal costs available in the literature, and obtained by all the exact and heuristic methods listed in Section 4.2.The best lower bounds are mainly obtained by the tailored heuristic methods, while the upper bounds are exclusively made available by exact methods.In general, the new CP model was able to retrieve many improved upper bounds with respect to those reported in the previous literature, leading also to the first optimality proof for the solutions of several instances.In the following Table 3, we detail these new state-of-the-art bounds.In the table we indicate, for each instance affected by an improvement, the previous best-known lower and upper bounds, and the upper bounds obtained by the new model CP.In the column Opt, we finally mark (with ⋆) those instances for which an exact solution is documented for the first time in this study.According to the table, a total of 118 new improved lower bounds are presented, with optimality proven for the first time for 37 of the instances.For the sake of completeness, we report that for 27 of these 37 instances the model CP was able to close the instance, while for the remaining 10 optimality was inferred by comparing the new upper bounds with the lower bounds previously known.

Conclusions
In this work, we have considered the Clustered Orienteering Problem, an optimization problem faced in last-mile logistics.The aim is, given an available time window, to select the vertices to visit among a set of service requests in order to maximize the total profit collected.In particular, vertices belong to clusters, and the profits are associated to clusters, and the price relative to a cluster is collected only if all the vertices of such a cluster are visited.
We propose a constraint programming model for the problem and we empirically evaluate the potential of the new model by solving it with out-of-the-box software.The results indicate that, when compared to the exact methods currently available in the literature, the new approach proposed is dominant.Several improved upper bounds are provided in the study, and different instances are closed here for the first time.Overall, we provided an easy-to-implement tool providing well-optimized solutions, which, in turn, translates into a more sustainable logistics organization.
Future work should be in the direction of integrating the new model we propose with the high-performance heuristic methods available in order to enhance the quality of the lower bounds.Moreover, the approach should be extended to deal with the Team Orienteering version of the problem-where several vehicles operate together-and compared with the existing literature on these settings.Instance s (g, q) = (1, 2) (g, q) = (1, 3) (g, q) = (2, 2) (g, q) = (2,

Figure 1 .
Figure 1.Example of a (simplified) COP instance.The squared node 0 is the depot, while the other vertices are customers.Clusters are represented as coloured rectangles, with the associated profit depicted in a corner.Travel times are omitted for the sake of simplicity, together with the threshold T max .A tour with a total profit of 90 is drawn in black.

Figure 2 .
Figure 2. The example of Figure 1 with representative nodes (double framed) and the artificial node 11 added.The solution now goes through node 11.The new cost of the solution arcs incident to 11 is also depicted.

Figure 3 .
Figure 3. Average optimality gaps for the different exact methods for instances of increasing size. dantzig42

Figure 4 .
Figure 4. Average computation times for the different exact methods for instances of increasing size.

Table 1 .
Summary of the contributions of the publications dealing with the solving methods for the Clustered Orienteering Problem and its generalizations.

Table 2 .
Comparison against published exact methods-aggregated results.

Table 3 .
New best bounds and new optimality proofs.

Table A1 .
Detailed results retrieved by the new model.