Branch and Bound in or-tools works via a search monitor
In detail:
m = slv.Minimize(<variable>, <step>) # Minimization
m = slv.Maximize(<variable>, <step>) # Maximization
...
slv.NewSearch(<dec builder>, [m, <other mon.>])
Instead of a cost function, we have a cost variable
The <step>
parameter represents the required improvement
z≤zbest−step
Reified constraints in or-tools
We just need to use the constraint as a term in an expression
expr = 2 * (x <= y)
(x <= y)
represents the feasibility state of x≤y
Just a word of warning:
The sum
function in python repeatedl applies +
+
is redefined in or-tools...sum
to build expressionsIn python min
and max
are functions, not operators
slv.Min(<expr/var>, <expr/var>) # Binary min
slv.Min(<list of vars>) # Min with many terms
slv.Max(<expr/var>, <expr/var>) # Binary max
slv.Max(<list of vars>) # Max with many terms
A small company can produce a number of product types
A small company can produce a number of product types
The company has received a number of orders
Some pairs of products ⟨p1,p2⟩
are associated to a setup time:
p1
, before switching to p2
A small company can produce a number of product types
Goal: