Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem

14
1 / 14 Smart-CT 2016, Málaga, Spain, 15-17 July, 2016 Motivation Taxi-sharing MILP Formulation Experiments Conclusions & Future Work Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem Houssem E. Ben-Smida, Saoussen Krichen, Francisco Chicano, Enrique Alba

Transcript of Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem

Page 1: Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem

1 / 14Smart-CT 2016, Málaga, Spain, 15-17 July, 2016

Motivation Taxi-sharing MILP Formulation Experiments Conclusions

& Future Work

Mixed Integer Linear ProgrammingFormulation for the Taxi Sharing Problem

Houssem E. Ben-Smida, Saoussen Krichen, Francisco Chicano, Enrique Alba

Page 2: Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem

2 / 14Smart-CT 2016, Málaga, Spain, 15-17 July, 2016

Motivation Taxi-sharing MILP Formulation Experiments Conclusions

& Future Work

Motivation• One of the goals of Smart Cities is to increase efficiency in the use of

resources

• Translated to Smart Mobility, efficiency generate benefits botheconomically and ecologically

Page 3: Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem

3 / 14Smart-CT 2016, Málaga, Spain, 15-17 July, 2016

Motivation Taxi-sharing MILP Formulation Experiments Conclusions

& Future Work

Motivation• Shared trips is a way to improve mobility resources

• Several people share the transport (public or private vehicle)• Some proposals are:

• Lanes for cars with two or more passengers• Campaigns to share the car to/from the workplace

• Applications to find travelign companions• BlaBlaCar or Carma

• What about taxis?

• They rarely travel full• Impact in pollution and economy of users

• Solution: Taxi-sharing

Page 4: Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem

4 / 14Smart-CT 2016, Málaga, Spain, 15-17 July, 2016

Motivation Taxi-sharing MILP Formulation Experiments Conclusions

& Future Work

Taxi-sharingComplete graph (edges

omitted for clarity)

cij

monetary cost of travelingbetween two locations

Maximum capacity: kMinimum fare: b

Mixed Integer Linear Programming Formulation 3

In the following we will present the mathematical formulation of the problem.Let P = {p1, p2, ..., pn} be a set of n passengers that are in the same locationd0. Let us denote with di the location where passenger pi wants to go. Let usassume that the maximum capacity of the available taxis is k (usually 4 people)and let us denote with b the minimum fare to pay in each trip regardless thedistance traveled. The cost to travel from point di to dj will be given by thematrix element cij of a cost matrix.

A solution to the problem is a set of m sequences of locations {s1, s2, . . . , sm}such that every destination di with i ≥ 1 appears exactly in one sequence (andno more than one), and the origin d0 is the first location in all the sequences.Each sequence of locations represents a taxi ride, where the destinations in thesequence are visited in the order they appear. The length of each sequence sl

will be k +1 at most, since k is the maximum capacity of the taxis and d0 is thefirst location in all the sequences. The total cost of a solution is given by:

cost({s1, s2, . . . , sm}) =m∑

l=1

⎝b +∑

(di,dj)∈sl

cij

⎠ , (1)

where we use (di, dj) ∈ sl to iterate over all the pairs of destinations that areadjacent in the sequence sl.

The objective of the problem is to find a solution that minimizes the costfunction defined in (1). This formulation does not provide a mechanism to dis-tribute the cost associated with travel passengers who share a taxi and it isassumed that the decision is delegated to users. Some ideas to do this distribu-tion of costs can be found in [18].

This formulation of the Taxi Sharing problem is NP-hard. We can prove thisby transforming the Hamiltonian Path Problem into Taxi Sharing. The versionof the Hamiltonian Path Problem we need is one in which the starting vertexv ∈ V is given. Formally, this variant of the Hamiltonian Path Problem consistsin finding a Hamiltonian path (visiting all the nodes exactly once) in a graphG(V,E) starting in the vertex v. This variant is NP-hard, since we can usethe same transformation from Vertex Cover to the Hamiltonian Path Problemprovided in [10].

