Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

"Vehicle Routing Problem. How to solve it in Java?" Станислав Кифенко


Published on

Vehicle Routing Problem (VRP) is one of the most challenging combinatorial optimization tasks, a central problem in the areas of transportation, distribution and logistics. Decreasing transport costs can be achieved through better resources (vehicles) utilization.

VRP is to design route for N vehicles with M depots and P customers in order to meet the given constraints (less time, less fuel, less trucks, less workers). Looks pretty complicated, doesn’t it?

We will talk about VRP theory, real use cases, Java frameworks, which help to solve it, and best practices. This speech will show us how limited Google Maps Directions API is and how OptaPlanner and other VRP-solvers can fill this gap out. We will go through sample application and analyze how efficient it is.

Published in: Technology

"Vehicle Routing Problem. How to solve it in Java?" Станислав Кифенко

  1. 1. Заголовок презентации Имя и фамилия автора доклада Компания Контактные данные 1 Контактные данные 2 Контактные данные 3 Контактные данные 4 Vehicle Routing Problem: how to solve it in Java? Stanislav Kyfenko SoftServe skype: stanislav.kyfenko LinkedIn:
  2. 2. Stanislav Kyfenko • Senior Java Developer at SoftServe • 5+ years of experience in Java development • Software engineer mainly focused on distributed systems development and VRP solutions
  3. 3. Agenda • What is VRP? • VRP characteristics and goals • VRP types: from simplicity to complexity • OptaPlanner and jsprit • Q&A
  4. 4. What does VRP stand for? • VRP is one of the most popular constraint satisfaction problems in the areas of transportation, delivery and logistics • The main purpose is to design at least one route for K vehicles with L capacity each to deliver goods from M depots to N customers in order to meet the given constraints and time windows. • Effective utilization of resources (vehicles) can decrease transportation costs significantly
  5. 5. VRP characteristics
  6. 6. Depot Time Windows Location
  7. 7. Customer Time Windows Location Accessibility Demands
  8. 8. Vehicle Time Windows Return to depot Capacity Driver rest period
  9. 9. Route Total elapsed time Time delays Total distanceTotal cost
  10. 10. VRP goals Total elapsed time Total distance Total cost Total consumed fuel Fleet of vehicles
  11. 11. VRP goals Total profit Customers happiness
  12. 12. Vehicle Routing Problem types
  13. 13. 1. Travelling Salesman Problem
  14. 14. The simplest one - TSP
  15. 15. 2. Capacitated VRP
  16. 16. Capacitated VRP
  17. 17. 3. VRP with multiple depots
  18. 18. VRP with multiple depots
  19. 19. 4. Split Delivery VRP
  20. 20. Split Delivery VRP
  21. 21. 5. Periodic VRP
  22. 22. Periodic VRP
  23. 23. 6. Stochastic VRP
  24. 24. Stochastic VRP
  25. 25. 7. VRP with Time Windows
  26. 26. VRP with Time Windows
  27. 27. OptaPlanner
  28. 28. OptaPlanner
  29. 29. OptaPlanner
  30. 30. Sample
  31. 31. Sample
  32. 32. Similar to hard/soft constraints
  33. 33. Samle
  34. 34. Google Directions API
  35. 35. Google Directions API • Disadvantages: • 2,500 free directions requests per day • Up to 23 waypoints allowed in each request containing an API key • Up to 8 waypoints when no API key is supplied • 10 requests per second • Optimization based on traffic jams and roads info only
  36. 36. OptaPlanner demo
  37. 37. jsprit
  38. 38. jsprit • jsprit • can solve problems with pickups and deliveries, back hauls, heterogeneous fleets, finite and infinite fleets, multiple depots, time windows, open routes, different start and end locations, multiple capacity dimensions, initial loads, skills … • allows you to define additional stateful and stateless constraints to account for the richness of your problem. • is benchmarked against classical VRP instances (e.g. Solomon instances). • is released under LGPL (v3).
  39. 39. jsprit demo
  40. 40. How to cope with VRP effectively • Don’t use MDVRP when customers are mostly clustered around one depot • The more constraints you have, the less probability you solve VRP • Don’t define controversial constraints with the same strength • Do have a code to satisfy hard constraints first, then soft ones. • Use positive constraints to maximize variable and negative ones – to minimize
  41. 41. Thank you for attention
  42. 42. References • • • • Papers/PHDThesis.pdf • optaplanner-docs/html_single