Shreyas Bapat
December 22, 2019
46

# Route Optimization Algorithm

Presentation at Inter IIT Tech Meet 8.0

Venue: IIT Roorkee, India

## Shreyas Bapat

December 22, 2019

## Transcript

1. Shreyas Bapat, Akash Dakoor, Palak Gupta
{b16145, b17032, b16067}@students.iitmandi.ac.in
BOSCH’s Route
Optimization Algorithm
Inter IIT Tech Meet 8.0

2. What we’ll
cover
METHODS RESEARCHED
01
03
02
04
05
06
APPROACH FOLLOWED
ALGORITHM
END RESULTS
CHALLENGES FACED

01

4. - A standard problem in domain of Heuristics.
- The goal is to ﬁnd optimal routes for multiple vehicles visiting a set of
locations. (When there's only one vehicle, it reduces to the Traveling Salesman
Problem)
- NP-hard problem
- For scheduling public buses, school buses in metro cities, delivery chains.
Vehicle Routing Problem

5. - The current problem is a slight variant of the famous VRPTW.
- Why capacitated? To control the overﬂow/overload of buses, trucks etc.
- Lower bound on occupancy : This problem also has 85% as the lower bound on
occupancy for maximum utilization of resources like bus seats and fuel
- Time Windows : To deal with oﬃce/school opening times and strict delivery
schedules. Making the problem more practical.
- Cover maximum distance by a bus in a tour
Capacitated Vehicle Routing
Problem with Time Windows

6. Optimisation and Constraints
- Total 4 constraints are given for the problem
- 2 constraints need to be optimised, the total distance travelled by all the buses to
solve the problem and number of buses used for the same. Both need to be
minimised.
- 2 constraints need to be just taken care of. The bus has to visit all the nodes on
time always, and the bus capacity should be 85% at least to run the bus on that
route.

7. METHODS RESEARCHED
02

8. Reinforcement Learning with
Beam Search
- In this approach, the input is mapped to a high dimensional vector space and fed
into an RNN decoder.
- The decoder uses beam search which keeps track of the most probable paths
and follows the one with minimum length.
- An attention mechanism uses the RNN hidden state, along with the embedded
inputs and gives a probability distribution over the next input- this repeats until a
termination condition under the constraints is reached.

9. A MULTIPLE ANT COLONY SYSTEM FOR
VEHICLE ROUTING PROBLEMS WITH
TIME WINDOWS

10. APPROACH FOLLOWED
03

11. MACS-VRPTW: A MULTIPLE ANT COLONY SYSTEM FOR
VEHICLE ROUTING PROBLEMS WITH TIME WINDOWS
MACS- VRPTW
ACS for number of
buses
ACS for total distance
The goal of the ﬁrst colony, ACS-buses, is to try to diminish the number of buses used, while the second
colony, ACS-distance, optimizes the feasible solutions found by ACS-buses. Both colonies use independent
pheromone trails but collaborate by sharing the variable ψ(Total path) managed by MACS-VRPTW

12. Ant Colony Optimization
● Based on the ant’s capability of ﬁnding the shortest path from the nest to a food source.
● An ant repeatedly hops from one location to another to ultimately reach the destination (food).
● Ants deposit an organic compound called pheromones while tracing a path. The intensity of the
pheromone is an indicator of the utility of that arc to build better solutions.

13. Ant Colony Optimization
● Pheromone levels in a path are updated as:
where 0 ≤ ρ < 1 and 1 – p represent the pheromone evaporation rate, and Δτ
ij
is related to the
performance of each ant.
● The probability of the kth ant at node i choosing node j using the pheromone trail τ
ij
is given
by :

14. Algorithm In Depth!
04

15. - We only pick the next node when:
- Wait Time: When the bus reaches a node prior to it’s schedule time, we calculate
it’s waiting time
Wait time = max(Next Node’s departure time - Current time - distance between
nodes / speed * 60 , 0)
Current time + distance between nodes / speed * 60 + wait time + Distance of
that node from Bosch Bidadi / speed * 60 <= Time to reach oﬃce
Handling Time Windows

16. - Then the current time for the bus can be updated as:
Current time += distance between nodes / speed * 60 + wait time
- We have assumed the speed to be 60kmph in our program.
Handling Time Windows

17. ACS-distance
● Compute a tour as short as possible
● m artiﬁcial ants are activated to construct m solutions
● Compared to current solution and, in case any one solution is better, it is sent to MACS-VRPTW
● MACS-VRPTW uses this solution to update the current tour
● After solutions generation, the global updates are performed
ACS-buses
● Searches for a feasible solution by maximizing the number of visited nodes.
● Starts computation using v-1 vehicles (one vehicle less than the smallest number of vehicles in
current feasible solution)
● Produces a solution only when the number of visited nodes in current best solution is increased

18. Find all the lat-long from
(to be later used in algo
easily)
Populate a Distance Matrix
based on the actual shortest
distances between two Geo
Maps Distance Matrix API.
Otherwise, our algorithm
guarantees > 85%
occupancy all the times
(as ants visit all the
possible nodes once)
Optimise the path for the
given points, and ﬁnd the
number of buses used.
No bus can run on that
route (given the
constraint of total
travel distance per day)
However, we still give
the best number
The complete workﬂow!
< 85% bus
occupancy
on route
Otherwise
Current running time
maintained for all the
buses which helps
understand which
nodes to visit.

19. END RESULTS
05

20. Total number of available buses with an organisation for
managing the pickup-drop services.
Due to budget limitations, parking place limitations, less
management staff, the organisation might decide to use
maximum of 5 buses, even if 7 are actually required!
practicality purposes)

21. A fully working code which takes
prescribed input and gives a list of
nodes followed by various buses in
optimised order.

22. A visualisation, which shows
animated path for the code
Output path using the input data
Some nodes
are left out
because that
path does not
have 85%
occupancy
Bus capacity: 20
Total Customers: 30
85% Bus Capacity: 17
Best case remaining : 13
(<17, hence another bus
can’t run for remaining
number)

23. CHALLENGES FACED
06

24. It took us quite some time to
understand that the problem
can be solved using
metaheuristic approaches,
and can be modelled as a
VRPTW problem.
We tried clustering, and
other approaches which
didn’t work like
metaheuristics.
Hardships!
Understanding what the
problem demands
Optimising two constraints
at the same time
problems like TSP etc, where
be optimised. It took us long
enough to understand how
to take care of two
constraints at the same time
eﬃciently
Keeping the track of
current time
We assume the bus always
run at speed 60km/h. Then