The transformation from Hamiltonian Path to Taxi Sharing is as follows.Given the graph G = (V,E) where the Hamiltonian Path has to be found, webuild a complete graph G′ = (V ′, E′) where all the nodes in G are also in G′:V ′ = V . The starting vertex v ∈ V is d0 in Taxi Sharing, the location wherethe passengers are picked up. G′ is a complete graph, thus, E′ = V ′ × V ′ andthe weight of an edge e ∈ E′ is 1 if the edge is also in E and 2 if it is not in E.Finally, the minimum fare is the sum of all the weights in the complete graphand the capacity of the taxis is the same as the number of vertices in the graphminus one. These last requirements ensures that the optimal solution will haveonly one taxi. If the cost of the optimal solution is the minimum fare plus thenumber of vertices minus one, there is a Hamiltonian Path starting at vertexv ∈ V . Otherwise, no such path exists.

Au

tho

r P

roo

f

Origin

Destinations

Definition Link to CVRP

Page 5: Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem

5 / 14Smart-CT 2016, Málaga, Spain, 15-17 July, 2016

Motivation Taxi-sharing MILP Formulation Experiments Conclusions

& Future Work

Taxi-sharing: link to CVRPDefinition Link to CVRP

• The problem has some commonalities with Capacitated Vehicle RoutingProblem…

• … and also some differences:• Vehicles return to the depot• There is no “minimum fare”

• Destinations are all different

Depot(origin)

Vehicles (taxis)Customers

(destinations)

Maximum capacity: k

Page 6: Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem

6 / 14Smart-CT 2016, Málaga, Spain, 15-17 July, 2016

Motivation Taxi-sharing MILP Formulation Experiments Conclusions

& Future Work

Taxi-sharing: link to CVRP

Complete graph (edgesomitted for clarity)

cij

monetary cost of travelingbetween two locations

Maximum capacity: kMinimum fare: b

Mixed Integer Linear Programming Formulation 3

In the following we will present the mathematical formulation of the problem.Let P = {p1, p2, ..., pn} be a set of n passengers that are in the same locationd0. Let us denote with di the location where passenger pi wants to go. Let usassume that the maximum capacity of the available taxis is k (usually 4 people)and let us denote with b the minimum fare to pay in each trip regardless thedistance traveled. The cost to travel from point di to dj will be given by thematrix element cij of a cost matrix.

A solution to the problem is a set of m sequences of locations {s1, s2, . . . , sm}such that every destination di with i ≥ 1 appears exactly in one sequence (andno more than one), and the origin d0 is the first location in all the sequences.Each sequence of locations represents a taxi ride, where the destinations in thesequence are visited in the order they appear. The length of each sequence sl

will be k +1 at most, since k is the maximum capacity of the taxis and d0 is thefirst location in all the sequences. The total cost of a solution is given by:

cost({s1, s2, . . . , sm}) =m∑

l=1

⎝b +∑

(di,dj)∈sl

cij

⎠ , (1)

where we use (di, dj) ∈ sl to iterate over all the pairs of destinations that areadjacent in the sequence sl.

The objective of the problem is to find a solution that minimizes the costfunction defined in (1). This formulation does not provide a mechanism to dis-tribute the cost associated with travel passengers who share a taxi and it isassumed that the decision is delegated to users. Some ideas to do this distribu-tion of costs can be found in [18].

This formulation of the Taxi Sharing problem is NP-hard. We can prove thisby transforming the Hamiltonian Path Problem into Taxi Sharing. The versionof the Hamiltonian Path Problem we need is one in which the starting vertexv ∈ V is given. Formally, this variant of the Hamiltonian Path Problem consistsin finding a Hamiltonian path (visiting all the nodes exactly once) in a graphG(V,E) starting in the vertex v. This variant is NP-hard, since we can usethe same transformation from Vertex Cover to the Hamiltonian Path Problemprovided in [10].

