# Dijkstra’s Algorithm

I previously talked about a particular instance of the vehicle routing problem for electric vehicles in a post which you can read here.

In fact that was a more challenging version of a classic problem in combinatorial optimisation – finding an optimal path. So it would be remiss of me if I didn’t go right back to the start: Dijkstra’s algorithm.

Aside

# Routing Electric Vehicles

Electric cars seem to be the way of the future, they are cheaper to run and better for the environment. However there has always been one thing holding them back in many people’s eyes: actually finding somewhere to recharge and the length of time needed to recharge.

Many companies continue to try and reduce the time needed to fully recharge a car battery, with a new generation of fast charging stations being able to recharge significantly a battery in around 30 mins. However one approach suggested by some companies is to simply swap batteries depleted with fresh ones at stations.

One interesting talk given at that the recent STOR-i conference was presented by Pitu Mirchandani from Arizona State University in the United States. His work has been directed towards electric cars and the somewhat unique problems that crop up for the battery exchange models in particular.

He defined a new problem as the ‘Electric Vehicle Shortest Walk Problem’. Note that it is shortest walk rather than shortest path, as it takes into account the fact that vehicles will often need to take detours in order to recharge or swap batteries. This mean that the problem he had to deal with couldn’t be solved with traditional shortest path algorithms such as Dijkstra’s algorithm and he had to develop a new approach.

The two main things that need to be minimised are:

1. The total distance detoured from the optimal route (the route with no stops)
2. The total number of stops (to exchange batteries)

He went on to discuss further his ideas of other interesting problems that can be studied such as where to locate the battery exchange stations and how large they should be. This meant that he was able to propose a system that could decide where every car in the network should stop off on its journey to swap batteries. The point of doing this was that he found the overall total journey time of all the cars in the system was minimised. In particular it was substantially below the case when every driver made their own decision about where and when they chose to stop. So whilst drivers would lose their independence, all road users would benefit.

I should probably conclude by saying that nothing is the world of research is guaranteed. In fact it turns out that the man behind Tesla, Elon Musk, has since changed his mind on battery exchange technology following an unsuccessful pilot. He suggested that people just prefer being able to recharge their car! This appears to be for several reasons, not least of which that recharging at their solar powered superchargers is free and using a battery exchange station costs the same as a fresh tank of petrol!