Inspiration

DDI Mollet's logistics team starts every morning the same way: a planner manually assigns routes on a spreadsheet, warehouse workers load trucks by memory, and drivers navigate with their phones on their own. We watched a 16-truck operation run on intuition and paper. The inefficiency was visible — trucks over 8 hours, wrong loading order, clients missed. We wanted to replace intuition with intelligence, end to end.

What it does

Pitiflis is a complete logistics system in three layers:

Route optimizer — an AI engine (Simulated Annealing over a real VRP) that generates daily routes for the entire fleet in seconds. It respects time windows per client, enforces a strict 8-hour working day, minimizes CO₂ emissions, and penalizes fragile/heavy stacking violations.

Warehouse manager — a supervisor dashboard that shows every vehicle's loading plan. Each pallet gets a 3D visualization (cabinet oblique SVG) showing exactly which products go where, in which order, column by column. Workers see the LIFO sequence: last delivery = first loaded = deepest in truck.

Driver app — a mobile-first interface that shows the stop-by-stop route with a live Leaflet map. One tap opens Google Maps with all stops pre-loaded as waypoints, ready to navigate. Handles multi-trip routes with warehouse reload steps in between.

How we built it

  • Python backend: Clarke-Wright savings heuristic for initial solution, Simulated Annealing for optimization, K-Medoids clustering for geographic zone assignment, custom cost function with time windows, parking search time, stacking penalties and daily cap enforcement
  • Real data: 1,489 product references from ZM040.xlsx cross-referenced for pallet dimensions, delivery schedules from Horarios Entrega.xlsx, full order dataset from Hackaton.xlsx
  • Three frontend apps: Pure HTML/CSS/JS, no frameworks. 3D pallet diagrams built from scratch in SVG using cabinet oblique projection
  • Google Maps integration: Multi-stop URL builder that handles up to 9 waypoints via the official API and falls back to slash format for longer routes
  • No external dependencies beyond Leaflet for the map tile layer

Challenges we ran into

8-hour cap enforcement was the hardest constraint. SA alone kept producing routes over time. We had to implement a two-layer solution: conservative time estimation during cluster assignment, plus a post-processing _enforce_daily_cap() pass that drops overflow trips and redistributes stops to vehicles with remaining capacity.

LIFO ordering connects two modules that normally don't talk: the route optimizer decides delivery sequence, the warehouse module decides loading order. Getting them to share a consistent representation required fixing a serializer bug — Python id(trip) object identity vs. list iteration was silently producing wrong trip→cluster mappings.

3D in SVG with no library. Multiple iterations from flat layers → Rubik's cube grid → realistic column-based stacking. Getting the cabinet oblique projection, painter's algorithm, and label placement to all work together took significant trial and error.

Accomplishments that we're proud of

  • Zero vehicles over 8 hours across a full week of routes (max 7.98h)
  • Full end-to-end pipeline: raw Excel files in → interactive dashboards out
  • 3D pallet visualization in pure SVG — no WebGL, no canvas, no libraries. Width proportional to floor area, lit top edges, centered product labels, color legend
  • Google Maps deep link that opens with all stops pre-loaded, handling routes up to 23 stops across multiple trips
  • Real product data: 888 of 1,489 Damm references cross-referenced with actual boxes-per-pallet values from ZM040

What we learned

VRP is NP-hard on paper. Add real-world constraints — LIFO, fragility, time windows, daily caps, multi-trip reloads — and the solution space becomes something SA can barely explore in hackathon time. Good heuristics beat perfect algorithms when the clock is ticking.

We also learned that the warehouse and the route are the same problem. Loading order determines delivery order determines route cost. Systems that optimize them separately leave efficiency on the table.

And that SVG is criminally underrated for data visualization.

What's next for Pitiflis

  • Live GPS tracking — drivers report position in real time, ETA updates propagate to clients automatically
  • Return flow optimization — the 15% reserved pallet space for empty returns is currently fixed; a second-pass optimizer could minimize return trips
  • Dynamic re-routing — if a client is closed or a delivery fails, the system re-sequences remaining stops on the fly
  • ERP integration — connect directly to Damm's SAP to pull orders automatically instead of from Excel files
  • Fleet electrification modeling — swap CO₂ penalty weights for real EV range constraints as DDI transitions to electric vehicles
Share this project:

Updates