The transformation from Hamiltonian Path to Taxi Sharing is as follows.Given the graph G = (V,E) where the Hamiltonian Path has to be found, webuild a complete graph G′ = (V ′, E′) where all the nodes in G are also in G′:V ′ = V . The starting vertex v ∈ V is d0 in Taxi Sharing, the location wherethe passengers are picked up. G′ is a complete graph, thus, E′ = V ′ × V ′ andthe weight of an edge e ∈ E′ is 1 if the edge is also in E and 2 if it is not in E.Finally, the minimum fare is the sum of all the weights in the complete graphand the capacity of the taxis is the same as the number of vertices in the graphminus one. These last requirements ensures that the optimal solution will haveonly one taxi. If the cost of the optimal solution is the minimum fare plus thenumber of vertices minus one, there is a Hamiltonian Path starting at vertexv ∈ V . Otherwise, no such path exists.

Au

tho

r P

roo

f

• We can manage the differences

Add the minimum fare to theedges leaving the origin

0

0

0

Definition Link to CVRP

Page 7: Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem

7 / 14Smart-CT 2016, Málaga, Spain, 15-17 July, 2016

Motivation Taxi-sharing MILP Formulation Experiments Conclusions

& Future Work

Mixed Integer Linear Programming• Based on Kulkarni and Bhave’s formulation afor CVRP

• There is an error in that formulation that does not affect taxi-sharing

Mixed Integer Linear Programming Formulation 5

yi − yj + nxij ≤ n − 1 for 1 ≤ i ̸= j ≤ n, (5)ui − uj + kxij ≤ k − 1 for 1 ≤ i ̸= j ≤ n, (6)xij = 0 or 1 for 0 ≤ i ̸= j ≤ n, (7)ui, yi ∈ R for 1 ≤ i ≤ n. (8)

Constraints (3) and (4) ensure that each location is visited only once. Con-straint (5) is designed to ensure that no subtours are formed and, thus, ensuringthat all routes must visit the origin. The yi variables are introduced to avoidsubtours. They assign a value to each node where all the nodes in a tour havealways increasing values. If xij = 1, that is, if node j is visited after node i,then yj ≥ yi + 1. This way, subtours cannot exist unless they pass through thedepot where the corresponding constraint is not applied. Constraint (6) ensuresthat the taxi capacity is not exceeded. The ui variables follow the same idea asthe yi ones, but using the capacity instead of the length of the tour. If xij = 1,then uj ≥ ui + 1. This way, the ui are increasing in a tour, and the differencebetween the minimum and the maximum value of ui in a tour can never exceedk, which means that no more than k destinations are visited. Constraints (7)and (8) define the domains of the variables.

4 Experimental Results

In this section, we show the results of a preliminary experimental study in whichwe compare the performance of CPLEX solving the MILP formulation presentedin Sect. 3 with the parallel micro evolutionary algorithm (pµEA) proposed byMassobrio et al. [18]. Our approach provides an optimal solution, since we use aMixed Integer Linear Programming solver to solve the problem, while (pµEA) isa metaheuristic algorithm that provides suboptimal solutions. Thus, it is clearthat our approach will provide better quality solutions to the problem. Theresearch questions we want to answer with this first experimental study are:

– RQ1: How much cost is it saved by using the MILP approach?– RQ2: How long does it take to find the optimal solution using the MILP

formulation?– RQ3: When is it better to use a MILP solver instead of pµEA to solve the

problem?

In order to answer these questions, we will run the MILP solver using a setof 24 instances and we will compare the cost of the obtained solutions and timerequired to solve the instances with that of pµEA.

4.1 Instances

In order to evaluate our approach and compare it with pµEA, we use the sameset of real-like instances used in [18]. These instance were provided by the authorsof [18], but they were originally generated with the help of Taxi Query Genera-tor (TQG). This tool uses information from basic taxi trajectories obtained using

Au

tho

r P

roo

f

4 H.E. Ben-Smida et al.

3 Mixed Integer Linear Programming Formulation

