Page 1
Заголовок презентации
Имя и фамилия автора докладаКомпания
Контактные данные 1Контактные данные 2Контактные данные 3Контактные данные 4
VehicleRoutingProblem:howtosolveitinJava?
StanislavKyfenkoSoftServe
skype:stanislav.kyfenkoLinkedIn:https://ua.linkedin.com/in/skyfenko
Page 2
StanislavKyfenko
• SeniorJavaDeveloperatSoftServe• 5+yearsofexperienceinJavadevelopment• SoftwareengineermainlyfocusedondistributedsystemsdevelopmentandVRPsolutions
https://ua.linkedin.com/in/skyfenko
Page 3
Agenda
• WhatisVRP?• VRPcharacteristicsandgoals• VRPtypes:fromsimplicitytocomplexity• OptaPlanner andjsprit• Q&A
Page 4
WhatdoesVRPstandfor?
• VRPisoneofthemostpopularconstraintsatisfactionproblemsintheareasoftransportation,deliveryandlogistics• ThemainpurposeistodesignatleastonerouteforKvehicleswithLcapacityeachtodelivergoodsfromMdepotstoNcustomersinordertomeetthegivenconstraintsandtimewindows.• Effectiveutilizationofresources(vehicles)candecreasetransportationcostssignificantly
Page 5
VRPcharacteristics
Page 6
Depot
TimeWindows
Location
Page 7
Customer
TimeWindows
Location Accessibility
Demands
Page 8
Vehicle
TimeWindows Returntodepot
Capacity Driverrestperiod
Page 9
Route
Totalelapsedtime Timedelays
TotaldistanceTotalcost
Page 10
VRPgoals
Totalelapsedtime Totaldistance Totalcost
Totalconsumedfuel Fleetofvehicles
Page 11
VRPgoals
Totalprofit Customershappiness
Page 12
VehicleRoutingProblemtypes
Page 13
1.TravellingSalesmanProblem
Page 14
Thesimplestone- TSP
Page 19
3.VRPwithmultipledepots
Page 20
VRPwithmultipledepots
Page 22
4.SplitDeliveryVRP
Page 31
7.VRPwithTimeWindows
Page 32
VRPwithTimeWindows
Page 39
Similartohard/softconstraints
Page 43
GoogleDirectionsAPI
Page 44
GoogleDirectionsAPI
• Disadvantages:• 2,500freedirectionsrequestsperday• Upto23waypointsallowedineachrequestcontaininganAPIkey• Upto8waypointswhennoAPIkeyissupplied• 10requestspersecond• Optimizationbasedontrafficjamsandroadsinfoonly
Page 47
jsprit
• jsprit• cansolveproblemswithpickupsanddeliveries,backhauls,heterogeneousfleets,finiteandinfinitefleets,multipledepots,timewindows,openroutes,differentstartandendlocations,multiplecapacitydimensions,initialloads,skills…• allowsyoutodefineadditionalstateful andstatelessconstraintstoaccountfortherichnessofyourproblem.• isbenchmarkedagainstclassicalVRPinstances(e.g.Solomoninstances).• isreleasedunderLGPL(v3).
Page 49
HowtocopewithVRPeffectively
• Don’tuseMDVRPwhencustomersaremostlyclusteredaroundonedepot• Themoreconstraintsyouhave,thelessprobabilityyousolveVRP• Don’tdefinecontroversialconstraintswiththesamestrength• Dohaveacodetosatisfyhardconstraintsfirst,thensoftones.• Usepositiveconstraintstomaximizevariableandnegativeones– tominimize
Page 50
Thankyouforattention
Page 51
References
• https://github.com/graphhopper/jsprit• http://jsprit.github.io/• https://github.com/droolsjbpm/optaplanner• http://www.diku.dk/hjemmesider/ansatte/sropke/Papers/PHDThesis.pdf• https://docs.jboss.org/optaplanner/release/latest/optaplanner-docs/html_single