optapy / optapy

OptaPy is an AI constraint solver for Python to optimize planning and scheduling problems.

Home Page:https://www.optapy.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for "dropped nodes"?

bilics opened this issue · comments

Hello,

I am currently testing a situation where most of the customer's demands are higher than any vehicle capacity (using the default constraints provided by the vehicle routing example)

The results are interesting since it show that most vehicles are allocated "over capacity" - is this expected behavior?

Thanks!

I did find something the documentation here for over-constrained planning.

Over Constrained Planning

Regarding the vehicle planning example, I am not sure how use the nullable = true option since it uses a @planning_list_variable instead of a @planning_variable - which does not support that option.

Thanks!

That is expected behavior, since all customers MUST be assigned with @planning_list_variable. In this case, the best solution would be infeasible (since it would be impossible to assign each customer to a vehicle without breaking hard constraints).

To handled overconstrained planning with @planning_list_variable, you can do "Overconstrained planning with virtual values" as explained in https://www.optapy.org/docs/latest/repeated-planning/repeated-planning.html#overconstrainedPlanningWithVirtualValues ; basically, you add a "virtual" vehicle, which is not affected by hard constraints, and penalize by 1 medium for each customer assigned to the virtual vehicle.

For a normal @planning_variable both "Overconstrained planning with nullable variables" (which you linked above) and "Overconstrained planning with virtual values" can be used.