Crew-capacity scheduling with cumulative (CP-SAT)
Input
{
"constraints": [
{
"capacity": 4,
"intervals": [
{
"demand": 2,
"duration": 3,
"start_var": "s_pour"
},
{
"demand": 3,
"duration": 2,
"start_var": "s_frame"
},
{
"demand": 1,
"duration": 4,
"start_var": "s_wire"
},
{
"demand": 3,
"duration": 2,
"start_var": "s_plumb"
},
{
"demand": 2,
"duration": 3,
"start_var": "s_roof"
},
{
"demand": 3,
"duration": 1,
"start_var": "s_paint"
}
],
"type": "cumulative"
},
{
"op": ">=",
"rhs": 3,
"terms": [
{
"coeff": 1,
"var": "s_frame"
},
{
"coeff": -1,
"var": "s_pour"
}
],
"type": "linear"
},
{
"op": ">=",
"rhs": 2,
"terms": [
{
"coeff": 1,
"var": "s_roof"
},
{
"coeff": -1,
"var": "s_frame"
}
],
"type": "linear"
},
{
"op": ">=",
"rhs": 3,
"terms": [
{
"coeff": 1,
"var": "s_plumb"
},
{
"coeff": -1,
"var": "s_pour"
}
],
"type": "linear"
},
{
"op": ">=",
"rhs": 3,
"terms": [
{
"coeff": 1,
"var": "s_paint"
},
{
"coeff": -1,
"var": "s_roof"
}
],
"type": "linear"
},
{
"op": ">=",
"rhs": 3,
"terms": [
{
"coeff": 1,
"var": "makespan"
},
{
"coeff": -1,
"var": "s_pour"
}
],
"type": "linear"
},
{
"op": ">=",
"rhs": 2,
"terms": [
{
"coeff": 1,
"var": "makespan"
},
{
"coeff": -1,
"var": "s_frame"
}
],
"type": "linear"
},
{
"op": ">=",
"rhs": 4,
"terms": [
{
"coeff": 1,
"var": "makespan"
},
{
"coeff": -1,
"var": "s_wire"
}
],
"type": "linear"
},
{
"op": ">=",
"rhs": 2,
"terms": [
{
"coeff": 1,
"var": "makespan"
},
{
"coeff": -1,
"var": "s_plumb"
}
],
"type": "linear"
},
{
"op": ">=",
"rhs": 3,
"terms": [
{
"coeff": 1,
"var": "makespan"
},
{
"coeff": -1,
"var": "s_roof"
}
],
"type": "linear"
},
{
"op": ">=",
"rhs": 1,
"terms": [
{
"coeff": 1,
"var": "makespan"
},
{
"coeff": -1,
"var": "s_paint"
}
],
"type": "linear"
}
],
"objective": {
"sense": "minimize",
"terms": [
{
"coeff": 1,
"var": "makespan"
}
]
},
"timeout_ms": 3000,
"variables": [
{
"max": 15,
"min": 0,
"name": "s_pour"
},
{
"max": 15,
"min": 0,
"name": "s_frame"
},
{
"max": 15,
"min": 0,
"name": "s_wire"
},
{
"max": 15,
"min": 0,
"name": "s_plumb"
},
{
"max": 15,
"min": 0,
"name": "s_roof"
},
{
"max": 15,
"min": 0,
"name": "s_paint"
},
{
"max": 15,
"min": 0,
"name": "makespan"
}
]
}Output
Build-time verified. stats.elapsed_ms normalized to 0.
{
"best_bound": 11,
"objective_value": 11,
"solution": {
"makespan": 11,
"s_frame": 3,
"s_paint": 10,
"s_plumb": 8,
"s_pour": 0,
"s_roof": 5,
"s_wire": 0
},
"stats": {
"elapsed_ms": 0,
"timed_out": false
},
"unsat_core": null,
"verdict": "optimal",
"verified": true
}Request
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/solve/cpsat -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"s_pour","min":0,"max":15},{"name":"s_frame","min":0,"max":15},{"name":"s_wire","min":0,"max":15},{"name":"s_plumb","min":0,"max":15},{"name":"s_roof","min":0,"max":15},{"name":"s_paint","min":0,"max":15},{"name":"makespan","min":0,"max":15}],"constraints":[{"type":"cumulative","intervals":[{"start_var":"s_pour","duration":3,"demand":2},{"start_var":"s_frame","duration":2,"demand":3},{"start_var":"s_wire","duration":4,"demand":1},{"start_var":"s_plumb","duration":2,"demand":3},{"start_var":"s_roof","duration":3,"demand":2},{"start_var":"s_paint","duration":1,"demand":3}],"capacity":4},{"type":"linear","terms":[{"var":"s_frame","coeff":1},{"var":"s_pour","coeff":-1}],"op":">=","rhs":3},{"type":"linear","terms":[{"var":"s_roof","coeff":1},{"var":"s_frame","coeff":-1}],"op":">=","rhs":2},{"type":"linear","terms":[{"var":"s_plumb","coeff":1},{"var":"s_pour","coeff":-1}],"op":">=","rhs":3},{"type":"linear","terms":[{"var":"s_paint","coeff":1},{"var":"s_roof","coeff":-1}],"op":">=","rhs":3},{"type":"linear","terms":[{"var":"makespan","coeff":1},{"var":"s_pour","coeff":-1}],"op":">=","rhs":3},{"type":"linear","terms":[{"var":"makespan","coeff":1},{"var":"s_frame","coeff":-1}],"op":">=","rhs":2},{"type":"linear","terms":[{"var":"makespan","coeff":1},{"var":"s_wire","coeff":-1}],"op":">=","rhs":4},{"type":"linear","terms":[{"var":"makespan","coeff":1},{"var":"s_plumb","coeff":-1}],"op":">=","rhs":2},{"type":"linear","terms":[{"var":"makespan","coeff":1},{"var":"s_roof","coeff":-1}],"op":">=","rhs":3},{"type":"linear","terms":[{"var":"makespan","coeff":1},{"var":"s_paint","coeff":-1}],"op":">=","rhs":1}],"objective":{"sense":"minimize","terms":[{"var":"makespan","coeff":1}]},"timeout_ms":3000}'