Budhi'S Notes: Part Ii - Solving Vehicle Routing Problem With Excel
Budhi'S Notes: Part Ii - Solving Vehicle Routing Problem With Excel
BUDHI'S NOTES
Twitter
Linkedin
WordPress
Sidebar
VRP is a classical problem which consist of determining the best routes for vehicles to visit and
serve a set of customers from specific location. Company like UPS and FedEx use VRP analysis
in daily basis for delivering parcel to their customers. Solving VRP to optimal solution is
difficult, since it is a NP-hard problem. Thus many commercial software tend to use heuristics
method to solve the problem for efficiency reason. In this post we are going to solve VRP by
maximizing the power of Excel. Let consider the following case:
Rahman is a distribution planner in company XYZ. Every morning, he collects processed
customer orders from the past day and make a delivery plan to the customers. His task is to
determine efficient routes for truck drives to deliver packages from company depot to a set of
customers. He noticed that every trucks can only carry up to 400 packages and the average
customer demand is about 70 packages per day. It means that every truck can only serve 5 to 6
customers in a single route. With about 20 locations scattered across the region, Rahman gets
overwhelmed to perform the routing process manually. He asked you to help him with a better
planning process. He has mapped out his customer locations in a cartesian diagram and collect
the customer demand information as shown in figure and table below. Now he needs your
assistance to determine the best routes for the trucks. By assuming euclidean distance with road
factor 1, can you assist Rahman with the problem?
Like what we did with the facility location problem, the first step to solve this problem in is to
design an Excel model which allow us to automatically evaluate solution quality by arbitrary
changing its decision variables. In VRP, the decision variables are a set of non-repetitive
numbers representing the sequence of customer locations to be visited by the trucks. So if I set
the decision variable as 6-7-5-15, the model should be able to return the total distance to visit
customer 6, 7, 5, and 15 in order sequence.
Besides, the model should also be able to consider that the trucks always start the route from
depot and also ends at the depot. So whenever a dispatched truck has reached its capacity limit, it
should return back to the depot. This means when I set the route as 6-5-7-15-1, the model should
be able to calculate the cumulative load and automatically insert a depot in between the schedule.
After converting the x-y coordinate into degree, the second step is to start the sweeping process
by sorting the theta in sequence. You may use RANK formula to perform this task or you can
also simply sort the column in ascending manner. If you implement this step correctly, you will
get a set of clustered customers as depicted in figure below. (Tips: you can improve the solution
by finding the best angle to start sweeping the customer location)
Now our problem has been divided into a set of clusters which we can treat as sub-problems.
This sub-problems are smaller and less complex than the complete problem. Thus, Solver should
be able to refine the route sequence for each cluster to improve the total solution quality.
By setting up a model, now we can back to Rahman and assist him with a better planning
process. Since Rahman will perform this kind of task frequently with different customer size in
daily basis, you may also advice him to use only the sweep algorithm (stage 1) to speed up the
process. The model setup for the sweep algorithm is flexible enough to be expanded if necessary.
However you also need remind him that, like other NP-hard problem, the solution quality
resulted from such heuristics method will fall rapidly with the increase of problem size. If the
saving resulted from routing optimization is quite significant, you may also want to encourage
Rahman to speak with his manager to buy a dedicated software to support him performing
his task in daily basis.
***
I hope you enjoy the case. Any questions and remark, please leave it in the comment. I am more
than happy to answer. If you like this kind of post, you may also want to visit my other post
on logistics planning series. Thank you for reading.
Next Post: Minimizing empty container flows in logistics network.
Advertisements
SHARE THIS:
Print
LinkedIn
Facebook
Twitter
POST NAVIGATION
← Part I – Optimizing Logistics Network with Excel
Part III – Minimizing Empty Container Flows with Excel →
10 THOUGHTS ON “PART II – SOLVING VEHICLE
ROUTING PROBLEM WITH EXCEL”
1. PETER SAYS:
Could you provide the formulas for the first excel model?
Hi Peter, I use the sum of euclidean distance between customer location. The customer
location is determined by x and y as in cartesian diagram. For instance, the distance between
customer 1 and 2 can be formulated as follow: distance((x1, y1), (x2, y2)) = √(x1 – x2)² + (y1
– y2)². Hope this helps.
Salam, Thank you for sharing, thus it helped me a lot in my final project , however I copied same settings and
even data from your first and second part, i’m getting different wrong results , in the first part I got the long
number not int, something like: 3.56240364423134E+29
the second I cannot set the solver constraints right
could you please help or if you could share the spreadsheet
appreciate your valuable support .
Salam,
Hi doulfikar, recently I got more and more case-specific questions like yours… So I am
considering to open the spreadsheet to public. I will announce it soon.
Would you show me how to make clustering graph by excel? I tried to make graph to show the location of but
i don’t know how to show the route on the graph…
Would you please let me know how to draw clustering graph? I don’t know how to make it.
Hi Pak Budi.
Pak apa boleh di share untuk setting detail solvernya seperti apa ya Pak ?
Objectivenya
Changing variablenya
Constraints
Terima kasih banyak pak