The Taxi Sharing Problem presented in the previous section can be transformedinto a Capacitated Vehicle Routing Problem instance where the number of vehi-cles is unknown. This served as a motivation to adapt existing Vehicle RoutingMILP formulations to solve Taxi Sharing. In particular, we base our formulationin that of Kulkarni [15]. Although this formulation has an error in it [1], it doesnot affect the Taxi Sharing problem presented here, since the error is related tothe limit in the travel distance, which does not apply in Taxi Sharing.

In the CVRP the goal is to minimize the cost to serve a set of customerswith goods stored in a depot. There is a fleet of vehicles that can serve thecustomers. Each vehicle has a maximum capacity that cannot be exceeded. Allthe vehicles have the same starting location, the depot, and they transport thegoods to different destinations in order to satisfy the needs of customers. Eachcustomer must be visited only once by one vehicle.

There is a similarity between CVRP and Taxi Sharing if we relate the cus-tomers with the passengers and the depot with the origin of all the passengers.The vehicles are the taxis and the maximum capacity is the number of peopleeach taxi can take. The main differences are: (1) the taxis do not have to goback to the depot (as in CVRP), (2) there is a minimum fare that is not relatedto the distance traveled and, (3) there can be several passengers that want to goto the same location. We can transform a Taxi Sharing instance into a CVRPinstance if we find a way to deal with these three differences.

In order to model the fact that taxis do not need to go back to the depot,we can do the cost of return equals zero. This way, although the solutions willbe composed of closed paths, there is no cost related to the final segment (thatgoes back to the origin). The minimum fare can be added to the cost of the firstsegment of any path. In particular, it can be added to all the edges that leavethe origin. Finally, all the passenger destinations can be considered as different.If some of them are the same in a particular instance of the problem, we add azero cost edge between them. With these considerations, we can adapt the MILPformulation of CVRP to Taxi Sharing.

We assume c0i is the cost from the origin to the location plus the minimumfare that the customers have to pay to the taxi. The values ci0 will be 0 asexplained above. The Mixed Integer Linear Program formulation of the TaxiSharing problem is:

minn!

i=0

n!

j=0

cijxij , (2)

subject to:n!

i=0

xij = 1 for 1 ≤ j ≤ n, (3)

n!

j=0

xij = 1 for 1 ≤ i ≤ n, (4)

Au

tho

r P

roo

f

4 H.E. Ben-Smida et al.

3 Mixed Integer Linear Programming Formulation

The Taxi Sharing Problem presented in the previous section can be transformedinto a Capacitated Vehicle Routing Problem instance where the number of vehi-cles is unknown. This served as a motivation to adapt existing Vehicle RoutingMILP formulations to solve Taxi Sharing. In particular, we base our formulationin that of Kulkarni [15]. Although this formulation has an error in it [1], it doesnot affect the Taxi Sharing problem presented here, since the error is related tothe limit in the travel distance, which does not apply in Taxi Sharing.

In the CVRP the goal is to minimize the cost to serve a set of customerswith goods stored in a depot. There is a fleet of vehicles that can serve thecustomers. Each vehicle has a maximum capacity that cannot be exceeded. Allthe vehicles have the same starting location, the depot, and they transport thegoods to different destinations in order to satisfy the needs of customers. Eachcustomer must be visited only once by one vehicle.

There is a similarity between CVRP and Taxi Sharing if we relate the cus-tomers with the passengers and the depot with the origin of all the passengers.The vehicles are the taxis and the maximum capacity is the number of peopleeach taxi can take. The main differences are: (1) the taxis do not have to goback to the depot (as in CVRP), (2) there is a minimum fare that is not relatedto the distance traveled and, (3) there can be several passengers that want to goto the same location. We can transform a Taxi Sharing instance into a CVRPinstance if we find a way to deal with these three differences.

