Abstract
We consider a generalization of the selective traveling salesman problem (STSP) in which the benefit of visiting a location changes over time. This new problem, called the selective travelling salesman problem with timedependent profits (STSPTDP), is defined on a graph with timedependent profits associated with the vertices, and consists of determining a circuit of maximal total profit. In the STSPTDP the tour length must not exceed a maximum value, and its starting and ending times must both lie within a prespecified planning horizon. This problem arises in planning tourist itineraries, mailbox collection, military surveillance, and water sampling, where the traveler accumulates different profits upon visiting the locations throughout the day. We focus on analyzing several variants of the problem depending on the shape of the timedependent profit function. If this function is not monotonic, it may be worth visiting a site more than once. We propose formulations for the singlevisit case and for when multiple visits are allowed, in which case the problem reduces to an STSP, which is adapted to be solved as a longest path problem. These formulations are then solved for piecewiselinear profit functions using a generalpurpose solver, and tested on several artificially created instances and on four TSPLib instances involving up to 535 vertices. A detailed analysis of the problem and the solution is performed.
Introduction
In several contexts, a traveler holds a list of potential sites of interest, but it may not be possible nor desirable to visit all of them. Some sites will be selected and then visited by means of a single tour. With each solution is associated a profit derived from visiting the sites. One example of this setting occurs in the planning of tourist trips. An interesting application cited in Vansteenwegen et al. (2011) is the Mobile Tourist Guide of Souffriau et al. (2008). Similar tourist trip problems are mentioned by Wang et al. (2008); Schilde et al. (2009) , and da Silva et al. (2018) where the profit is measured in terms of the interest associated with visiting the sites. Another example arises in the collection of letters from mailboxes. Here the benefit can be measured by the mail volume accumulated in the mailbox at each visit. Other applications are encountered in the surveillance activities of submarines or unmanned aircraft (Wang et al. 2008), and in water sampling Zhang et al. (2020). A recent application arises in the context of a parking warden distributing fines for irregularly parked cars (Bruglieri (2020)), where the profit associated with an inspection depends on the time elapsed since the previous inspection.
This problem is known as the selective traveling salesman problem (STSP) Laporte and Martello (1990), sometimes called orienteering problem (Golden et al. 1987; Vansteenwegen et al. 2011), if the profits are timeindependent. However, there also exist several settings where the profits are timedependent. For example, the pleasure associated with a tourist attraction is often related to crowdiness and, therefore, to the time of the day. In postal applications it is clear that mail accumulation is timedependent. In military applications the profit associated with surveillance activities may vary over time. Hence, we study an extension of the STSP with timedependent profits (STSPTDP).
We assume that the problem is defined over a given time horizon and that the sites are to be visited by a single uncapacitated vehicle during a work shift whose length does not exceed that of the planning horizon. Waiting before starting the tour is allowed, i.e., the shift does not necessarily start at the beginning of the planning horizon. Each site has a time window and a service time, and it may be beneficial for the vehicle to wait along its route to let the profit increase at some sites, as is the case of the mail collection application. As we will describe, in some versions of the problem it may be beneficial to visit the same site more than once.
For reviews of the STSP the interested reader is referred to Feillet et al. (2005), Vansteenwegen et al. (2011), Archetti et al. (2014) and Gunawan et al. (2016). Of interest in the context of the STSPTDP is the survey of Gavalas et al. (2014) which presents a detailed description of the tourist trip design problem. These authors observe that this problem can be viewed as a bicriteria generalization of the TSP, i.e., maximizing the collected profit and minimizing the travel cost. Yu et al. (2019b) investigate the team orienteering problem with time windows and timedependent scores. In this work, each vertex is associated with a basic score and several recommendation factors that vary depending on the time of visit. The authors propose a mathematical formulation and a hybrid artificial bee colony algorithm to compute optimal solutions for small instances and nearoptimal solutions for larger instances.
There also exists a rich literature on several variants of the STSPTDP studied in this paper, which is summarized in Table 1 but, to the best of our knowledge, our variant is unique and we are the first to provide a formulation solved by means of an exact branchandcut algorithm capable of solving instances much larger than was previously achievable. In our version of the STSPTDP, the starting time of the route is also optimized within the planning horizon and waiting at the sites is allowed in order to arrive at a site when the profit to be collected is optimal. Here we introduce, model, and solve this problem exactly. We perform tests on artificial instances and on TSPLib instances, and we derive insights based on the problem characteristics and on the computational results.
The remainder of this paper is organized as follows. In Sect. 2, we formally describe the problem and a number of its variants, and we propose corresponding mathematical programming models. An analysis of some properties of the problem depending on the shape of the profit functions is presented in Sect. 3. This is followed by computational results in Sect. 4 and by conclusions in Sect. 5.
Formal definition and mathematical models
The STSPTDP is defined on a directed graph \({\mathcal {G}} = ({\mathcal {V}}, {\mathcal {A}})\), where \({\mathcal {V}}\) is the vertex set, \(0 \in {\mathcal {V}}\) is the depot and \({\mathcal {V}}' = \{1, \dots , n\}\) is the set of sites. The arc set is defined as \({\mathcal {A}} = \{(i,j): i,j \in {\mathcal {V}}, i \ne j\)}. A travel time \(\tau _{ij}\) is associated with each arc (i, j). The problem is defined over a planning horizon of length T, and time can be discretized into a set of moments \(t \in {\mathcal {T}} = \{1, \dots , T\}\). Each site i has an associated profit \(p_i(t)\) that depends on t. A solution is a closed circuit not exceeding L time units (\(L \le T\)), leaving the depot at time \(t_0^d\), returning to the depot at time \(t_0^a \le T\) and visiting a subset of the sites, where \(t_0^a t_0^d \le L\). The goal of the problem is to find a solution of maximal total profit for the selective traveling salesman problem with timedependent profits (STSPTDP). We assume that there are no vehicle capacity constraints and that one of the following two timedependent profits is considered:

1.
Profit is cumulative, i.e., the profit function is monotonically increasing. The later a vertex is visited, the higher is the collected profit. It follows that if a vertex is visited several times, one can achieve the total profit by performing only the last visit. An example of this setting is letter collection in mailboxes.

2.
Profit depends just on the time the vertex is visited. The profit function is not necessarily monotonically increasing. Then it may be beneficial to visit a vertex more than once. Examples include parking tickets, publicity delivery, or fund collection by humanitarian organizations.
It follows from the second profit function type that a site may be visited more than once, and in both cases imposing a waiting time between successive visits to the same site may be appropriate since the collected profit is the one observed upon arrival.
At most one visit per site allowed
We first model the case in which at most one visit to each site is allowed. The formulation we propose requires that the profit functions be linear or piecewise linear, with time as a dependent variable. In this case, a time discretization is not required.
We define variables \(x_{ij}\) equal to one if and only if arc \((i,j) \in {\mathcal {A}}\) is used in the solution, and variables \(t_i\) equal to the time at which vertex \(i \in {\mathcal {V}}'\) is visited. In what follows, M is a large positive number. The problem for the continuous singlevisit case (SF) is then formulated as follows:
subject to
The objective function (1) represents the total collected profit to be maximized. Constraints (2) are the flow conservation conditions and ensure that there is at most one incoming and one outgoing arc for each site. Constraint (3) ensures that there is one incoming and one outgoing arc for the depot. Constraint (4) imposes a maximal route duration of L (time units). Constraints (5)–(7) ensure that travel times are respected and eliminate subtours. Finally, constraints (8) and (9) define the domains of the variables.
Note that the case of “exactly one visit” is a particular case arising in the traveling salesman problem with timedependent profits (TSPTDP), and hence, its formulation is obtained by just changing “\(\le 1\)” with “\(= 1\)” in constraints (2).
We can impose the following bounds on the timing variables, which indicate that one cannot arrive at vertex i earlier than \(\tau _{0i}\):
A similar reasoning can be applied at the end of the planning horizon: one can compute the latest arrival time at vertex i such that one still arrives back at the depot at time T. The following upper bound on \(t_i\) can be imposed:
Multiple visits to sites allowed
There are two main ways to model problems in which multiple visits to the same site are allowed. Some models do not replicate the sites and allow multiple visits by controlling the number of times a site is visited (see, e.g., Bruck and Iori 2017; SalazarGonzález and SantosHernández 2015; Erdoğan and Laporte 2013, and Munari and Savelsbergh 2022). The other approach is to make several copies of the same site (see, e.g., Gribkovskaia et al. 2007 and Hoff et al. 2009). Here we adopt the second modeling technique. More specifically, we make use of an auxiliary twodimensional directed graph \(\overline{{\mathcal {G}}} = (\overline{{\mathcal {V}}}, \overline{{\mathcal {A}}})\) (see Fig. 1) whose xaxis represents the periods of the planning horizon and whose yaxis represents the sites and the depot. The graph \(\overline{{\mathcal {G}}}\) extends the graph \({\mathcal {G}} = ({\mathcal {V}}, {\mathcal {A}})\), so that for every vertex \({ v}\in {\mathcal {V}}\) and every period \(t\in {\mathcal {T}}\), there is one vertex \({ {\overline{v}}}\in \overline{{\mathcal {V}}}\) identified with the pair \((t, { v})\), which is labelled as \({ {\overline{v}}}=t\cdot {\mathcal {V}} + { v}\). It follows then that, for each given vertex \({ {\overline{v}}}\in \overline{{\mathcal {V}}}\) we can obtain the corresponding period t and site \({ v}\) in graph \({\mathcal {G}}\) as follows: \(t({ {\overline{v}}})=\lfloor {{ {\overline{v}}}/{\mathcal {V}}\rfloor }\) and \({ v}({ {\overline{v}}})={ {\overline{v}}}/{\mathcal {V}}  \lfloor {{ {\overline{v}}}/{\mathcal {V}}\rfloor }\). We denote by t(i) and v(i) the time \(t\in {\mathcal {T}}\) and the vertex \(v \in {\mathcal {V}}\) corresponding to the vertex \(i \in \overline{{\mathcal {V}}}\), respectively. Therefore, the profit function at vertex \({ {\overline{v}}}\) is \({\overline{p}}_{{ {\overline{v}}}}={ p_{{ v}}(t)}\). Note that not all arcs are allowed in \(\overline{{\mathcal {G}}}\) and that the starting and ending vertices must correspond to the depot. After predefining the set \(\overline{{\mathcal {A}}}\), we need to solve a selective TSP with profit on \(\overline{{\mathcal {G}}}\), with a maximum route length L no larger than the duration T of the planning horizon. We have then no predefined starting and ending vertices, but these must be selected within a subset \(\{ t\cdot {\mathcal {V}}: t=0, 1, ..., T \} \subset \overline{{\mathcal {V}}}\) representing the set of depot vertices (T copies of the depot). The set of site vertices is \(\overline{{\mathcal {V}}}' = \overline{{\mathcal {V}}} \setminus \{ t\cdot {\mathcal {V}}: t=0, 1, ..., T \}\).
The set of available arcs \(\overline{{\mathcal {A}}}\) is composed of the set \(\overline{{\mathcal {A}}_1}\) of arcs linking vertices from the same site at consecutive periods (for waiting times), and the set \(\overline{{\mathcal {A}}_2}\) of arcs linking vertices from different sites and whose difference between their periods equals the travel time between these sites. Therefore,
and \(\overline{{\mathcal {A}}} = \overline{{\mathcal {A}}_1} \cup \overline{{\mathcal {A}}_2}= \{(i, j) \, \,\big (({ v}(i)={ v}(j)) \wedge (t(j){ =t(i)+1})\big )\)\(\vee \big (({ v}(i)\ne { v}(j)) \wedge (t(j)t(i) = { \tau _{ij}})\big ) \}.\)
Note that Fig. 1 shows a representation of the horizontal arcs from the set \(\overline{{\mathcal {A}}_1}\) and a partial representation of the set \(\overline{{\mathcal {A}}_2}\) (dashed arcs). For the sake of clarity, from the latter we only represent arcs departing from the depot.
Note that if \(L=T\), the problem over \(\overline{{\mathcal {G}}}\) is very similar to the STSP with profits (see Laporte and Martello 1990 and Vansteenwegen et al. 2011). In the extended graph \(\overline{{\mathcal {G}}} = (\overline{{\mathcal {V}}}, \overline{{\mathcal {A}}})\), the problem is similar to the STSP, where we have a set of \(\overline{{\mathcal {V}}} = N\cdot (T+1)1\) vertices, each with an associated profit.
The difference between our problem in the auxiliary graph and the STSP is that, in our case, the starting and end vertices are not fixed, but belong to the set of depot vertices with zero profit. In order to obtain the STSP, we add two artificial vertices \({ B_1}\) and \({ B_2}\), which will be the starting and ending vertices of the Hamiltonian path, respectively. Accordingly, a set of zero length arcs joining \({ B_1}\) and the depot vertices and the latter with \({ B_2}\) is also added. So, from now on, the problem is defined on \({\hat{G}}=({\hat{V}}, \hat{{\mathcal {A}}})\), where \({\hat{V}}=\overline{{\mathcal {V}}} \cup \{{ B_1}, { B_2}\}\) and \(\hat{{\mathcal {A}}}=\overline{{\mathcal {A}}} \cup \{(i,{ B_2}) i\in \overline{{\mathcal {V}}} \setminus \overline{{\mathcal {V}}}' \} \cup \{({ B_1},i) i\in \overline{{\mathcal {V}}} \setminus \overline{{\mathcal {V}}}' \}\).
We use directed continuous variables \(y_{ij}\) representing the flow over arc (i, j) and binary variables \(\gamma _i\) equal one if the shift starts at vertex \(i \in \{0, ..., TL\}\). Note that the graph \({\hat{G}}\) is a timeordered graph, which enables us (for fixed depot departure and arrival times \(t_0^d\) and \(t_0^a\), being \(t^a_0  t^d_0=L\)) to model the problem as a longest path problem. In doing so, we transfer the profit associated with a vertex j to its incoming arcs in \(\overline{{\mathcal {A}}_2}\). That is, each arc \((i, j) \in \overline{{\mathcal {A}}_2}\) has an associated profit \({\overline{p}}_{ij}={\overline{p}}_{j}\). The profit associated with the remaining arcs in \(\hat{{\mathcal {A}}}\) equals zero. The problem for the discretized multiplevisit case (MF) over \({\hat{G}}\) is formulated as follows:
subject to
The objective function (12) is the total collected profit. Recall that the profit is collected when the vehicle arrives at the vertex. Constraints (13), where \(\delta ^+(i)\) and \(\delta ^(i)\) are the sets of successors and predecessors of vertex i in graph \({\hat{G}}\), respectively, ensure that exactly one arc departs from the artificial vertex A to the set of depot vertices, that one unit of flow arrives at B from the same set, and enforce the flow conservation conditions for the remaining vertices, which are the site vertices. Constraints (14) and (15) impose a maximal route duration by means of the \(\gamma\) variables. There are as many \(\gamma _{y_L}\) variables as \(TL\) time periods. By selecting only one of the \(\gamma _{y_L}\) variables, constraints (16) ensure that the route starts at one time instant and ends after exactly L periods. Finally, constraints (17) and (18) impose the binary condition of the \(\gamma\) variables and the nonnegativity condition of the y variables, respectively.
Analysis of the problem and shapes of the profit function
As explained in Sect. 2, depending on the shape of the profit function, the problem possesses certain characteristics. These will not only be influenced by the monotonicity condition of the profit functions, but also by their specific shape.
Observation 1. Let \(p_i: {\mathcal {T}}\rightarrow {\mathbb {R}}\) represent the accumulated profit at vertex \(i\in {\mathcal {V}}'\) arising from a positive noncumulative profit function \(p^\prime _i: {\mathcal {T}}\rightarrow {\mathbb {R}}^+\), that is, the accumulated profit at vertex i during the time interval [0, t] is calculated as \(p_i(t)=\int _0^{t} p^\prime _i (t) dt\). Then, \(p_i\) is a monotonically increasing function and the total profit collected visiting vertices i at time \(t_1\) and \(t_2\in {\mathcal {T}}\) (\(t_1<t_2\)) equals the profit collected by visiting vertices i only once at time \(t_2\).
Proof
If vertex \(i\in {\mathcal {V}}'\) is visited at time units \(t_1\) and \(t_2 \in {\mathcal {T}}\), the total collected profit equals \(\int _0^{t_1} p^\prime _i { (t)} dt+\int _{t_1}^{t_2} p^\prime _i { (t)} dt=\int _{0}^{t_2} p^\prime _i { (t)} dt\).
If vertex \({\mathcal {V}}'\) is visited only once at time unit \(t_2\), the total collected profit equals \(p_i(t_2)=\int _{0}^{t_2} p^\prime _i { (t)} dt\). \(\square\)
Observation 2. If \(p_i(t)=\alpha _i\) for all \(i \in {\mathcal {V}}'\), \(\alpha { _i} \ge 0\), then the STSPTDP when at most one visit per site is allowed obviously becomes the STSP. In this case, it does not matter whether \(L = T\) or \(L < T\) since the collected profit is not time dependent.
Observation 3. Let us assume that L is large enough to visit all vertices in any order and that each site can be visited at most once (following formulation (SF) presented in Sect. 2.1). If all profit functions are linear, i.e., \(p_i(t)=\alpha _i t\) for all \(i \in {\mathcal {V}}'\), \(\alpha _i \ge 0\), \(\alpha _i \le \alpha _{i+1}\), and \(\tau _{0,i} \ge \tau _{0,i+1}\) for all \(i \in {\mathcal {V}}' \setminus \{N\}\), then \(x_{i, i+1} =1\) for all \(i \in {\mathcal {V}}' \setminus \{N, N1\}\) and \(x_{N0}=1\). \(x_{i, j} =0\) for all \(j \ne i+1\), \(i \in {\mathcal {V}}' \setminus \{N, N1\}\). That is, under the described conditions, if the vertices are labeled in increasing order with respect to the slope (\(\alpha _i \le \alpha _{i+1}\)), the visiting order coincides with the labeling order.
Proof
Given two vertices i and \(i+1 \in {\mathcal {V}}'\) satisfying the above mentioned conditions, it is always beneficial to first visit the one with the lower slope (in this case i since \(\alpha _i\le \alpha _{i+1}\)).
Let p(i, j, t) be the profit collected at vertices i and j if vertex i is visited at time t and vertex j at time \(t+{ \tau _{ij}}\). Then, starting from vertex 0, the collected profit obtained by visiting first vertex i and then vertex \(i+1\) is \(p(i, i+1, \tau _{0,i})=\alpha _i \tau _{0,i} + \alpha _{i+1} (\tau _{0,i}+\tau _{i, i+1})\). The collected profit if vertex \(i+1\) is visited before vertex i is \(p(i+1, i, \tau _{0,i+1})=\alpha _{i+1} \tau _{0,i+1} + \alpha _i (\tau _{0,i+1}+\tau _{i+1, i})\).
Let us demonstrate that the collected profit is larger if vertex i is visited before vertex \(i+1\), that is, \(p(i, i+1, \tau _{0,i})\ge p(i+1, i, \tau _{0,i+1})\):
By reductio ad absurdum, if \(p(i, i+1, \tau _{0,i}) < p(i+1, i, \tau _{0,i+1})\), then
Since \(\tau _{i+1, i}=\tau _{i, i+1}\), the inequality can be written as follows:
which is not respected given that \(\tau _{i, i+1}\), \(\alpha _{i+1}\alpha _i\), and \(\alpha _{i+1}+\alpha _i\) are positive values and \(\tau _{0,i+1}\tau _{0,i}\le 0\). Therefore, the lefthand side of the inequality is positive and the righthand side is negative. \(\square\)
Observation 4. The STSPTDP can be viewed as a generalization of the STSP with time windows by setting the profit function as a stepwise function equal to a negative number outside the time window, and equal to a positive constant during the time window interval. That is, if
for all \(i \in {\mathcal {V}}'\), \(\alpha _i \ge 0\), \(\beta \ge 0\), then the STSPTDP becomes the STSP with time windows \([a_i, b_i]\) for all \(i \in {\mathcal {V}}'\). Vertex i would not be visited outside the time window since this yields a negative profit and a corresponding decrease of the objective function (total collected profit).
Observation 5. A new problem called the STSPTDP with time windows, \([a_i, b_i]\) for all \(i \in {\mathcal {V}}'\), can be considered if the profit function has the following shape:
for all \(i \in {\mathcal {V}}'\), \(\beta \ge \alpha _i \ge 0\), with \(f_i(t) \ge 0\) being the profit function associated with each vertex \(i \in {\mathcal {V}}'\) during the time interval \([a_i, b_i]\) in which the vertex may be visited. Since the objective function is to maximize the total collected profit, negative values of this profit outside its time window \([a_i, b_i]\) ensure that vertex \(i \in {\mathcal {V}}'\) will not be visited outside the time window.
Note that Observations 4 and 5 may apply for both the single and multiplevisit cases.
Computational results
When the profit functions are linear or piecewise linear functions of time, the formulation (SF) presented in Sect. 2.1 can be directly applied and there is no need to discretize the time. In the following, we perform two main types of experiments to provide insights into the models: first for artificially created instances defined on a mesh network, and second for benchmark instances from the TSPLib, assigning timedependent profits to each vertex. These experiments were performed on a machine equipped with an Intel i78700 3.20GHz CPU. The model of Sect. 2.1 was implemented in Python 3.8 and solved with Gurobi version 9.1.
Mesh instances
The first set of experiments is designed to illustrate the behavior of the models when changing the maximum length of routes L and the duration of the planning horizon T, as well as to assess the solver’s performance for different instance sizes. We have considered three instances sizes of 15, 30, and 50 vertices. In all the experiments, the network is constructed following a concentric clockwise labelling procedure, starting from vertex number 1, which acts as the depot and increasing the vertex number consecutively (see Fig. 2 for an illustration of the 15vertex network). The horizontal and vertical distances between vertices are set to 1 and the arcs travel times have been obtained considering a travel speed equal to a tenth of the total distance needed to visit in order all the vertices, plus the Euclidean distance from the last vertex to the depot, ensuring there is no time to visit all vertices in any of the considered instances.
With respect to the piecewise linear profit functions, for each vertex we consider a noncumulative onepeak profit function with the following shape (see Fig. 3):
where \(a_i \ge 0\), \(b_i \le 0\), and \(t_i^*\) are parameters associated to each vertex \(i \in {\mathcal {V}}'\). Regarding the shape of the profit function, we have divided the first set of experiments into two subsets. The first one (experiments 1 to 15) considers values of \(t_i^*\) following an increasing vertex label order, i.e. the peak of the profit function of each vertex is proportional to the vertex number. Specifically, \(t_i^* = 480/n \times (i1)\), where n represents the number of vertices of each instance. Moreover, the slopes of the profit function (\(a_i\), \(b_i\)) are also proportional to the vertex index: specifically \(a_i=3 \times (i  1)\) and \(b_i= 3 \times (i  1)\). The second subset of experiments (experiments 16 to 30) considers values of \(t_i^*\) following a decreasing order with the index of the vertex, i.e., \(t_i^*= 480/n \times (n(i1))\).
With these artificially created instances we can test the behavior and performance of the solver on the models. For the first subset of experiments, depending on the values of L and T, since the profit peaks increase with the vertex order it is expected that the optimal routes for the singlevisit case will follow a clockwise direction. Alternatively, for the second subset, the optimal routes for the singlevisit case should follow a counterclockwise direction. For each subset and for each size (15, 30 and 50 vertices), five experiments were carried out, considering \(L=240, \ 480\) and \(T=240,\ 480\) and 1440 (which produces the next five combinations \(240240, \ 240480, \ 2401440, \ 480480, \ 4801440\)). The maximum computation time was fixed to \(60 \times n\) seconds.
Tables 2 and 3 show the results for the mesh shape instances considering the singlevisit (Formulation (SF)) and the multiplevisit (Formulation (MF)) cases, respectively . The table headings are defined as follows:

Exp. #: experiment number.

\({\mathcal {V}}\): the size of the instance.

L: maximum length of the route.

T: planning horizon.

Profit: total profit obtained, which is the objective function value.

\(t^d_0\): departure time from the depot.

Gap (%): optimality gap calculated as \(\frac{UB  LB}{UB} \cdot 100\), where LB and \(UB=\text {(profit)}\) are the best known lower and upper bounds.

#Vertices visited: number of visited vertices in the solution.

Time: computation time in seconds.

Max. time: maximum allowed computation time in seconds.
All instances are solved using the standard truncated branchandcut algorithm implemented in Gurobi, truncated after a predefined CPU time limit "Max. time”. As expected, the collected profit is higher for the multiplevisit case and, for both the single and multiplevisit cases, the collected profit increases with L and T. Moreover, for a given value of L the profit tends to increase with T. Note that all the instances are selective and that, for each instance and fixed values of T, the number of visited vertices in the singlevisit case tends to increase with L.
Figures 4 and 5 depict the resulting selective routes for each of the 30 vertices instances of Table 2. Observe that in Fig. 4, since the profit peak vertices are disposed in increasing order, not all vertices can be visited and the visited ones are those with larger indices, i.e., larger profits. The visiting order follows a clockwise direction, except for some instances for which the optimal solution is not achieved within Max. time. The behavior in experiments 21 to 25, where profit peaks follow a decreasing order, is the opposite. In these experiments, the numbers over the vertices correspond to the profit collected and the visit time. As illustrated, regardless of the instance size, the higher the ratio T/L, the higher is the collected profit. When T is larger than L, the model can move the starting time of the route (column \(t_0^d\) in Table 2). Note that for the cases where \({ T} = L\) (240–240, 480–480), the departure from the depot occurs at time \(t = 0.00\), thus using the full route length to visit as many vertices as possible, arriving again to the depot at time \(t = L\). In general, for a given size of the instance, the number of visited vertices tends to increase with \({ T}\), but this is not always true. See, for instance, experiments 1, 2, and 3, with \(L = 240\): although the collected profit increases, the number of visited vertices decreases. Since the model can freely move the route duration interval along the planning horizon, a higher profit can be collected visiting fewer but more profitable vertices. This behavior can also be observed for experiments 4–5, 9–10, and 11–13 in the case of peak profits following an increasing order with time. Similarly, in the opposite order of profit peaks, experiments 19–20, 24–25, and 29–30 exhibit this decrease in the number of visited vertices. Graphical representations of the remaining instances (with 15 and 50 vertices) are provided in the Appendix.
As an illustration of the problem with time windows described in Sect. 3, we consider the 15 vertices mesh instances described above but whose vertices have negative profit function values outside predefined time windows. We have considered piecewise linear profit functions similar to those illustrated in Fig. 3, but with time windows around the profit function peaks (see Fig. 6). Table 4 shows the results obtained for the multiplevisit case. It can be observed that, as commented in Observations 4 and 5, the vertices that are visited are indeed visited within their corresponding time window. Recall that, for these experiments, the time windows do not need to be added to the formulation, but they are naturally respected by assigning negative profit function values outside their bounds.
TSPLib instances
In this section, we consider different TSTLib instances adapted to the characteristics of our problem, that is, assigning onepeak timedependent profit functions see Eq. (19) to vertices and considering different space measure scales.
Assuming that the TSPLib coordinates are given in km, we consider constant speed and different scales to study the problem resolution. In this way, e.g., a scale of 1/1000 means that the coordinates are taken in meters. Tables 5 and 6 illustrate the sensitivity of the single and multiplevisit models, respectively, to different scales for instance eil51 and the following parameter values: \(L=480\), \(T=1440\), \(\text {speed}=35.5\) km/h. The CPU time limit has been set as Max. time=7200 seconds for these experiments. The table headings are defined as follows:

Scale: different values are considered to rescale the instance eil51. Scale 1 indicates that distance is taken in kilometers and 1/1000 in meters.

Profit: total profit obtained, which is the objective function value.

Total distance: total traveled distance in the corresponding scale measure.

Total distance (km): total traveled distance in km.

Time: computation time in seconds.

Gap (%): optimality gap calculated as \(\frac{UB  LB}{UB} \cdot 100\).

\(t^d_0\): departure time from the depot.

#Vertices visited: number of visited vertices in the solution.
Since we consider a constant speed, the smaller the scale, the smaller the distances and, therefore, the more time is available to visit the vertices. It can be observed that this effect influences the resulting solutions, mostly in terms of total collected profit and computation time. Observe that, for the singlevisit case (Table 5), the higher the scale, the smaller the total profit obtained and the larger the computing times, being even not possible to obtain a feasible solution within the CPU time limit Max. time=7200 for scale 1/1. The starting time of the shift also changes with the scale, tending to start earlier when the scale is smaller. This is due to the fact that the considered speed is constant and, therefore, the smaller the scale, the larger the freedom to visit the vertices. Table 6, which shows the results obtained for the multiplevisit case, exhibits a similar behavior in terms of the objective function. Although, as expected, much higher values of the objective function are obtained for the multiplevisit case, these values also increase as the scale decreases. However, with respect to the computing times, for the multiplevisit case, the behavior of the computing times is not uniform. In this case, different scales lead to different travel times and, therefore, different arc set \(\overline{{\mathcal {A}}_2}\). Since the model allows to wait at the same site, shorter travel times enable to arrive with more flexibility at a site, thus leading to equal or better profits but not necessarily better computing times.
Table 7 presents the results obtained for the single and multiplevisit cases for TSPLib instances eil51, st70, a280, and ali535. For these experiments, the maximum length of the route \(L=480\), the planning horizon \(T=1440\), the threshold on the computing time is Max. time = 7200 s and the scale is 1/1000, which is equivalent to considering the original coordinates in meters instead of in kilometers. The table headings are defined as follows:

TSPLib instance: indicates the name of the benchmark instances.

Profit: the total profit obtained, which is the objective function value.

Gap (%): optimality gap calculated as \(\frac{UB  LB}{UB} \cdot 100\).

#Vertices visited: number of visited vertices in the solution.

Time: computation time in seconds.

Total distance: total traveled distance in meters (corresponding to scale 1/1000).

\(t^d_0\): departure time from the depot.
As expected, for both cases, the larger the number of vertices, the larger the total collected profit and the computation time. For the multiplevisit case, only instances eil51 and st70 could be solved to optimality within Max. time. For these instances, although the number of visited nodes in the multiplevisit case is considerably lower than for the singlevisit case, these nodes are visited several times obtaining more than ten times higher values of the objective function (collected profit). Figure 7 illustrates the resulting routes with Formulation (SF) for the instances presented in Table 7. Since the problem aims at maximizing the total collected profit, the resulting routes differ significantly from those obtained with the usual TSP, where the objective is to minimize the total distance traveled.
As expected, when the objective function is to maximize the total collected profit, the total distance increases with respect to that obtained from a TSP solution. A tradeoff analysis between the collected profit and the total distance may shed some light on these differences. To this end, it becomes appropriate to use a multiobjective approach.
Tradeoff between the collected profit and the total distance. Multiobjective approach
Starting from formulation (SF), we consider the \(\epsilon\)constraints method proposed by Marglin (1967). That is, we include constraint (20) limiting the total distance of the route to a maximum of \(\epsilon\) and the route is then obtained by maximizing the total collected profit and varying parametrically the maximum total distance \(\epsilon\):
Table 8 represents the results obtained by the \(\epsilon\)constraints method for the TSPLib instance eil51 and the following parameter values: \(L=480\), \(T=1440\), \(\text {speed}=35.5 \text {km/h}\), \(\text {scale}=1/10\). The table headings are defined as follows:

Threshold \(\epsilon\): threshold on the route total distance.

Profit: total profit obtained, which is the objective function value.

Total distance: total traveled distance in hectometers (corresponding to scale 1/10).

Time: computation time in seconds.

Gap (%): optimality gap calculated as \(\frac{UB  LB}{UB} \cdot 100\).
Observe that, except for the first four rows, the value of the total distance tends to be similar to that of the upper threshold \(\epsilon\). This follows from the fact that the larger the total distance, the less constrained is the problem and, therefore, the larger is the total collected profit, which is the objective function. The first four rows stand for values of \(\epsilon\) larger than 131.35, which is the total collected profit when no constraints on the total distance are imposed (see Table 5, third row). This explains the constant values for the first four rows of the third column.
The first and second columns of Table 8 are represented in Figure 8 in the form of a Pareto curve for a tradeoff between collected profit and maximum total distance. It can be observed that, as expected, the total collected profit increases as the threshold on the total distance increases. However, the profit stabilizes when the threshold \(\epsilon\) reaches 130. In fact, if no threshold is imposed and only the total collected profit is maximized, then the resulting total collected distance equals 131.35. Therefore, for \(\epsilon\) values larger than 131.35, the total collected profit remains constant.
The routes associated with some of the solutions of Table 8 are depicted in Figure 9. As \(\epsilon\) decreases, the route length decreases and tends to look like a usual TSP solution, in which the total distance is minimized and profit is not considered.
Conclusions
We have introduced, modeled, and solved the STSPTDT. The STSPTDT is a generalization of other wellknown variants of the traveling salesman problems such as the TSP itself, the STSP, as well as the TSP and the STSP with time windows. Some interesting properties arise in the context of timedependent profits. For example, it sometimes makes sense to visit the same vertex multiple times and to optimize the starting time of the tour. We have proposed and tested a formulation of the singlevisit problem that can be used if the profit functions are linear or piecewise linear.
We have also proposed and tested an extended formulation for the case when multiple visits to the same vertex are allowed and desirable. In this case, we formulate the problem by means of an extended graph so that this variant reduces to an STSP, adapted to be solved as a longest path problem.
We have analyzed the problem by studying the shape of the timedependent profit functions. We have also performed several experiments on artificially created instances and on some TSPLib instances considering the single and multiplevisit cases. Our results on artificially created instances validate the model performance and highlight the importance of allowing a variable starting time of the route. We have considered several scale measures and optimally solved instances containing up to 535 vertices for the singlevisit case. We have also compared the results obtained for the single and multiplevisit cases and analyzed the results of our singlevisit case experiments by means of a Pareto frontier representing the tradeoff between the collected profit and the total distance traveled. We observe that these objectives are naturally opposed to one another.
References
Afsar H, Labadie N (2013) Team orienteering problem with decreasing profits. Electronic Notes in Discrete Mathematics 41:285–293
Archetti C, Speranza MG, Vigo D (2014) Vehicle routing problems with profits. In: Toth P, Vigo D (eds) Vehicle routing: problems, methods, and applications, monographs on discrete mathematics and applications, vol 18. MOSSIAM Series on Optimization, Philadelphia, pp 87–116
Bruck BP, Iori M (2017) Nonelementary formulations for single vehicle routing problems with pickups and deliveries. Operat Res 65(6):1597–614
Bruglieri M (2020) The parking warden tour problem. Networks 76:539–554
da Silva AA, Morabito R, Pureza V (2018) Optimization approaches to support the planning and analysis of travel itineraries. Expert Syst Appl 112:321–330
Erdoğan G, Laporte G (2013) The orienteering problem with variable profits. Networks 61(2):104–116
Erkut E, Zhang J (1996) The maximum collection problem with timedependent rewards. Naval Res Logist 43(5):749–763
Feillet D, Dejax P, Gendreau M (2005) Traveling salesman problems with profits. Transp Sci 39(2):188–205
Gavalas D, Konstantopoulos C, Mastakas K, Pantziou G (2014) A survey on algorithmic approaches for solving tourist trip design problems. J Heuristics 20(3):291–328
Golden BL, Levy L, Vohra R (1987) The orienteering problem. Naval Res Logist 34:307–318
Gribkovskaia I, Halskau Ø, Laporte G, Vlček M (2007) General solutions to the single vehicle routing problem with pickups and deliveries. Eur J Operat Res 180(2):568–584
Gunawan A, Lau HC, Vansteenwegen P (2016) Orienteering problem: a survey of recent variants, solution approaches and applications. Eur J Operat Res 255:315–332
Hoff A, Gribkovskaia I, Laporte G, Løkketangen A (2009) Lasso solution strategies for the vehicle routing problem with pickups and deliveries. Eur J Operat Res 192(3):755–766
Laporte G, Martello S (1990) The selective travelling salesman problem. Discrete Appl Math 26(2–3):193–207
Marglin SA (1967) Public investment criteria. Studies in the Economic Development of India 4, George Allen & Unwin, London
Munari P, Savelsbergh MWP (2022) Compact formulations for split delivery routing problems. Transp Sci. https://doi.org/10.1287/trsc.2021.1106
SalazarGonzález JJ, SantosHernández B (2015) The splitdemand onecommodity pickupanddelivery travelling salesman problem. Transp Res Part B: Method 75:58–73
Schilde M, Doerner KF, Hartl RF, Kiechle G (2009) Metaheuristics for the biobjective orienteering problem. Swarm Intell 3(3):179–201
Souffriau W, Vansteenwegen P, Vertommen J, Vanden Berghe G, Van Oudheusden D (2008) A personalized tourist trip design algorithm for mobile tourist guides. Appl Artif Intell 22(10):964–985
Vansteenwegen P, Souffriau W, Van Oudheusden D (2011) The orienteering problem: a survey. Eur J Operat Res 209(1):1–10
Wang X, Golden BL, Wasil EA (2008) Using a genetic algorithm to solve the generalized orienteering problem. In: Golden BL, Raghavan S, Wasil EA (eds) The vehicle routing problem: latest advances and new challenges. Springer, New York, pp 263–274
Yu Q, Fang K, Zhu N, Ma S (2019) A matheuristic approach to the orienteering problem with service time dependent profits. Eur J Operat Res 273(2):488–503
Yu Q, Adulyasak Y, Rousseau LM, Zhu N, Ma S (2021) Team orienteering with timevarying profit. INFORMS J Comput. https://doi.org/10.1287/ijoc.2020.1026
Yu VF, Jewpanya P, Lin S, Redi A (2019) Team orienteering problem with time windows and timedependent scores. Comput Industr Eng 127:213–224
Zhang W, Wang K, Wang S, Laporte G (2020) Clustered coverage orienteering problem of unmanned surface vehicles for water sampling. Naval Res Logist 67(5):353–367
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
This work was partly supported by the Canadian Natural Sciences and Engineering Research Council (NSERC) under grants 201900094 and 201506189, by the Ministry of Science, Innovation and Universities of Spain, the European Regional Development Fund (ERDF) and Junta de Andalucía, FEDERUPO Research & Development Call under grants PID2019104263RBC41, PID2019106205GBI00, US1381656 and UPO1263769. This support is gratefully acknowledged. Thanks are due to the editors and to the referees for their valuable comments.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Barrena, E., Canca, D., Coelho, L.C. et al. Analysis of the selective traveling salesman problem with timedependent profits. TOP (2022). https://doi.org/10.1007/s11750022006326
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s11750022006326
Keywords
 Selective traveling salesman problem
 Timedependent profits
 Multiple visits
Mathematics Subject Classifications
 90B06
 90C10
 90C05
 90C27