K-Means Fleet Order Assignment

Overview

A K-Means-based assignment engine that distributes delivery orders from multiple vendors across a fleet of riders, encoding the client's business rules into the clustering and ranking logic. Replaced a team of human dispatchers and dramatically increased throughput. Outcome: Scaled daily order assignment from ~1,000 to ~4,000 orders per day while reducing the dispatch team's workload.

Architecture & Pipeline

flowchart LR
    n0["
Open Orders + Riders
MongoDB
"] n1["
Feature Build
Location · capacity · time
"] n2["
K-Means Clustering
Scikit-learn
"] n3["
Business-Rule Filter
Vendor & SLA constraints
"] n4["
Rider–Order Assignment
4× throughput vs manual
"] n0 --> n1 n1 --> n2 n2 --> n3 n3 --> n4 classDef step0 fill:#f1f5f9,stroke:#64748b,color:#1e293b,stroke-width:2px,rx:10,ry:10; classDef step1 fill:#ecfeff,stroke:#06b6d4,color:#1e293b,stroke-width:2px,rx:10,ry:10; classDef step2 fill:#f0fdfa,stroke:#0d9488,color:#1e293b,stroke-width:2px,rx:10,ry:10; classDef step3 fill:#ecfdf5,stroke:#10b981,color:#1e293b,stroke-width:2px,rx:10,ry:10; classDef step4 fill:#fffbeb,stroke:#f59e0b,color:#1e293b,stroke-width:2px,rx:10,ry:10; class n0 step0; class n1 step1; class n2 step2; class n3 step3; class n4 step4;

End-to-end flow derived from this project's scope and tech stack. Tap View Fullscreen for a larger view, or scroll horizontally on small screens.

Key Features

  • K-Means clustering with embedded business rules
  • Multi-vendor, multi-rider assignment logic
  • Production deployment on top of MongoDB
  • 4× throughput improvement vs. manual dispatch
  • Tech Stack:** Python, Scikit-learn, MongoDB