In order to model the fact that taxis do not need to go back to the depot,we can do the cost of return equals zero. This way, although the solutions willbe composed of closed paths, there is no cost related to the final segment (thatgoes back to the origin). The minimum fare can be added to the cost of the firstsegment of any path. In particular, it can be added to all the edges that leavethe origin. Finally, all the passenger destinations can be considered as different.If some of them are the same in a particular instance of the problem, we add azero cost edge between them. With these considerations, we can adapt the MILPformulation of CVRP to Taxi Sharing.

We assume c0i is the cost from the origin to the location plus the minimumfare that the customers have to pay to the taxi. The values ci0 will be 0 asexplained above. The Mixed Integer Linear Program formulation of the TaxiSharing problem is:

minn!

i=0

n!

j=0

cijxij , (2)

subject to:n!

i=0

xij = 1 for 1 ≤ j ≤ n, (3)

n!

j=0

xij = 1 for 1 ≤ i ≤ n, (4)

Au

tho

r P

roo

f

Visit each nodeonly once Avoid subtours

Taxi capacity constraint Domains of variables

Page 8: Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem

8 / 14Smart-CT 2016, Málaga, Spain, 15-17 July, 2016

Motivation Taxi-sharing MILP Formulation Experiments Conclusions

& Future Work

ExperimentsInstances, algorithms and machines Results

• Set of 24 real-like instances used by Massobrio et al. (2014)• Generated with Taxi Query Generator based on trajectories of more than

10,000 taxis in Beijing, China• Sizes: from 9 to 69 passengers

• IBM CPLEX 12.6.2 for Windows for solving the MILP formulation• Intel Core i5-4210U at 1.7GHz, 8 GB and Windows 10

• Parallel micro evolutionary algorithm with 24 subpopulations, 15solutions per subpopulation, and greedy initialization strategy

• Cluster with Dell Power Edge servers, Quad-core Xeon E5430 at 2.66 GHz, 8 GB

Instances

Algorithms and machines

Best conf.

Page 9: Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem

9 / 14Smart-CT 2016, Málaga, Spain, 15-17 July, 2016

Motivation Taxi-sharing MILP Formulation Experiments Conclusions

& Future Work

Experiments: Results (i)Small instances

6 H.E. Ben-Smida et al.

GPS devices installed in one week to 10,357 taxis in the city of Beijing, China. Thedata used to generate the instances are a subset of those used by Ma et al. [17].

TQG produces a list of origins and destinations for individual trips. To adaptthose data to this problem, Massobrio et al. grouped the destinations havingthe same origin. They built instances with different sizes: small, with 10 to 25passengers, medium, with 25 to 40 passengers, large with 40 to 55 passengers,and very large, with 55 to 70 passengers. This way, they created a benchmark of24 realistic instances of the Taxi Sharing Problem.

4.2 Algorithms

In order to solve the Taxi Sharing Problem using the MILP formulation describedin Sect. 3, we use IBM Ilog CPLEX 12.6.2 for Windows. The experiments wereperformed in a machine with Intel Core i5-4210U processor at 1.7 GHz, 8 GB ofRAM, and Windows 10 operating system. Regarding the parallel micro evolu-tionary algorithm, several configurations of the algorithms were tested in [18].For the comparison we use the configuration that reported the best results in [18].This configuration uses 24 subpopulations (and CPU cores) with 15 solutionseach, and a greedy initialization strategy. These experiments were run in theFING cluster with Dell Power Edge servers assembled with Quad-core XeonE5430 processors at 2.66 GHz, 8 GB of RAM and Gigabit Ethernet.

4.3 Results

Tables 1, 2, 3 and 4 show the solution quality (cost) and the runtime required byour approach and pµEA to solve the 24 real-like instances of the Taxi SharingProblem. In the case of pµEA, we report the average and the standard deviationof the cost in 20 independent runs of the algorithm.

We can observe in all the cases that the cost obtained by the MILP solveris significantly lower than the cost obtained by pµEA. We knew that the costshould be lower, since the MILP finds the optimal solution (except for smallfloating point errors). However, the results of the experiments show that thedifference between the cost obtained with pµEA and the MILP solver is largeenough to justify the MILP approach. There is an important benefit. In somecases, the MILP solver reaches almost half of the cost of the pµEA solution

