vehicle routing problem: how to solve it in java?

52
Vehicle Routing Problem: how to solve it in Java? By Stanislav Kyfenko

Upload: stanislav-kyfenko

Post on 17-Feb-2017

374 views

Category:

Engineering


1 download

TRANSCRIPT

VehicleRoutingProblem:howtosolveitinJava?

ByStanislavKyfenko

StanislavKyfenko• TechnicalLeadatSoftServe• SoftwareengineermainlyfocusedondistributedsystemsdevelopmentandVRPsolutions

https://ua.linkedin.com/in/skyfenko

Agenda

• WhatisVRP?• VRPcharacteristicsandgoals• VRPtypes:fromsimplicitytocomplexity• OptaPlanner andjsprit• Q&A

WhatdoesVRPstandfor?

• VRPisoneofthemostpopularconstraintsatisfactionproblemsintheareasoftransportation,deliveryandlogistics• ThemainpurposeistodesignatleastonerouteforKvehicleswithLcapacityeachtodelivergoodsfromMdepotstoNcustomersinordertomeetthegivenconstraintsandtimewindows.• Effectiveutilizationofresources(vehicles)candecreasetransportationcostssignificantly

VRPcharacteristics

Depot

TimeWindows

Location

Customer

TimeWindows

Location Accessibility

Demands

Vehicle

TimeWindows Returntodepot

Capacity Driverrestperiod

Route

Totalelapsedtime Timedelays

TotaldistanceTotalcost

VRPgoals

Totalelapsedtime Totaldistance Totalcost

Totalconsumedfuel Fleetofvehicles

VRPgoals

Totalprofit Customershappiness

VehicleRoutingProblemtypes

1.TravellingSalesmanProblem

Thesimplestone- TSP

2.CapacitatedVRP

CapacitatedVRP

3.VRPwithmultipledepots

VRPwithmultipledepots

4.SplitDeliveryVRP

SplitDeliveryVRP

5.PeriodicVRP

PeriodicVRP

6.StochasticVRP

StochasticVRP

7.VRPwithTimeWindows

VRPwithTimeWindows

OptaPlanner

OptaPlanner

OptaPlanner

Sample

Sample

Similartohard/softconstraints

Samle

GoogleDirectionsAPI

GoogleDirectionsAPI

• Disadvantages:• 2,500freedirectionsrequestsperday• Upto23waypointsallowedineachrequestcontaininganAPIkey• Upto8waypointswhennoAPIkeyissupplied• 10requestspersecond• Optimizationbasedontrafficjamsandroadsinfoonly

OptaPlanner demo

jsprit

jsprit

• jsprit• cansolveproblemswithpickupsanddeliveries,backhauls,heterogeneousfleets,finiteandinfinitefleets,multipledepots,timewindows,openroutes,differentstartandendlocations,multiplecapacitydimensions,initialloads,skills…• allowsyoutodefineadditionalstateful andstatelessconstraintstoaccountfortherichnessofyourproblem.• isbenchmarkedagainstclassicalVRPinstances(e.g.Solomoninstances).• isreleasedunderLGPL(v3).

jsprit demo

HowtocopewithVRPeffectively

• Don’tuseMDVRPwhencustomersaremostlyclusteredaroundonedepot• Themoreconstraintsyouhave,thelessprobabilityyousolveVRP• Don’tdefinecontroversialconstraintswiththesamestrength• Dohaveacodetosatisfyhardconstraintsfirst,thensoftones.• Usepositiveconstraintstomaximizevariableandnegativeones– tominimize

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

Thankyouforattention!

Mycontacts

• https://ua.linkedin.com/in/skyfenko

• stanislav.kyfenko

[email protected]