mapbox / node-or-tools

Node.js bindings for or-tools vehicle routing problems
MIT License
146 stars 48 forks source link

Soft time and capacity bounds, potentially with penalty #7

Open daniel-j-h opened 7 years ago

daniel-j-h commented 7 years ago

We should allow for the user to not only add hard bounds (think: time window of 10am--11am, or a specific capacity) but also soft bounds which will add proportionally to the solution's cost if exceeded.

Use-case: think of a hard time window of 10am--1am. Maybe we want to be on time as often as possible. We could set a soft upper bound e.g. of 10:15am adding a penalty proportional to how late we are)


Implementation: see RoutingDimension type's Soft member functions adding penalties to the cost.