Table 1. Comparison between the MILP solver and pµEA with 24 subpopulations andgreedy initialization strategy for the small instances of the Taxi Sharing Problem. ForpµEA, the average cost and standard deviation of 20 independent runs is reported.

Passengers 9 12 17 21 23 24

pµEA Cost 125.5 ± 0.0 168.8 ± 0.0 191.2 ± 0.5 215.6 ± 0.1 298.4 ± 0.3 252.2 ± 2.4

Time (s) 0.0 0.0 0.0 0.0 0.3 2.1

MILP Cost 86.5 126.8 124.1 137.5 162.4 157.2

Time (s) 0.1 0.1 0.1 0.1 0.2 0.2

Au

tho

r P

roo

f

• Advantages of MILP in quality• Time is short in both cases (recall that pµEA runs in a faster machine)

Instances, algorithms and machines Results

Page 10: Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem

10 / 14Smart-CT 2016, Málaga, Spain, 15-17 July, 2016

Motivation Taxi-sharing MILP Formulation Experiments Conclusions

& Future Work

Experiments: Results (ii)Medium instances

Mixed Integer Linear Programming Formulation 7

Table 2. Comparison between the MILP solver and pµEA with 24 subpopulations andgreedy initialization strategy for the medium instances of the Taxi Sharing Problem.For pµEA, the average cost and standard deviation of 20 independent runs is reported.

Passengers 26 27 33 33 37 39

pµEA Cost 344.5 ± 5.6 323.1 ± 3.4 801.2 ± 4.2 357.4 ± 3.4 443.7 ± 3.8 367.0 ± 5.0

Time (s) 5.6 3.6 4.2 3.4 3.8 6.1

MILP Cost 245.0 212.3 486.2 233.7 301.5 274.2

Time (s) 1.0 1.2 2.1 3.2 5.1 6.1

Table 3. Comparison between the MILP solver and pµEA with 24 subpopulations andgreedy initialization strategy for the large instances of the Taxi Sharing Problem. ForpµEA, the average cost and standard deviation of 20 independent runs is reported.

Passengers 42 44 44 46 53 54

pµEA Cost 429.9 ± 7.1 319.8 ± 7.5 425.0 ± 4.3 367.7 ± 3.2 446.3 ± 2.6 562.1 ± 4.3

Time (s) 3.7 7.5 4.3 3.3 4.8 4.3

MILP Cost 312.7 189.0 287.6 244.5 301.9 376.1

Time (s) 7.2 7.8 12.1 15.3 19.0 45.0

Table 4. Comparison between the MILP solver and pµEA with 24 subpopulations andgreedy initialization strategy for the very large instances of the Taxi Sharing Problem.For pµEA, the average cost and standard deviation of 20 independent runs is reported.

Passengers 57 57 59 62 66 69

pµEA Cost 637.7 ± 3.6 524.8 ± 4.5 498.4 ± 3.5 744.9 ± 6.1 560.6 ± 4.7 1424.6 ± 6.1

Time (s) 3.6 7.7 3.5 8.0 4.7 6.1

MILP Cost 462.4 327.5 332.0 503.2 398.4 N/A

Time (s) 4927.0 6180.0 7353.0 69487.0 > 64000 > 64000

(see solution with n = 23 in Table 1). This observation is generalized, and itdoes not seem to change with the number of passengers of the instances.

Regarding the execution time of the MILP solver and pµEA, we have to becareful with the conclusions, since both algorithms are run in different machines,with different cores. Although an accurate comparison is not possible here, wecan take some conclusions just seeing the order of magnitude of the runtime.

As we could expect both approaches require, in general, more time as thenumber of passengers grows. In the case of small and medium size instances, theMILP solver and pµEA require a few seconds (or fractions of seconds) to solvethe instances. We can observe that the time in this case is in the same order ofmagnitude. The same is true for some of the large instances. However, in largeand very large instances, the time required by the MILP solver grows up toimpractical values. The execution time of pµEA in these instances is negligiblecompared to the one of the MILP solver.

