Queuing Tasks with Redis

Redis is an open-source data structure that is used for in-memory storage and helps developers across the globe with the quick and efficient organization and utilization of data. Even though many…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Tabu Search for the Vehicle Routing Problem

In the classical VRP, all information is known in advance, making it deterministic and static. However, in the ride hail problem, pick ups and drop offs can come in at any time and in any volume, making it both dynamic and stochastic. After a passenger requests a ride, the problem must also be solved extremely quickly. Add in the complexities of autonomous vehicles, such as routing around constraints (i.e. no unprotected left hand turns) and refueling, and the problem becomes more complex very quickly.

Here at rideOS, we’ve made many efforts towards solving the problem with both speed and efficiency. Knowing when to sacrifice solution quality for speed or load is less of a math problem and more of a business decision. However, there exist several heuristics to elegantly handle both. My favorite of them all is tabu search.

Tabu search is a meta heuristic for optimization of combinatorial problems, which means it finds sufficiently good solutions for NP-hard problems. By definition, an NP-hard problem cannot be solved precisely in polynomial time. Instead, we sacrifice a perfect solution for a ‘sufficiently’ good solution that can be computed in real time. In industry, there are lots of trade offs between what works perfectly and what works well enough. Tabu search is a meta heuristic that often works well enough to find a near-optimal solution quickly.

What makes tabu search unique is that it exploits short-term memory to avoid re-visiting old solutions. Let’s break down what that looks like. Here’s a handy diagram that you can use to follow along.

To start, we need to define the problem. To keep it as simple as possible, our problem domain will consist of vehicles and drop off points. Our problem is to find a solution where all the drop off points are visited by a vehicle. Our challenge is to find a solution where the fleet travels the shortest distance.

To construct an initial solution, for simplicity, assign the drop off points evenly between the vehicles. This may not be the most efficient heuristic, but optimal construction of initial solutions is a story for another day.

So if we have 2 vehicles, and 4 drop offs, let’s greedily construct an initial solution using this method by placing the first half of the drop offs into the first vehicle’s route and the second half of the drop offs into the second vehicle’s route. Using our extremely simple procedure, our initial solution will look something like this:

Easy. But this solution is likely far from optimal. We can now apply a search procedure to optimize. In this example, the solution space is small. By solution space, I refer to every possible combination of solutions. Due to the NP-Hardness of the problem, the solution space grows very large, very quickly. With just a small increase in the number of vehicles or drop offs, it becomes impossible to search the entire space, thus meta heuristics such as Tabu Search are extremely important.

Using the initial solution, create a list of neighboring solutions. In plain english, a neighboring solution of the initial solution is a solution with just one ‘thing’ different from the initial solution. Following the example from above, if the initial solution is:

Then a neighboring solution would be:

See how drop off 3 moved from vehicle 2 to vehicle 1? This means solution B is a neighbor of solution A. As an aside, it follows that this implication actually holds in both directions (i.e. solution A is also a neighbor of solution B).

For the next part of tabu search, you generate several neighboring solutions according to other heuristics. Again, the best way to do this is a story for another day. Once you have this list of neighboring solutions, pick the one with the lowest cost.

Now hold up. What does cost mean? Well, in combinatorics and optimization you are always trying to minimize a central cost. In terms of ride hail, this often means minimizing more than one variable, such as passenger wait time, ride time, vehicles miles travelled, and/or any combination of these or others. In this example, we’re minimizing distance travelled because it’s the most simple to do.

This means that from the list of neighboring solutions, pick the one that results in the shortest distance travelled. Here’s where the tabu part comes in. From that best solution in the list, check to see if it is on the tabu list. The tabu list is how this meta heuristic exploits short term memory.

If it is on the tabu list, you cannot pick that solution because you’ve already visited it. You must instead pick the next best solution, which will have a worse cost. Tabu search forces you to temporarily visit worse solutions to find the best solution.

Alternatively, if the best solution on the list of neighboring solutions is not on the tabu list, you update the current best solution AND then add it to the tabu list. If the current best solution is better than any solution found previously, update the global best solution, as well. In our example, this means if the current best solution has a shorter distance travelled by the fleet than any solution found previously, update the global best solution.

Continue until a stopping criterion is reached, usually after a set number of iterations or after a set number of iterations with no improvement. Once this criterion is reached, return the global best solution.

How does this work? Well, by blacklisting solutions it avoids circling back and falling into the trap of a local optima. This principle might be best explained by this picture:

Imagine if an initial solution was seeded with a cost near the peak of the local optimum and the goal was to reach the global optimum. Without keeping track of previously visited solutions, the algorithm would converge at the local optimum. Since tabu search keeps track of this, it pushes past the local optimum and will eventually reach the global optimum.

Tabu search is just one of many meta heuristics for solving the VRP that we’ve tested at rideOS. The importance of finding near optimal solutions when planning fleets can have immediate positive effects on the triple bottom line for companies. By optimizing distance travelled, companies can reduce fuel, save money on maintenance costs, reduce congestion on the road, and so much more.

Add a comment

Related posts:

Le merendone

Viene o non viene? Intanto fuori piove e tira vento e a me - se viene- tocca pure uscire. Non venire!! Prego mentre tengo d’occhio i suoi movimenti dalla pagina social. Perchè se non viene lui…

Robotic Industrial Process Automation

We are thrilled today to finally be able to announce our investment in CruxOCM, a company at the forefront of the automation revolution in heavy industry. In the summer of 2019, on a visit to Berlin…

Top IAS Coaching Centre In Bangalore

Do you want to pursue a successful career in civil services, and look for the best IAS coaching centre In Bangalore? Achievers IAS Academy the top IAS coaching centre In Bangalore is the perfect…