grid.min

grid.min(array)[source]

Return an expression evaluating to the element-wise minimum of inputs.

Parameters:

array (list of Expr, Var, or numeric) – Inputs to compare. Python literals are wrapped automatically.

Returns:

Expression representing min(array).

Return type:

Expr

Examples

>>> import grid
>>> model = grid.RoutingModel()
>>> vehicle = model.add_vehicle_type(id=0, count=1, capacity=10)
>>> load = vehicle.add_integer_var(initial_value=10)
>>> grid.min([load, 5])
Expr(min, Var_0, Const_5, integer)