Au

tho

r P

roo

f

• Advantages of MILP in quality• MILP is faster than pµEA

Instances, algorithms and machines Results

Page 11: Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem

11 / 14Smart-CT 2016, Málaga, Spain, 15-17 July, 2016

Motivation Taxi-sharing MILP Formulation Experiments Conclusions

& Future Work

Experiments: Results (iii)Large instances

• Advantages of MILP in quality• pµEA is faster than MILP• MILP is still reasonable in time if we are happy to wait less than 1 minute

Mixed Integer Linear Programming Formulation 7

Table 2. Comparison between the MILP solver and pµEA with 24 subpopulations andgreedy initialization strategy for the medium instances of the Taxi Sharing Problem.For pµEA, the average cost and standard deviation of 20 independent runs is reported.

Passengers 26 27 33 33 37 39

pµEA Cost 344.5 ± 5.6 323.1 ± 3.4 801.2 ± 4.2 357.4 ± 3.4 443.7 ± 3.8 367.0 ± 5.0

Time (s) 5.6 3.6 4.2 3.4 3.8 6.1

MILP Cost 245.0 212.3 486.2 233.7 301.5 274.2

Time (s) 1.0 1.2 2.1 3.2 5.1 6.1

Table 3. Comparison between the MILP solver and pµEA with 24 subpopulations andgreedy initialization strategy for the large instances of the Taxi Sharing Problem. ForpµEA, the average cost and standard deviation of 20 independent runs is reported.

Passengers 42 44 44 46 53 54

pµEA Cost 429.9 ± 7.1 319.8 ± 7.5 425.0 ± 4.3 367.7 ± 3.2 446.3 ± 2.6 562.1 ± 4.3

Time (s) 3.7 7.5 4.3 3.3 4.8 4.3

MILP Cost 312.7 189.0 287.6 244.5 301.9 376.1

Time (s) 7.2 7.8 12.1 15.3 19.0 45.0

Table 4. Comparison between the MILP solver and pµEA with 24 subpopulations andgreedy initialization strategy for the very large instances of the Taxi Sharing Problem.For pµEA, the average cost and standard deviation of 20 independent runs is reported.

Passengers 57 57 59 62 66 69

pµEA Cost 637.7 ± 3.6 524.8 ± 4.5 498.4 ± 3.5 744.9 ± 6.1 560.6 ± 4.7 1424.6 ± 6.1

Time (s) 3.6 7.7 3.5 8.0 4.7 6.1

MILP Cost 462.4 327.5 332.0 503.2 398.4 N/A

Time (s) 4927.0 6180.0 7353.0 69487.0 > 64000 > 64000

(see solution with n = 23 in Table 1). This observation is generalized, and itdoes not seem to change with the number of passengers of the instances.

Regarding the execution time of the MILP solver and pµEA, we have to becareful with the conclusions, since both algorithms are run in different machines,with different cores. Although an accurate comparison is not possible here, wecan take some conclusions just seeing the order of magnitude of the runtime.

As we could expect both approaches require, in general, more time as thenumber of passengers grows. In the case of small and medium size instances, theMILP solver and pµEA require a few seconds (or fractions of seconds) to solvethe instances. We can observe that the time in this case is in the same order ofmagnitude. The same is true for some of the large instances. However, in largeand very large instances, the time required by the MILP solver grows up toimpractical values. The execution time of pµEA in these instances is negligiblecompared to the one of the MILP solver.

Au

tho

r P

roo

f

Instances, algorithms and machines Results

Page 12: Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem

12 / 14Smart-CT 2016, Málaga, Spain, 15-17 July, 2016

Motivation Taxi-sharing MILP Formulation Experiments Conclusions

& Future Work

Experiments: Results (& iiiv)Very large instances

• Advantages of MILP in quality• MILP is useless in this case, pµEA provides a suboptimal answer much

