Fairness - balance number of locations serviced per vehicle
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 28/100
Research direction
No file or test is named. Start by locating the vehicle-routing model and its optional-constraint configuration, then inspect how the underlying solver exposes Distribute, Deviation, and finalizer minimization. Done means an optional flag enables balanced per-vehicle location counts and the solver minimizes their deviation.
Written by the indexing model from the issue text.
Description
We want to be able to balance the number of locations serviced by each vehicle to be as even as possible. The use-case is for example drivers who are getting paid (at least partially) by number of deliveries.
This constraint should be behind a flag and optional.
Implementation: use the underlying solver to
- Establish a vehicle vars <-> vehicle counts relationship via the
Distributeconstraint - Add a
Deviationconstraint for vehicle counts targeting thedeviationvar - Minimizing the
deviationvar
Roughly as follows:
std::vector<IntVar*> vehicleCounts;
for (auto vehicle = 0; vehicle < numVehicles; ++vehicle)
vehicleCounts.push_back(solver->MakeIntVar(0, numNodes));
solver->AddConstraint(solver->MakeDistribute(vehicleVars, vehicleCounts));
auto* deviationVar = solver->MakeIntVar(0, numNodes * numNodes);
solver->AddConstraint(solver->MakeDeviation(vehicleCounts, deviationVar, numNodes));
model.AddVariableMinimizedByFinalizer(deviationVar);
- Dominant language
- C++
- Stars
- 155
- Forks
- 47
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mapbox/node-or-tools
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
mapbox/node-or-tools#84 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
mapbox/node-or-tools#82 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
mapbox/node-or-tools#81 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
mapbox/node-or-tools#80 ·
-
Windows build Open
Difficulty 5/5 Over a week Newbie friendliness 15/100
mapbox/node-or-tools#77 · 5 reactions ·
All issues in mapbox/node-or-tools
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ros2/message_filters#338 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
subsurface/subsurface#4984 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
google-ai-edge/LiteRT-LM#3739 ·