I recently participated in a hackathon in Germany, where I chose to work on a logistics challenge for a company. I have always been interested in optimization problems and wanted to apply AI methods to something with real value for industry. This was the perfect opportunity to explore something which affects scores of companies across the world.
The task was to plan overnight deliveries to branches from a central distribution center and two hubs while following a set of delivery and driving rules. The project shows how practical and relevant classical optimization methods are for solving real business problems.
A central distribution center (DC) and two regional hubs supply 174 branches overnight, five nights a week. The goal is the cheapest weekly plan, paid per kilometer and per stop, that gets every delivery to its branch on time.
Freight is ready at the DC at 20:00, every branch must be delivered by 08:00, and each stop takes 15 minutes to unload.
Drivers take a 45-minute break after 4.5 hours of driving and drive at most 9 hours a day. Each vehicle has one driver and returns to its depot.
Vans can carry 5 units and cost €1/km plus €10 per stop. Trucks can carry 38 containers and cost €3/km plus €15 per stop, drive 20% slower, and can't reach 57 of the branches.
Each branch's weekly demand is split by appointment day and lead time into 17,722 demand packets, each with the days it may travel on.
The data is synthetic and anonymized from the one received in hackathon, to ensure fair use of my intellectual property without compromising any company data.
Road distances and driving times are taken from OpenStreetMap, via OSRM (built by researchers from Karlsruhe).
A Mixed-Integer Linear Program (MILP) picks each branch's delivery days.
OR-Tools builds the van and truck tours, and a hybrid genetic search algorithm improves them.
Every tour is re-driven leg by leg to check breaks, driving time, capacity and the 08:00 deadline.