faster• Not a surprise, we are solving an NP-hard problem to optimality

Mixed Integer Linear Programming Formulation 7

Table 2. Comparison between the MILP solver and pµEA with 24 subpopulations andgreedy initialization strategy for the medium instances of the Taxi Sharing Problem.For pµEA, the average cost and standard deviation of 20 independent runs is reported.

Passengers 26 27 33 33 37 39

pµEA Cost 344.5 ± 5.6 323.1 ± 3.4 801.2 ± 4.2 357.4 ± 3.4 443.7 ± 3.8 367.0 ± 5.0

Time (s) 5.6 3.6 4.2 3.4 3.8 6.1

MILP Cost 245.0 212.3 486.2 233.7 301.5 274.2

Time (s) 1.0 1.2 2.1 3.2 5.1 6.1

Table 3. Comparison between the MILP solver and pµEA with 24 subpopulations andgreedy initialization strategy for the large instances of the Taxi Sharing Problem. ForpµEA, the average cost and standard deviation of 20 independent runs is reported.

Passengers 42 44 44 46 53 54

pµEA Cost 429.9 ± 7.1 319.8 ± 7.5 425.0 ± 4.3 367.7 ± 3.2 446.3 ± 2.6 562.1 ± 4.3

Time (s) 3.7 7.5 4.3 3.3 4.8 4.3

MILP Cost 312.7 189.0 287.6 244.5 301.9 376.1

Time (s) 7.2 7.8 12.1 15.3 19.0 45.0

Table 4. Comparison between the MILP solver and pµEA with 24 subpopulations andgreedy initialization strategy for the very large instances of the Taxi Sharing Problem.For pµEA, the average cost and standard deviation of 20 independent runs is reported.

Passengers 57 57 59 62 66 69

pµEA Cost 637.7 ± 3.6 524.8 ± 4.5 498.4 ± 3.5 744.9 ± 6.1 560.6 ± 4.7 1424.6 ± 6.1

Time (s) 3.6 7.7 3.5 8.0 4.7 6.1

MILP Cost 462.4 327.5 332.0 503.2 398.4 N/A

Time (s) 4927.0 6180.0 7353.0 69487.0 > 64000 > 64000

(see solution with n = 23 in Table 1). This observation is generalized, and itdoes not seem to change with the number of passengers of the instances.

Regarding the execution time of the MILP solver and pµEA, we have to becareful with the conclusions, since both algorithms are run in different machines,with different cores. Although an accurate comparison is not possible here, wecan take some conclusions just seeing the order of magnitude of the runtime.

As we could expect both approaches require, in general, more time as thenumber of passengers grows. In the case of small and medium size instances, theMILP solver and pµEA require a few seconds (or fractions of seconds) to solvethe instances. We can observe that the time in this case is in the same order ofmagnitude. The same is true for some of the large instances. However, in largeand very large instances, the time required by the MILP solver grows up toimpractical values. The execution time of pµEA in these instances is negligiblecompared to the one of the MILP solver.

Au

tho

r P

roo

f

Instances, algorithms and machines Results

Page 13: Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem

13 / 14Smart-CT 2016, Málaga, Spain, 15-17 July, 2016

Motivation Taxi-sharing MILP Formulation Experiments Conclusions

& Future Work

Conclusions and Future WorkConclusions & Future Work

• Solving the MILP formulation we get optimal results in short time for instances with up to 45 passengers (large instances)• More than 45 passengers requires a different approach to have an answer in a few seconds• pµEA works well in these very large instances

Conclusions

• Combine exact and heuristic methods: matheuristics• Extend the formulation to include more realistic scenarios: real-time traffic, passengers’ time constraints, etc.

Future Work

Page 14: Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem

14 / 14Smart-CT 2016, Málaga, Spain, 15-17 July, 2016

Acknowledgements

Mixed Integer Linear Programming Formulation for the Taxi Sharing Problem

Thanks to Renzo Massobrio, Gabriel Fagúndez and Sergio Nesmachnow