Skip to content

Add CP-SAT AddCumulative-like constraint where capacity can be different over periods of time #4331

@alex-klimov

Description

@alex-klimov

What language and solver does this apply to?
C++ / CP-SAT

Describe the problem you are trying to solve.
Current implementation of AddCumulative assumes capacity as a constant or LinearExpr. In my case the capacity changes over period of time. Capacity can be pre-computed; it doesn't need to be modeled as a function from t.

No performant solution is found yet with available set of constraints.

Describe the solution you'd like
Override for AddCumulative constraint or a new type of similar constraint, where capacity can be defined as static map from time interval to constant.

Describe alternatives you've considered
No viable performant alternative is discovered within CP-SAT framework yet. Internet search pointed to other people with similar problem, alas I didn't find a solution yet.

Additional context
Depending on the scope of the change I might be able to code this myself and contribute to CP-SAT. I hope that following the implementation path of AddCumulative constraint would be a good guide. And with relatively limited increase of capacity from a constant to an array of constants - new constraint will be performant enough.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions