From adf5205cda785b64f2c23dbe252eae051ef8b2a0 Mon Sep 17 00:00:00 2001 From: Martin Date: Sun, 12 May 2024 15:25:03 -0400 Subject: [PATCH] Add Variable.create_fixed, support expressions for variable bounds, improve set printing, denser .lp files (#53) * Minor improvements * Add support for expression upper bound and strict __setattr__ * Add support for variables fixed to an expression * Improve set printing * Rename variable method * Improved file writing * Reformat with black --- .gitignore | 3 +- README.md | 6 + gurobi.log | 6 - pyproject.toml | 2 +- src/pyoframe/constants.py | 2 + src/pyoframe/constraints.py | 21 +- src/pyoframe/io.py | 39 +- src/pyoframe/model.py | 36 +- src/pyoframe/model_element.py | 11 +- src/pyoframe/util.py | 33 + src/pyoframe/variables.py | 38 +- .../results/pyoframe-problem.lp | 1201 ++--------------- .../diet_problem/input_data/foods.csv | 20 +- tests/examples/diet_problem/model.py | 6 +- tests/examples/diet_problem/model_gurobipy.py | 2 +- tests/examples/diet_problem/results/buy.csv | 6 +- .../examples/diet_problem/results/gurobipy.lp | 12 +- .../diet_problem/results/gurobipy.sol | 9 +- .../diet_problem/results/max_nutrients.csv | 4 +- .../diet_problem/results/min_nutrients.csv | 4 +- .../diet_problem/results/pyoframe-problem.lp | 19 +- .../diet_problem/results/pyoframe-problem.sol | 8 +- .../facility_problem/results/gurobipy.lp | 1 + .../results/pyoframe-problem.lp | 31 +- tests/test_examples.py | 10 +- 25 files changed, 299 insertions(+), 1231 deletions(-) delete mode 100644 gurobi.log diff --git a/.gitignore b/.gitignore index c3a786e..d964e7f 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ tmp .coverage .cache docs/reference -dist \ No newline at end of file +dist +*.log \ No newline at end of file diff --git a/README.md b/README.md index 302449f..30ed67b 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,9 @@ Contributions are welcome! See [`CONTRIBUTE.md`](./CONTRIBUTE.md). ## Acknowledgments Martin Staadecker first created this library while working for [Bravos Power](https://www.bravospower.com/) The library takes inspiration from Linopy and Pyomo, two prior libraries for optimization for which we are thankful. + +## Troubleshooting Common Errors + +### `datatypes of join keys don't match` + +Often, this error indicates that two dataframes in your inputs representing the same dimension have different datatypes (e.g. 16bit integer and 64bit integer). This is not allowed and you should ensure for the same dimensions, datatypes are identical. \ No newline at end of file diff --git a/gurobi.log b/gurobi.log deleted file mode 100644 index 821a721..0000000 --- a/gurobi.log +++ /dev/null @@ -1,6 +0,0 @@ - -Gurobi 11.0.0 (win64, Python) logging started Wed Mar 13 18:48:48 2024 - -Set parameter Username -Set parameter LogFile to value "gurobi.log" -Academic license - for non-commercial use only - expires 2025-02-10 diff --git a/pyproject.toml b/pyproject.toml index 9565c3f..6d9026a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Natural Language :: English", ] -dependencies = ["polars==0.20.13", "numpy", "pyarrow", "pandas"] +dependencies = ["polars", "numpy", "pyarrow", "pandas", "tqdm"] [project.optional-dependencies] dev = [ diff --git a/src/pyoframe/constants.py b/src/pyoframe/constants.py index 107660c..39bdae9 100644 --- a/src/pyoframe/constants.py +++ b/src/pyoframe/constants.py @@ -50,6 +50,8 @@ class Config(metaclass=_ConfigMeta): disable_unmatched_checks: bool = False print_float_precision: Optional[int] = 5 print_uses_variable_names: bool = True + # Number of elements to show when printing a set to the console (additional elements are replaced with ...) + print_max_set_elements: int = 50 @classmethod def reset_defaults(cls): diff --git a/src/pyoframe/constraints.py b/src/pyoframe/constraints.py index 8dc7549..cd91c12 100644 --- a/src/pyoframe/constraints.py +++ b/src/pyoframe/constraints.py @@ -35,6 +35,7 @@ get_obj_repr, parse_inputs_as_iterable, unwrap_single_values, + dataframe_to_tupled_list, ) from pyoframe.model_element import ( @@ -248,7 +249,9 @@ def __repr__(self): return ( get_obj_repr(self, ("name",), size=self.data.height, dimensions=self.shape) + "\n" - + self.to_expr().to_str(max_line_len=80, max_rows=10) + + dataframe_to_tupled_list( + self.data, num_max_elements=Config.print_max_set_elements + ) ) @staticmethod @@ -375,18 +378,18 @@ def map(self, mapping_set: SetTypes, drop_shared_dims: bool = True): >>> import polars as pl >>> from pyoframe import Variable, Model - >>> pop_data = pl.DataFrame({"city": ["Toronto", "Vancouver", "Boston"], "population": [10, 2, 8]}).to_expr() + >>> pop_data = pl.DataFrame({"city": ["Toronto", "Vancouver", "Boston"], "year": [2024, 2024, 2024], "population": [10, 2, 8]}).to_expr() >>> cities_and_countries = pl.DataFrame({"city": ["Toronto", "Vancouver", "Boston"], "country": ["Canada", "Canada", "USA"]}) >>> pop_data.map(cities_and_countries) - - [Canada]: 12 - [USA]: 8 + + [2024,Canada]: 12 + [2024,USA]: 8 >>> pop_data.map(cities_and_countries, drop_shared_dims=False) - - [Toronto,Canada]: 10 - [Vancouver,Canada]: 2 - [Boston,USA]: 8 + + [Toronto,2024,Canada]: 10 + [Vancouver,2024,Canada]: 2 + [Boston,2024,USA]: 8 """ mapping_set = Set(mapping_set) diff --git a/src/pyoframe/io.py b/src/pyoframe/io.py index 7d7d6cf..676c0e9 100644 --- a/src/pyoframe/io.py +++ b/src/pyoframe/io.py @@ -6,6 +6,7 @@ from tempfile import NamedTemporaryFile from pathlib import Path from typing import TYPE_CHECKING, Iterable, Optional, TypeVar, Union +from tqdm import tqdm from pyoframe.constants import CONST_TERM, VAR_KEY from pyoframe.constraints import Constraint @@ -39,7 +40,9 @@ def objective_to_file(m: "Model", f: TextIOWrapper, var_map): def constraints_to_file(m: "Model", f: TextIOWrapper, var_map, const_map): - for constraint in create_section(m.constraints, f, "s.t."): + for constraint in create_section( + tqdm(m.constraints, desc="Writing constraints to file"), f, "s.t." + ): f.writelines(constraint.to_str(var_map=var_map, const_map=const_map) + "\n") @@ -55,17 +58,25 @@ def bounds_to_file(m: "Model", f, var_map): ) f.write(f"{var_map.apply(const_term_df).item()} = 1\n") - for variable in m.variables: - lb = f"{variable.lb:.12g}" - ub = f"{variable.ub:.12g}" + for variable in tqdm(m.variables, desc="Writing bounds to file"): + terms = [] + + if variable.lb != 0: + terms.append(pl.lit(f"{variable.lb:.12g} <= ")) + + terms.append(VAR_KEY) + + if variable.ub != float("inf"): + terms.append(pl.lit(f" <= {variable.ub:.12g}")) + + terms.append(pl.lit("\n")) + + if len(terms) < 3: + continue df = ( var_map.apply(variable.data, to_col=None) - .select( - pl.concat_str( - pl.lit(f"{lb} <= "), VAR_KEY, pl.lit(f" <= {ub}\n") - ).str.concat("") - ) + .select(pl.concat_str(terms).str.concat("")) .item() ) @@ -76,7 +87,9 @@ def binaries_to_file(m: "Model", f, var_map: Mapper): """ Write out binaries of a model to a lp file. """ - for variable in create_section(m.binary_variables, f, "binary"): + for variable in create_section( + tqdm(m.binary_variables, "Writing binary variables to file"), f, "binary" + ): lines = ( var_map.apply(variable.data, to_col=None) .select(pl.col(VAR_KEY).str.concat("\n")) @@ -89,7 +102,9 @@ def integers_to_file(m: "Model", f, var_map: Mapper): """ Write out integers of a model to a lp file. """ - for variable in create_section(m.integer_variables, f, "general"): + for variable in create_section( + tqdm(m.integer_variables, "Writing integer variables to file"), f, "general" + ): lines = ( var_map.apply(variable.data, to_col=None) .select(pl.col(VAR_KEY).str.concat("\n")) @@ -155,6 +170,6 @@ def to_file( bounds_to_file(m, f, var_map) binaries_to_file(m, f, var_map) integers_to_file(m, f, var_map) - f.write("end\n") + f.write("\nend\n") return file_path diff --git a/src/pyoframe/model.py b/src/pyoframe/model.py index 9f81f9f..66bf0c2 100644 --- a/src/pyoframe/model.py +++ b/src/pyoframe/model.py @@ -1,5 +1,5 @@ from typing import Any, Iterable, List, Optional -from pyoframe.constants import ObjSense, VType, Config, Result +from pyoframe.constants import ObjSense, VType, Config, Result, PyoframeError from pyoframe.constraints import SupportsMath from pyoframe.io_mappers import NamedVariableMapper, IOMappers from pyoframe.model_element import ModelElement @@ -9,6 +9,8 @@ from pyoframe.variables import Variable from pyoframe.io import to_file from pyoframe.solvers import solve, Solver +import polars as pl +import pandas as pd class Model(AttrContainerMixin): @@ -16,6 +18,20 @@ class Model(AttrContainerMixin): Represents a mathematical optimization model. Add variables, constraints, and an objective to the model by setting attributes. """ + _reserved_attributes = [ + "_variables", + "_constraints", + "_objective", + "var_map", + "io_mappers", + "name", + "solver", + "solver_model", + "params", + "result", + "attr", + ] + def __init__(self, name=None, **kwargs): super().__init__(**kwargs) self._variables: List[Variable] = [] @@ -62,6 +78,13 @@ def minimize(self): return self.objective def __setattr__(self, __name: str, __value: Any) -> None: + if __name not in Model._reserved_attributes and not isinstance( + __value, (ModelElement, pl.DataFrame, pd.DataFrame) + ): + raise PyoframeError( + f"Cannot set attribute '{__name}' on the model because it isn't of type ModelElement (e.g. Variable, Constraint, ...)" + ) + if __name in ("maximize", "minimize"): assert isinstance( __value, SupportsMath @@ -71,24 +94,25 @@ def __setattr__(self, __name: str, __value: Any) -> None: self._objective._model = self return - if isinstance(__value, ModelElement) and not __name.startswith("_"): + if ( + isinstance(__value, ModelElement) + and __name not in Model._reserved_attributes + ): assert not hasattr( self, __name ), f"Cannot create {__name} since it was already created." - __value.name = __name - __value._model = self + __value.on_add_to_model(self, __name) if isinstance(__value, Objective): assert self.objective is None, "Cannot create more than one objective." self._objective = __value - if isinstance(__value, Variable): + elif isinstance(__value, Variable): self._variables.append(__value) if self.var_map is not None: self.var_map.add(__value) elif isinstance(__value, Constraint): self._constraints.append(__value) - return super().__setattr__(__name, __value) def __repr__(self) -> str: diff --git a/src/pyoframe/model_element.py b/src/pyoframe/model_element.py index c64faaa..bbc316b 100644 --- a/src/pyoframe/model_element.py +++ b/src/pyoframe/model_element.py @@ -39,6 +39,10 @@ def __init__(self, data: pl.DataFrame, **kwargs) -> None: self.name = None super().__init__(**kwargs) + def on_add_to_model(self, model: "Model", name: str): + self.name = name + self._model = model + @property def data(self) -> pl.DataFrame: return self._data @@ -106,7 +110,11 @@ def _support_polars_method(method_name: str): """ def method(self: "SupportPolarsMethodMixin", *args, **kwargs): - return self._new(getattr(self.data, method_name)(*args, **kwargs)) + result_from_polars = getattr(self.data, method_name)(*args, **kwargs) + if isinstance(result_from_polars, pl.DataFrame): + return self._new(result_from_polars) + else: + return result_from_polars return method @@ -115,6 +123,7 @@ class SupportPolarsMethodMixin: rename = _support_polars_method("rename") with_columns = _support_polars_method("with_columns") filter = _support_polars_method("filter") + estimated_size = _support_polars_method("estimated_size") @abstractmethod def _new(self, data: pl.DataFrame): diff --git a/src/pyoframe/util.py b/src/pyoframe/util.py index 3fded14..b64e033 100644 --- a/src/pyoframe/util.py +++ b/src/pyoframe/util.py @@ -229,3 +229,36 @@ def wrapper(*args, **kwargs): return result return wrapper + + +def dataframe_to_tupled_list( + df: pl.DataFrame, num_max_elements: Optional[int] = None +) -> str: + """ + Converts a dataframe into a list of tuples. Used to print a Set to the console. See examples for behaviour. + + Examples: + >>> df = pl.DataFrame({"x": [1, 2, 3, 4, 5]}) + >>> dataframe_to_tupled_list(df) + '[1, 2, 3, 4, 5]' + >>> dataframe_to_tupled_list(df, 3) + '[1, 2, 3, ...]' + + >>> df = pl.DataFrame({"x": [1, 2, 3, 4, 5], "y": [2, 3, 4, 5, 6]}) + >>> dataframe_to_tupled_list(df, 3) + '[(1, 2), (2, 3), (3, 4), ...]' + """ + elipse = False + if num_max_elements is not None: + if len(df) > num_max_elements: + elipse = True + df = df.head(num_max_elements) + + res = (row for row in df.iter_rows()) + if len(df.columns) == 1: + res = (row[0] for row in res) + + res = str(list(res)) + if elipse: + res = res[:-1] + ", ...]" + return res diff --git a/src/pyoframe/variables.py b/src/pyoframe/variables.py index 2065b89..6770c23 100644 --- a/src/pyoframe/variables.py +++ b/src/pyoframe/variables.py @@ -3,7 +3,7 @@ """ from __future__ import annotations -from typing import Any, Iterable +from typing import Iterable, TYPE_CHECKING import polars as pl @@ -17,11 +17,14 @@ VType, VTypeValue, ) -from pyoframe.constraints import Expression +from pyoframe.constraints import Expression, SupportsToExpr from pyoframe.constraints import SetTypes from pyoframe.util import get_obj_repr, unwrap_single_values from pyoframe.model_element import CountableModelElement, SupportPolarsMethodMixin +if TYPE_CHECKING: + from pyoframe.model import Model + class Variable(CountableModelElement, SupportsMath, SupportPolarsMethodMixin): """ @@ -65,21 +68,44 @@ class Variable(CountableModelElement, SupportsMath, SupportPolarsMethodMixin): def __init__( self, *indexing_sets: SetTypes | Iterable[SetTypes], - lb: float = float("-inf"), - ub: float = float("inf"), + lb: float | int | SupportsToExpr = float("-inf"), + ub: float | int | SupportsToExpr = float("inf"), vtype: VType | VTypeValue = VType.CONTINUOUS, ): data = Set(*indexing_sets).data if len(indexing_sets) > 0 else pl.DataFrame() super().__init__(data) self.vtype: VType = VType(vtype) + self._fixed_to = None # Tightening the bounds is not strictly necessary, but it adds clarity if self.vtype == VType.BINARY: lb, ub = 0, 1 - self.lb = lb - self.ub = ub + if isinstance(lb, (float, int)): + self.lb, self.lb_constraint = lb, None + else: + self.lb, self.lb_constraint = float("-inf"), lb <= self + + if isinstance(ub, (float, int)): + self.ub, self.ub_constraint = ub, None + else: + self.ub, self.ub_constraint = float("inf"), self <= ub + + def on_add_to_model(self, model: "Model", name: str): + super().on_add_to_model(model, name) + if self.lb_constraint is not None: + setattr(model, f"{name}_lb", self.lb_constraint) + if self.ub_constraint is not None: + setattr(model, f"{name}_ub", self.ub_constraint) + if self._fixed_to is not None: + setattr(model, f"{name}_fixed", self == self._fixed_to) + + @classmethod + def create_fixed(cls, expr: SupportsToExpr): + v = Variable(expr) + v._fixed_to = expr + return v @classmethod def get_id_column_name(cls): diff --git a/tests/examples/cutting_stock_problem/results/pyoframe-problem.lp b/tests/examples/cutting_stock_problem/results/pyoframe-problem.lp index 9f48727..ec11635 100644 --- a/tests/examples/cutting_stock_problem/results/pyoframe-problem.lp +++ b/tests/examples/cutting_stock_problem/results/pyoframe-problem.lp @@ -103,1126 +103,86 @@ con_meet_orders[12]: orders_in_stock[0,12] + orders_in_stock[1,12] + orders_in_s bounds -0 <= orders_in_stock[0,0] <= inf -0 <= orders_in_stock[0,1] <= inf -0 <= orders_in_stock[0,2] <= inf -0 <= orders_in_stock[0,3] <= inf -0 <= orders_in_stock[0,4] <= inf -0 <= orders_in_stock[0,5] <= inf -0 <= orders_in_stock[0,6] <= inf -0 <= orders_in_stock[0,7] <= inf -0 <= orders_in_stock[0,8] <= inf -0 <= orders_in_stock[0,9] <= inf -0 <= orders_in_stock[0,10] <= inf -0 <= orders_in_stock[0,11] <= inf -0 <= orders_in_stock[0,12] <= inf -0 <= orders_in_stock[1,0] <= inf -0 <= orders_in_stock[1,1] <= inf -0 <= orders_in_stock[1,2] <= inf -0 <= orders_in_stock[1,3] <= inf -0 <= orders_in_stock[1,4] <= inf -0 <= orders_in_stock[1,5] <= inf -0 <= orders_in_stock[1,6] <= inf -0 <= orders_in_stock[1,7] <= inf -0 <= orders_in_stock[1,8] <= inf -0 <= orders_in_stock[1,9] <= inf -0 <= orders_in_stock[1,10] <= inf -0 <= orders_in_stock[1,11] <= inf -0 <= orders_in_stock[1,12] <= inf -0 <= orders_in_stock[2,0] <= inf -0 <= orders_in_stock[2,1] <= inf -0 <= orders_in_stock[2,2] <= inf -0 <= orders_in_stock[2,3] <= inf -0 <= orders_in_stock[2,4] <= inf -0 <= orders_in_stock[2,5] <= inf -0 <= orders_in_stock[2,6] <= inf -0 <= orders_in_stock[2,7] <= inf -0 <= orders_in_stock[2,8] <= inf -0 <= orders_in_stock[2,9] <= inf -0 <= orders_in_stock[2,10] <= inf -0 <= orders_in_stock[2,11] <= inf -0 <= orders_in_stock[2,12] <= inf -0 <= orders_in_stock[3,0] <= inf -0 <= orders_in_stock[3,1] <= inf -0 <= orders_in_stock[3,2] <= inf -0 <= orders_in_stock[3,3] <= inf -0 <= orders_in_stock[3,4] <= inf -0 <= orders_in_stock[3,5] <= inf -0 <= orders_in_stock[3,6] <= inf -0 <= orders_in_stock[3,7] <= inf -0 <= orders_in_stock[3,8] <= inf -0 <= orders_in_stock[3,9] <= inf -0 <= orders_in_stock[3,10] <= inf -0 <= orders_in_stock[3,11] <= inf -0 <= orders_in_stock[3,12] <= inf -0 <= orders_in_stock[4,0] <= inf -0 <= orders_in_stock[4,1] <= inf -0 <= orders_in_stock[4,2] <= inf -0 <= orders_in_stock[4,3] <= inf -0 <= orders_in_stock[4,4] <= inf -0 <= orders_in_stock[4,5] <= inf -0 <= orders_in_stock[4,6] <= inf -0 <= orders_in_stock[4,7] <= inf -0 <= orders_in_stock[4,8] <= inf -0 <= orders_in_stock[4,9] <= inf -0 <= orders_in_stock[4,10] <= inf -0 <= orders_in_stock[4,11] <= inf -0 <= orders_in_stock[4,12] <= inf -0 <= orders_in_stock[5,0] <= inf -0 <= orders_in_stock[5,1] <= inf -0 <= orders_in_stock[5,2] <= inf -0 <= orders_in_stock[5,3] <= inf -0 <= orders_in_stock[5,4] <= inf -0 <= orders_in_stock[5,5] <= inf -0 <= orders_in_stock[5,6] <= inf -0 <= orders_in_stock[5,7] <= inf -0 <= orders_in_stock[5,8] <= inf -0 <= orders_in_stock[5,9] <= inf -0 <= orders_in_stock[5,10] <= inf -0 <= orders_in_stock[5,11] <= inf -0 <= orders_in_stock[5,12] <= inf -0 <= orders_in_stock[6,0] <= inf -0 <= orders_in_stock[6,1] <= inf -0 <= orders_in_stock[6,2] <= inf -0 <= orders_in_stock[6,3] <= inf -0 <= orders_in_stock[6,4] <= inf -0 <= orders_in_stock[6,5] <= inf -0 <= orders_in_stock[6,6] <= inf -0 <= orders_in_stock[6,7] <= inf -0 <= orders_in_stock[6,8] <= inf -0 <= orders_in_stock[6,9] <= inf -0 <= orders_in_stock[6,10] <= inf -0 <= orders_in_stock[6,11] <= inf -0 <= orders_in_stock[6,12] <= inf -0 <= orders_in_stock[7,0] <= inf -0 <= orders_in_stock[7,1] <= inf -0 <= orders_in_stock[7,2] <= inf -0 <= orders_in_stock[7,3] <= inf -0 <= orders_in_stock[7,4] <= inf -0 <= orders_in_stock[7,5] <= inf -0 <= orders_in_stock[7,6] <= inf -0 <= orders_in_stock[7,7] <= inf -0 <= orders_in_stock[7,8] <= inf -0 <= orders_in_stock[7,9] <= inf -0 <= orders_in_stock[7,10] <= inf -0 <= orders_in_stock[7,11] <= inf -0 <= orders_in_stock[7,12] <= inf -0 <= orders_in_stock[8,0] <= inf -0 <= orders_in_stock[8,1] <= inf -0 <= orders_in_stock[8,2] <= inf -0 <= orders_in_stock[8,3] <= inf -0 <= orders_in_stock[8,4] <= inf -0 <= orders_in_stock[8,5] <= inf -0 <= orders_in_stock[8,6] <= inf -0 <= orders_in_stock[8,7] <= inf -0 <= orders_in_stock[8,8] <= inf -0 <= orders_in_stock[8,9] <= inf -0 <= orders_in_stock[8,10] <= inf -0 <= orders_in_stock[8,11] <= inf -0 <= orders_in_stock[8,12] <= inf -0 <= orders_in_stock[9,0] <= inf -0 <= orders_in_stock[9,1] <= inf -0 <= orders_in_stock[9,2] <= inf -0 <= orders_in_stock[9,3] <= inf -0 <= orders_in_stock[9,4] <= inf -0 <= orders_in_stock[9,5] <= inf -0 <= orders_in_stock[9,6] <= inf -0 <= orders_in_stock[9,7] <= inf -0 <= orders_in_stock[9,8] <= inf -0 <= orders_in_stock[9,9] <= inf -0 <= orders_in_stock[9,10] <= inf -0 <= orders_in_stock[9,11] <= inf -0 <= orders_in_stock[9,12] <= inf -0 <= orders_in_stock[10,0] <= inf -0 <= orders_in_stock[10,1] <= inf -0 <= orders_in_stock[10,2] <= inf -0 <= orders_in_stock[10,3] <= inf -0 <= orders_in_stock[10,4] <= inf -0 <= orders_in_stock[10,5] <= inf -0 <= orders_in_stock[10,6] <= inf -0 <= orders_in_stock[10,7] <= inf -0 <= orders_in_stock[10,8] <= inf -0 <= orders_in_stock[10,9] <= inf -0 <= orders_in_stock[10,10] <= inf -0 <= orders_in_stock[10,11] <= inf -0 <= orders_in_stock[10,12] <= inf -0 <= orders_in_stock[11,0] <= inf -0 <= orders_in_stock[11,1] <= inf -0 <= orders_in_stock[11,2] <= inf -0 <= orders_in_stock[11,3] <= inf -0 <= orders_in_stock[11,4] <= inf -0 <= orders_in_stock[11,5] <= inf -0 <= orders_in_stock[11,6] <= inf -0 <= orders_in_stock[11,7] <= inf -0 <= orders_in_stock[11,8] <= inf -0 <= orders_in_stock[11,9] <= inf -0 <= orders_in_stock[11,10] <= inf -0 <= orders_in_stock[11,11] <= inf -0 <= orders_in_stock[11,12] <= inf -0 <= orders_in_stock[12,0] <= inf -0 <= orders_in_stock[12,1] <= inf -0 <= orders_in_stock[12,2] <= inf -0 <= orders_in_stock[12,3] <= inf -0 <= orders_in_stock[12,4] <= inf -0 <= orders_in_stock[12,5] <= inf -0 <= orders_in_stock[12,6] <= inf -0 <= orders_in_stock[12,7] <= inf -0 <= orders_in_stock[12,8] <= inf -0 <= orders_in_stock[12,9] <= inf -0 <= orders_in_stock[12,10] <= inf -0 <= orders_in_stock[12,11] <= inf -0 <= orders_in_stock[12,12] <= inf -0 <= orders_in_stock[13,0] <= inf -0 <= orders_in_stock[13,1] <= inf -0 <= orders_in_stock[13,2] <= inf -0 <= orders_in_stock[13,3] <= inf -0 <= orders_in_stock[13,4] <= inf -0 <= orders_in_stock[13,5] <= inf -0 <= orders_in_stock[13,6] <= inf -0 <= orders_in_stock[13,7] <= inf -0 <= orders_in_stock[13,8] <= inf -0 <= orders_in_stock[13,9] <= inf -0 <= orders_in_stock[13,10] <= inf -0 <= orders_in_stock[13,11] <= inf -0 <= orders_in_stock[13,12] <= inf -0 <= orders_in_stock[14,0] <= inf -0 <= orders_in_stock[14,1] <= inf -0 <= orders_in_stock[14,2] <= inf -0 <= orders_in_stock[14,3] <= inf -0 <= orders_in_stock[14,4] <= inf -0 <= orders_in_stock[14,5] <= inf -0 <= orders_in_stock[14,6] <= inf -0 <= orders_in_stock[14,7] <= inf -0 <= orders_in_stock[14,8] <= inf -0 <= orders_in_stock[14,9] <= inf -0 <= orders_in_stock[14,10] <= inf -0 <= orders_in_stock[14,11] <= inf -0 <= orders_in_stock[14,12] <= inf -0 <= orders_in_stock[15,0] <= inf -0 <= orders_in_stock[15,1] <= inf -0 <= orders_in_stock[15,2] <= inf -0 <= orders_in_stock[15,3] <= inf -0 <= orders_in_stock[15,4] <= inf -0 <= orders_in_stock[15,5] <= inf -0 <= orders_in_stock[15,6] <= inf -0 <= orders_in_stock[15,7] <= inf -0 <= orders_in_stock[15,8] <= inf -0 <= orders_in_stock[15,9] <= inf -0 <= orders_in_stock[15,10] <= inf -0 <= orders_in_stock[15,11] <= inf -0 <= orders_in_stock[15,12] <= inf -0 <= orders_in_stock[16,0] <= inf -0 <= orders_in_stock[16,1] <= inf -0 <= orders_in_stock[16,2] <= inf -0 <= orders_in_stock[16,3] <= inf -0 <= orders_in_stock[16,4] <= inf -0 <= orders_in_stock[16,5] <= inf -0 <= orders_in_stock[16,6] <= inf -0 <= orders_in_stock[16,7] <= inf -0 <= orders_in_stock[16,8] <= inf -0 <= orders_in_stock[16,9] <= inf -0 <= orders_in_stock[16,10] <= inf -0 <= orders_in_stock[16,11] <= inf -0 <= orders_in_stock[16,12] <= inf -0 <= orders_in_stock[17,0] <= inf -0 <= orders_in_stock[17,1] <= inf -0 <= orders_in_stock[17,2] <= inf -0 <= orders_in_stock[17,3] <= inf -0 <= orders_in_stock[17,4] <= inf -0 <= orders_in_stock[17,5] <= inf -0 <= orders_in_stock[17,6] <= inf -0 <= orders_in_stock[17,7] <= inf -0 <= orders_in_stock[17,8] <= inf -0 <= orders_in_stock[17,9] <= inf -0 <= orders_in_stock[17,10] <= inf -0 <= orders_in_stock[17,11] <= inf -0 <= orders_in_stock[17,12] <= inf -0 <= orders_in_stock[18,0] <= inf -0 <= orders_in_stock[18,1] <= inf -0 <= orders_in_stock[18,2] <= inf -0 <= orders_in_stock[18,3] <= inf -0 <= orders_in_stock[18,4] <= inf -0 <= orders_in_stock[18,5] <= inf -0 <= orders_in_stock[18,6] <= inf -0 <= orders_in_stock[18,7] <= inf -0 <= orders_in_stock[18,8] <= inf -0 <= orders_in_stock[18,9] <= inf -0 <= orders_in_stock[18,10] <= inf -0 <= orders_in_stock[18,11] <= inf -0 <= orders_in_stock[18,12] <= inf -0 <= orders_in_stock[19,0] <= inf -0 <= orders_in_stock[19,1] <= inf -0 <= orders_in_stock[19,2] <= inf -0 <= orders_in_stock[19,3] <= inf -0 <= orders_in_stock[19,4] <= inf -0 <= orders_in_stock[19,5] <= inf -0 <= orders_in_stock[19,6] <= inf -0 <= orders_in_stock[19,7] <= inf -0 <= orders_in_stock[19,8] <= inf -0 <= orders_in_stock[19,9] <= inf -0 <= orders_in_stock[19,10] <= inf -0 <= orders_in_stock[19,11] <= inf -0 <= orders_in_stock[19,12] <= inf -0 <= orders_in_stock[20,0] <= inf -0 <= orders_in_stock[20,1] <= inf -0 <= orders_in_stock[20,2] <= inf -0 <= orders_in_stock[20,3] <= inf -0 <= orders_in_stock[20,4] <= inf -0 <= orders_in_stock[20,5] <= inf -0 <= orders_in_stock[20,6] <= inf -0 <= orders_in_stock[20,7] <= inf -0 <= orders_in_stock[20,8] <= inf -0 <= orders_in_stock[20,9] <= inf -0 <= orders_in_stock[20,10] <= inf -0 <= orders_in_stock[20,11] <= inf -0 <= orders_in_stock[20,12] <= inf -0 <= orders_in_stock[21,0] <= inf -0 <= orders_in_stock[21,1] <= inf -0 <= orders_in_stock[21,2] <= inf -0 <= orders_in_stock[21,3] <= inf -0 <= orders_in_stock[21,4] <= inf -0 <= orders_in_stock[21,5] <= inf -0 <= orders_in_stock[21,6] <= inf -0 <= orders_in_stock[21,7] <= inf -0 <= orders_in_stock[21,8] <= inf -0 <= orders_in_stock[21,9] <= inf -0 <= orders_in_stock[21,10] <= inf -0 <= orders_in_stock[21,11] <= inf -0 <= orders_in_stock[21,12] <= inf -0 <= orders_in_stock[22,0] <= inf -0 <= orders_in_stock[22,1] <= inf -0 <= orders_in_stock[22,2] <= inf -0 <= orders_in_stock[22,3] <= inf -0 <= orders_in_stock[22,4] <= inf -0 <= orders_in_stock[22,5] <= inf -0 <= orders_in_stock[22,6] <= inf -0 <= orders_in_stock[22,7] <= inf -0 <= orders_in_stock[22,8] <= inf -0 <= orders_in_stock[22,9] <= inf -0 <= orders_in_stock[22,10] <= inf -0 <= orders_in_stock[22,11] <= inf -0 <= orders_in_stock[22,12] <= inf -0 <= orders_in_stock[23,0] <= inf -0 <= orders_in_stock[23,1] <= inf -0 <= orders_in_stock[23,2] <= inf -0 <= orders_in_stock[23,3] <= inf -0 <= orders_in_stock[23,4] <= inf -0 <= orders_in_stock[23,5] <= inf -0 <= orders_in_stock[23,6] <= inf -0 <= orders_in_stock[23,7] <= inf -0 <= orders_in_stock[23,8] <= inf -0 <= orders_in_stock[23,9] <= inf -0 <= orders_in_stock[23,10] <= inf -0 <= orders_in_stock[23,11] <= inf -0 <= orders_in_stock[23,12] <= inf -0 <= orders_in_stock[24,0] <= inf -0 <= orders_in_stock[24,1] <= inf -0 <= orders_in_stock[24,2] <= inf -0 <= orders_in_stock[24,3] <= inf -0 <= orders_in_stock[24,4] <= inf -0 <= orders_in_stock[24,5] <= inf -0 <= orders_in_stock[24,6] <= inf -0 <= orders_in_stock[24,7] <= inf -0 <= orders_in_stock[24,8] <= inf -0 <= orders_in_stock[24,9] <= inf -0 <= orders_in_stock[24,10] <= inf -0 <= orders_in_stock[24,11] <= inf -0 <= orders_in_stock[24,12] <= inf -0 <= orders_in_stock[25,0] <= inf -0 <= orders_in_stock[25,1] <= inf -0 <= orders_in_stock[25,2] <= inf -0 <= orders_in_stock[25,3] <= inf -0 <= orders_in_stock[25,4] <= inf -0 <= orders_in_stock[25,5] <= inf -0 <= orders_in_stock[25,6] <= inf -0 <= orders_in_stock[25,7] <= inf -0 <= orders_in_stock[25,8] <= inf -0 <= orders_in_stock[25,9] <= inf -0 <= orders_in_stock[25,10] <= inf -0 <= orders_in_stock[25,11] <= inf -0 <= orders_in_stock[25,12] <= inf -0 <= orders_in_stock[26,0] <= inf -0 <= orders_in_stock[26,1] <= inf -0 <= orders_in_stock[26,2] <= inf -0 <= orders_in_stock[26,3] <= inf -0 <= orders_in_stock[26,4] <= inf -0 <= orders_in_stock[26,5] <= inf -0 <= orders_in_stock[26,6] <= inf -0 <= orders_in_stock[26,7] <= inf -0 <= orders_in_stock[26,8] <= inf -0 <= orders_in_stock[26,9] <= inf -0 <= orders_in_stock[26,10] <= inf -0 <= orders_in_stock[26,11] <= inf -0 <= orders_in_stock[26,12] <= inf -0 <= orders_in_stock[27,0] <= inf -0 <= orders_in_stock[27,1] <= inf -0 <= orders_in_stock[27,2] <= inf -0 <= orders_in_stock[27,3] <= inf -0 <= orders_in_stock[27,4] <= inf -0 <= orders_in_stock[27,5] <= inf -0 <= orders_in_stock[27,6] <= inf -0 <= orders_in_stock[27,7] <= inf -0 <= orders_in_stock[27,8] <= inf -0 <= orders_in_stock[27,9] <= inf -0 <= orders_in_stock[27,10] <= inf -0 <= orders_in_stock[27,11] <= inf -0 <= orders_in_stock[27,12] <= inf -0 <= orders_in_stock[28,0] <= inf -0 <= orders_in_stock[28,1] <= inf -0 <= orders_in_stock[28,2] <= inf -0 <= orders_in_stock[28,3] <= inf -0 <= orders_in_stock[28,4] <= inf -0 <= orders_in_stock[28,5] <= inf -0 <= orders_in_stock[28,6] <= inf -0 <= orders_in_stock[28,7] <= inf -0 <= orders_in_stock[28,8] <= inf -0 <= orders_in_stock[28,9] <= inf -0 <= orders_in_stock[28,10] <= inf -0 <= orders_in_stock[28,11] <= inf -0 <= orders_in_stock[28,12] <= inf -0 <= orders_in_stock[29,0] <= inf -0 <= orders_in_stock[29,1] <= inf -0 <= orders_in_stock[29,2] <= inf -0 <= orders_in_stock[29,3] <= inf -0 <= orders_in_stock[29,4] <= inf -0 <= orders_in_stock[29,5] <= inf -0 <= orders_in_stock[29,6] <= inf -0 <= orders_in_stock[29,7] <= inf -0 <= orders_in_stock[29,8] <= inf -0 <= orders_in_stock[29,9] <= inf -0 <= orders_in_stock[29,10] <= inf -0 <= orders_in_stock[29,11] <= inf -0 <= orders_in_stock[29,12] <= inf -0 <= orders_in_stock[30,0] <= inf -0 <= orders_in_stock[30,1] <= inf -0 <= orders_in_stock[30,2] <= inf -0 <= orders_in_stock[30,3] <= inf -0 <= orders_in_stock[30,4] <= inf -0 <= orders_in_stock[30,5] <= inf -0 <= orders_in_stock[30,6] <= inf -0 <= orders_in_stock[30,7] <= inf -0 <= orders_in_stock[30,8] <= inf -0 <= orders_in_stock[30,9] <= inf -0 <= orders_in_stock[30,10] <= inf -0 <= orders_in_stock[30,11] <= inf -0 <= orders_in_stock[30,12] <= inf -0 <= orders_in_stock[31,0] <= inf -0 <= orders_in_stock[31,1] <= inf -0 <= orders_in_stock[31,2] <= inf -0 <= orders_in_stock[31,3] <= inf -0 <= orders_in_stock[31,4] <= inf -0 <= orders_in_stock[31,5] <= inf -0 <= orders_in_stock[31,6] <= inf -0 <= orders_in_stock[31,7] <= inf -0 <= orders_in_stock[31,8] <= inf -0 <= orders_in_stock[31,9] <= inf -0 <= orders_in_stock[31,10] <= inf -0 <= orders_in_stock[31,11] <= inf -0 <= orders_in_stock[31,12] <= inf -0 <= orders_in_stock[32,0] <= inf -0 <= orders_in_stock[32,1] <= inf -0 <= orders_in_stock[32,2] <= inf -0 <= orders_in_stock[32,3] <= inf -0 <= orders_in_stock[32,4] <= inf -0 <= orders_in_stock[32,5] <= inf -0 <= orders_in_stock[32,6] <= inf -0 <= orders_in_stock[32,7] <= inf -0 <= orders_in_stock[32,8] <= inf -0 <= orders_in_stock[32,9] <= inf -0 <= orders_in_stock[32,10] <= inf -0 <= orders_in_stock[32,11] <= inf -0 <= orders_in_stock[32,12] <= inf -0 <= orders_in_stock[33,0] <= inf -0 <= orders_in_stock[33,1] <= inf -0 <= orders_in_stock[33,2] <= inf -0 <= orders_in_stock[33,3] <= inf -0 <= orders_in_stock[33,4] <= inf -0 <= orders_in_stock[33,5] <= inf -0 <= orders_in_stock[33,6] <= inf -0 <= orders_in_stock[33,7] <= inf -0 <= orders_in_stock[33,8] <= inf -0 <= orders_in_stock[33,9] <= inf -0 <= orders_in_stock[33,10] <= inf -0 <= orders_in_stock[33,11] <= inf -0 <= orders_in_stock[33,12] <= inf -0 <= orders_in_stock[34,0] <= inf -0 <= orders_in_stock[34,1] <= inf -0 <= orders_in_stock[34,2] <= inf -0 <= orders_in_stock[34,3] <= inf -0 <= orders_in_stock[34,4] <= inf -0 <= orders_in_stock[34,5] <= inf -0 <= orders_in_stock[34,6] <= inf -0 <= orders_in_stock[34,7] <= inf -0 <= orders_in_stock[34,8] <= inf -0 <= orders_in_stock[34,9] <= inf -0 <= orders_in_stock[34,10] <= inf -0 <= orders_in_stock[34,11] <= inf -0 <= orders_in_stock[34,12] <= inf -0 <= orders_in_stock[35,0] <= inf -0 <= orders_in_stock[35,1] <= inf -0 <= orders_in_stock[35,2] <= inf -0 <= orders_in_stock[35,3] <= inf -0 <= orders_in_stock[35,4] <= inf -0 <= orders_in_stock[35,5] <= inf -0 <= orders_in_stock[35,6] <= inf -0 <= orders_in_stock[35,7] <= inf -0 <= orders_in_stock[35,8] <= inf -0 <= orders_in_stock[35,9] <= inf -0 <= orders_in_stock[35,10] <= inf -0 <= orders_in_stock[35,11] <= inf -0 <= orders_in_stock[35,12] <= inf -0 <= orders_in_stock[36,0] <= inf -0 <= orders_in_stock[36,1] <= inf -0 <= orders_in_stock[36,2] <= inf -0 <= orders_in_stock[36,3] <= inf -0 <= orders_in_stock[36,4] <= inf -0 <= orders_in_stock[36,5] <= inf -0 <= orders_in_stock[36,6] <= inf -0 <= orders_in_stock[36,7] <= inf -0 <= orders_in_stock[36,8] <= inf -0 <= orders_in_stock[36,9] <= inf -0 <= orders_in_stock[36,10] <= inf -0 <= orders_in_stock[36,11] <= inf -0 <= orders_in_stock[36,12] <= inf -0 <= orders_in_stock[37,0] <= inf -0 <= orders_in_stock[37,1] <= inf -0 <= orders_in_stock[37,2] <= inf -0 <= orders_in_stock[37,3] <= inf -0 <= orders_in_stock[37,4] <= inf -0 <= orders_in_stock[37,5] <= inf -0 <= orders_in_stock[37,6] <= inf -0 <= orders_in_stock[37,7] <= inf -0 <= orders_in_stock[37,8] <= inf -0 <= orders_in_stock[37,9] <= inf -0 <= orders_in_stock[37,10] <= inf -0 <= orders_in_stock[37,11] <= inf -0 <= orders_in_stock[37,12] <= inf -0 <= orders_in_stock[38,0] <= inf -0 <= orders_in_stock[38,1] <= inf -0 <= orders_in_stock[38,2] <= inf -0 <= orders_in_stock[38,3] <= inf -0 <= orders_in_stock[38,4] <= inf -0 <= orders_in_stock[38,5] <= inf -0 <= orders_in_stock[38,6] <= inf -0 <= orders_in_stock[38,7] <= inf -0 <= orders_in_stock[38,8] <= inf -0 <= orders_in_stock[38,9] <= inf -0 <= orders_in_stock[38,10] <= inf -0 <= orders_in_stock[38,11] <= inf -0 <= orders_in_stock[38,12] <= inf -0 <= orders_in_stock[39,0] <= inf -0 <= orders_in_stock[39,1] <= inf -0 <= orders_in_stock[39,2] <= inf -0 <= orders_in_stock[39,3] <= inf -0 <= orders_in_stock[39,4] <= inf -0 <= orders_in_stock[39,5] <= inf -0 <= orders_in_stock[39,6] <= inf -0 <= orders_in_stock[39,7] <= inf -0 <= orders_in_stock[39,8] <= inf -0 <= orders_in_stock[39,9] <= inf -0 <= orders_in_stock[39,10] <= inf -0 <= orders_in_stock[39,11] <= inf -0 <= orders_in_stock[39,12] <= inf -0 <= orders_in_stock[40,0] <= inf -0 <= orders_in_stock[40,1] <= inf -0 <= orders_in_stock[40,2] <= inf -0 <= orders_in_stock[40,3] <= inf -0 <= orders_in_stock[40,4] <= inf -0 <= orders_in_stock[40,5] <= inf -0 <= orders_in_stock[40,6] <= inf -0 <= orders_in_stock[40,7] <= inf -0 <= orders_in_stock[40,8] <= inf -0 <= orders_in_stock[40,9] <= inf -0 <= orders_in_stock[40,10] <= inf -0 <= orders_in_stock[40,11] <= inf -0 <= orders_in_stock[40,12] <= inf -0 <= orders_in_stock[41,0] <= inf -0 <= orders_in_stock[41,1] <= inf -0 <= orders_in_stock[41,2] <= inf -0 <= orders_in_stock[41,3] <= inf -0 <= orders_in_stock[41,4] <= inf -0 <= orders_in_stock[41,5] <= inf -0 <= orders_in_stock[41,6] <= inf -0 <= orders_in_stock[41,7] <= inf -0 <= orders_in_stock[41,8] <= inf -0 <= orders_in_stock[41,9] <= inf -0 <= orders_in_stock[41,10] <= inf -0 <= orders_in_stock[41,11] <= inf -0 <= orders_in_stock[41,12] <= inf -0 <= orders_in_stock[42,0] <= inf -0 <= orders_in_stock[42,1] <= inf -0 <= orders_in_stock[42,2] <= inf -0 <= orders_in_stock[42,3] <= inf -0 <= orders_in_stock[42,4] <= inf -0 <= orders_in_stock[42,5] <= inf -0 <= orders_in_stock[42,6] <= inf -0 <= orders_in_stock[42,7] <= inf -0 <= orders_in_stock[42,8] <= inf -0 <= orders_in_stock[42,9] <= inf -0 <= orders_in_stock[42,10] <= inf -0 <= orders_in_stock[42,11] <= inf -0 <= orders_in_stock[42,12] <= inf -0 <= orders_in_stock[43,0] <= inf -0 <= orders_in_stock[43,1] <= inf -0 <= orders_in_stock[43,2] <= inf -0 <= orders_in_stock[43,3] <= inf -0 <= orders_in_stock[43,4] <= inf -0 <= orders_in_stock[43,5] <= inf -0 <= orders_in_stock[43,6] <= inf -0 <= orders_in_stock[43,7] <= inf -0 <= orders_in_stock[43,8] <= inf -0 <= orders_in_stock[43,9] <= inf -0 <= orders_in_stock[43,10] <= inf -0 <= orders_in_stock[43,11] <= inf -0 <= orders_in_stock[43,12] <= inf -0 <= orders_in_stock[44,0] <= inf -0 <= orders_in_stock[44,1] <= inf -0 <= orders_in_stock[44,2] <= inf -0 <= orders_in_stock[44,3] <= inf -0 <= orders_in_stock[44,4] <= inf -0 <= orders_in_stock[44,5] <= inf -0 <= orders_in_stock[44,6] <= inf -0 <= orders_in_stock[44,7] <= inf -0 <= orders_in_stock[44,8] <= inf -0 <= orders_in_stock[44,9] <= inf -0 <= orders_in_stock[44,10] <= inf -0 <= orders_in_stock[44,11] <= inf -0 <= orders_in_stock[44,12] <= inf -0 <= orders_in_stock[45,0] <= inf -0 <= orders_in_stock[45,1] <= inf -0 <= orders_in_stock[45,2] <= inf -0 <= orders_in_stock[45,3] <= inf -0 <= orders_in_stock[45,4] <= inf -0 <= orders_in_stock[45,5] <= inf -0 <= orders_in_stock[45,6] <= inf -0 <= orders_in_stock[45,7] <= inf -0 <= orders_in_stock[45,8] <= inf -0 <= orders_in_stock[45,9] <= inf -0 <= orders_in_stock[45,10] <= inf -0 <= orders_in_stock[45,11] <= inf -0 <= orders_in_stock[45,12] <= inf -0 <= orders_in_stock[46,0] <= inf -0 <= orders_in_stock[46,1] <= inf -0 <= orders_in_stock[46,2] <= inf -0 <= orders_in_stock[46,3] <= inf -0 <= orders_in_stock[46,4] <= inf -0 <= orders_in_stock[46,5] <= inf -0 <= orders_in_stock[46,6] <= inf -0 <= orders_in_stock[46,7] <= inf -0 <= orders_in_stock[46,8] <= inf -0 <= orders_in_stock[46,9] <= inf -0 <= orders_in_stock[46,10] <= inf -0 <= orders_in_stock[46,11] <= inf -0 <= orders_in_stock[46,12] <= inf -0 <= orders_in_stock[47,0] <= inf -0 <= orders_in_stock[47,1] <= inf -0 <= orders_in_stock[47,2] <= inf -0 <= orders_in_stock[47,3] <= inf -0 <= orders_in_stock[47,4] <= inf -0 <= orders_in_stock[47,5] <= inf -0 <= orders_in_stock[47,6] <= inf -0 <= orders_in_stock[47,7] <= inf -0 <= orders_in_stock[47,8] <= inf -0 <= orders_in_stock[47,9] <= inf -0 <= orders_in_stock[47,10] <= inf -0 <= orders_in_stock[47,11] <= inf -0 <= orders_in_stock[47,12] <= inf -0 <= orders_in_stock[48,0] <= inf -0 <= orders_in_stock[48,1] <= inf -0 <= orders_in_stock[48,2] <= inf -0 <= orders_in_stock[48,3] <= inf -0 <= orders_in_stock[48,4] <= inf -0 <= orders_in_stock[48,5] <= inf -0 <= orders_in_stock[48,6] <= inf -0 <= orders_in_stock[48,7] <= inf -0 <= orders_in_stock[48,8] <= inf -0 <= orders_in_stock[48,9] <= inf -0 <= orders_in_stock[48,10] <= inf -0 <= orders_in_stock[48,11] <= inf -0 <= orders_in_stock[48,12] <= inf -0 <= orders_in_stock[49,0] <= inf -0 <= orders_in_stock[49,1] <= inf -0 <= orders_in_stock[49,2] <= inf -0 <= orders_in_stock[49,3] <= inf -0 <= orders_in_stock[49,4] <= inf -0 <= orders_in_stock[49,5] <= inf -0 <= orders_in_stock[49,6] <= inf -0 <= orders_in_stock[49,7] <= inf -0 <= orders_in_stock[49,8] <= inf -0 <= orders_in_stock[49,9] <= inf -0 <= orders_in_stock[49,10] <= inf -0 <= orders_in_stock[49,11] <= inf -0 <= orders_in_stock[49,12] <= inf -0 <= orders_in_stock[50,0] <= inf -0 <= orders_in_stock[50,1] <= inf -0 <= orders_in_stock[50,2] <= inf -0 <= orders_in_stock[50,3] <= inf -0 <= orders_in_stock[50,4] <= inf -0 <= orders_in_stock[50,5] <= inf -0 <= orders_in_stock[50,6] <= inf -0 <= orders_in_stock[50,7] <= inf -0 <= orders_in_stock[50,8] <= inf -0 <= orders_in_stock[50,9] <= inf -0 <= orders_in_stock[50,10] <= inf -0 <= orders_in_stock[50,11] <= inf -0 <= orders_in_stock[50,12] <= inf -0 <= orders_in_stock[51,0] <= inf -0 <= orders_in_stock[51,1] <= inf -0 <= orders_in_stock[51,2] <= inf -0 <= orders_in_stock[51,3] <= inf -0 <= orders_in_stock[51,4] <= inf -0 <= orders_in_stock[51,5] <= inf -0 <= orders_in_stock[51,6] <= inf -0 <= orders_in_stock[51,7] <= inf -0 <= orders_in_stock[51,8] <= inf -0 <= orders_in_stock[51,9] <= inf -0 <= orders_in_stock[51,10] <= inf -0 <= orders_in_stock[51,11] <= inf -0 <= orders_in_stock[51,12] <= inf -0 <= orders_in_stock[52,0] <= inf -0 <= orders_in_stock[52,1] <= inf -0 <= orders_in_stock[52,2] <= inf -0 <= orders_in_stock[52,3] <= inf -0 <= orders_in_stock[52,4] <= inf -0 <= orders_in_stock[52,5] <= inf -0 <= orders_in_stock[52,6] <= inf -0 <= orders_in_stock[52,7] <= inf -0 <= orders_in_stock[52,8] <= inf -0 <= orders_in_stock[52,9] <= inf -0 <= orders_in_stock[52,10] <= inf -0 <= orders_in_stock[52,11] <= inf -0 <= orders_in_stock[52,12] <= inf -0 <= orders_in_stock[53,0] <= inf -0 <= orders_in_stock[53,1] <= inf -0 <= orders_in_stock[53,2] <= inf -0 <= orders_in_stock[53,3] <= inf -0 <= orders_in_stock[53,4] <= inf -0 <= orders_in_stock[53,5] <= inf -0 <= orders_in_stock[53,6] <= inf -0 <= orders_in_stock[53,7] <= inf -0 <= orders_in_stock[53,8] <= inf -0 <= orders_in_stock[53,9] <= inf -0 <= orders_in_stock[53,10] <= inf -0 <= orders_in_stock[53,11] <= inf -0 <= orders_in_stock[53,12] <= inf -0 <= orders_in_stock[54,0] <= inf -0 <= orders_in_stock[54,1] <= inf -0 <= orders_in_stock[54,2] <= inf -0 <= orders_in_stock[54,3] <= inf -0 <= orders_in_stock[54,4] <= inf -0 <= orders_in_stock[54,5] <= inf -0 <= orders_in_stock[54,6] <= inf -0 <= orders_in_stock[54,7] <= inf -0 <= orders_in_stock[54,8] <= inf -0 <= orders_in_stock[54,9] <= inf -0 <= orders_in_stock[54,10] <= inf -0 <= orders_in_stock[54,11] <= inf -0 <= orders_in_stock[54,12] <= inf -0 <= orders_in_stock[55,0] <= inf -0 <= orders_in_stock[55,1] <= inf -0 <= orders_in_stock[55,2] <= inf -0 <= orders_in_stock[55,3] <= inf -0 <= orders_in_stock[55,4] <= inf -0 <= orders_in_stock[55,5] <= inf -0 <= orders_in_stock[55,6] <= inf -0 <= orders_in_stock[55,7] <= inf -0 <= orders_in_stock[55,8] <= inf -0 <= orders_in_stock[55,9] <= inf -0 <= orders_in_stock[55,10] <= inf -0 <= orders_in_stock[55,11] <= inf -0 <= orders_in_stock[55,12] <= inf -0 <= orders_in_stock[56,0] <= inf -0 <= orders_in_stock[56,1] <= inf -0 <= orders_in_stock[56,2] <= inf -0 <= orders_in_stock[56,3] <= inf -0 <= orders_in_stock[56,4] <= inf -0 <= orders_in_stock[56,5] <= inf -0 <= orders_in_stock[56,6] <= inf -0 <= orders_in_stock[56,7] <= inf -0 <= orders_in_stock[56,8] <= inf -0 <= orders_in_stock[56,9] <= inf -0 <= orders_in_stock[56,10] <= inf -0 <= orders_in_stock[56,11] <= inf -0 <= orders_in_stock[56,12] <= inf -0 <= orders_in_stock[57,0] <= inf -0 <= orders_in_stock[57,1] <= inf -0 <= orders_in_stock[57,2] <= inf -0 <= orders_in_stock[57,3] <= inf -0 <= orders_in_stock[57,4] <= inf -0 <= orders_in_stock[57,5] <= inf -0 <= orders_in_stock[57,6] <= inf -0 <= orders_in_stock[57,7] <= inf -0 <= orders_in_stock[57,8] <= inf -0 <= orders_in_stock[57,9] <= inf -0 <= orders_in_stock[57,10] <= inf -0 <= orders_in_stock[57,11] <= inf -0 <= orders_in_stock[57,12] <= inf -0 <= orders_in_stock[58,0] <= inf -0 <= orders_in_stock[58,1] <= inf -0 <= orders_in_stock[58,2] <= inf -0 <= orders_in_stock[58,3] <= inf -0 <= orders_in_stock[58,4] <= inf -0 <= orders_in_stock[58,5] <= inf -0 <= orders_in_stock[58,6] <= inf -0 <= orders_in_stock[58,7] <= inf -0 <= orders_in_stock[58,8] <= inf -0 <= orders_in_stock[58,9] <= inf -0 <= orders_in_stock[58,10] <= inf -0 <= orders_in_stock[58,11] <= inf -0 <= orders_in_stock[58,12] <= inf -0 <= orders_in_stock[59,0] <= inf -0 <= orders_in_stock[59,1] <= inf -0 <= orders_in_stock[59,2] <= inf -0 <= orders_in_stock[59,3] <= inf -0 <= orders_in_stock[59,4] <= inf -0 <= orders_in_stock[59,5] <= inf -0 <= orders_in_stock[59,6] <= inf -0 <= orders_in_stock[59,7] <= inf -0 <= orders_in_stock[59,8] <= inf -0 <= orders_in_stock[59,9] <= inf -0 <= orders_in_stock[59,10] <= inf -0 <= orders_in_stock[59,11] <= inf -0 <= orders_in_stock[59,12] <= inf -0 <= orders_in_stock[60,0] <= inf -0 <= orders_in_stock[60,1] <= inf -0 <= orders_in_stock[60,2] <= inf -0 <= orders_in_stock[60,3] <= inf -0 <= orders_in_stock[60,4] <= inf -0 <= orders_in_stock[60,5] <= inf -0 <= orders_in_stock[60,6] <= inf -0 <= orders_in_stock[60,7] <= inf -0 <= orders_in_stock[60,8] <= inf -0 <= orders_in_stock[60,9] <= inf -0 <= orders_in_stock[60,10] <= inf -0 <= orders_in_stock[60,11] <= inf -0 <= orders_in_stock[60,12] <= inf -0 <= orders_in_stock[61,0] <= inf -0 <= orders_in_stock[61,1] <= inf -0 <= orders_in_stock[61,2] <= inf -0 <= orders_in_stock[61,3] <= inf -0 <= orders_in_stock[61,4] <= inf -0 <= orders_in_stock[61,5] <= inf -0 <= orders_in_stock[61,6] <= inf -0 <= orders_in_stock[61,7] <= inf -0 <= orders_in_stock[61,8] <= inf -0 <= orders_in_stock[61,9] <= inf -0 <= orders_in_stock[61,10] <= inf -0 <= orders_in_stock[61,11] <= inf -0 <= orders_in_stock[61,12] <= inf -0 <= orders_in_stock[62,0] <= inf -0 <= orders_in_stock[62,1] <= inf -0 <= orders_in_stock[62,2] <= inf -0 <= orders_in_stock[62,3] <= inf -0 <= orders_in_stock[62,4] <= inf -0 <= orders_in_stock[62,5] <= inf -0 <= orders_in_stock[62,6] <= inf -0 <= orders_in_stock[62,7] <= inf -0 <= orders_in_stock[62,8] <= inf -0 <= orders_in_stock[62,9] <= inf -0 <= orders_in_stock[62,10] <= inf -0 <= orders_in_stock[62,11] <= inf -0 <= orders_in_stock[62,12] <= inf -0 <= orders_in_stock[63,0] <= inf -0 <= orders_in_stock[63,1] <= inf -0 <= orders_in_stock[63,2] <= inf -0 <= orders_in_stock[63,3] <= inf -0 <= orders_in_stock[63,4] <= inf -0 <= orders_in_stock[63,5] <= inf -0 <= orders_in_stock[63,6] <= inf -0 <= orders_in_stock[63,7] <= inf -0 <= orders_in_stock[63,8] <= inf -0 <= orders_in_stock[63,9] <= inf -0 <= orders_in_stock[63,10] <= inf -0 <= orders_in_stock[63,11] <= inf -0 <= orders_in_stock[63,12] <= inf -0 <= orders_in_stock[64,0] <= inf -0 <= orders_in_stock[64,1] <= inf -0 <= orders_in_stock[64,2] <= inf -0 <= orders_in_stock[64,3] <= inf -0 <= orders_in_stock[64,4] <= inf -0 <= orders_in_stock[64,5] <= inf -0 <= orders_in_stock[64,6] <= inf -0 <= orders_in_stock[64,7] <= inf -0 <= orders_in_stock[64,8] <= inf -0 <= orders_in_stock[64,9] <= inf -0 <= orders_in_stock[64,10] <= inf -0 <= orders_in_stock[64,11] <= inf -0 <= orders_in_stock[64,12] <= inf -0 <= orders_in_stock[65,0] <= inf -0 <= orders_in_stock[65,1] <= inf -0 <= orders_in_stock[65,2] <= inf -0 <= orders_in_stock[65,3] <= inf -0 <= orders_in_stock[65,4] <= inf -0 <= orders_in_stock[65,5] <= inf -0 <= orders_in_stock[65,6] <= inf -0 <= orders_in_stock[65,7] <= inf -0 <= orders_in_stock[65,8] <= inf -0 <= orders_in_stock[65,9] <= inf -0 <= orders_in_stock[65,10] <= inf -0 <= orders_in_stock[65,11] <= inf -0 <= orders_in_stock[65,12] <= inf -0 <= orders_in_stock[66,0] <= inf -0 <= orders_in_stock[66,1] <= inf -0 <= orders_in_stock[66,2] <= inf -0 <= orders_in_stock[66,3] <= inf -0 <= orders_in_stock[66,4] <= inf -0 <= orders_in_stock[66,5] <= inf -0 <= orders_in_stock[66,6] <= inf -0 <= orders_in_stock[66,7] <= inf -0 <= orders_in_stock[66,8] <= inf -0 <= orders_in_stock[66,9] <= inf -0 <= orders_in_stock[66,10] <= inf -0 <= orders_in_stock[66,11] <= inf -0 <= orders_in_stock[66,12] <= inf -0 <= orders_in_stock[67,0] <= inf -0 <= orders_in_stock[67,1] <= inf -0 <= orders_in_stock[67,2] <= inf -0 <= orders_in_stock[67,3] <= inf -0 <= orders_in_stock[67,4] <= inf -0 <= orders_in_stock[67,5] <= inf -0 <= orders_in_stock[67,6] <= inf -0 <= orders_in_stock[67,7] <= inf -0 <= orders_in_stock[67,8] <= inf -0 <= orders_in_stock[67,9] <= inf -0 <= orders_in_stock[67,10] <= inf -0 <= orders_in_stock[67,11] <= inf -0 <= orders_in_stock[67,12] <= inf -0 <= orders_in_stock[68,0] <= inf -0 <= orders_in_stock[68,1] <= inf -0 <= orders_in_stock[68,2] <= inf -0 <= orders_in_stock[68,3] <= inf -0 <= orders_in_stock[68,4] <= inf -0 <= orders_in_stock[68,5] <= inf -0 <= orders_in_stock[68,6] <= inf -0 <= orders_in_stock[68,7] <= inf -0 <= orders_in_stock[68,8] <= inf -0 <= orders_in_stock[68,9] <= inf -0 <= orders_in_stock[68,10] <= inf -0 <= orders_in_stock[68,11] <= inf -0 <= orders_in_stock[68,12] <= inf -0 <= orders_in_stock[69,0] <= inf -0 <= orders_in_stock[69,1] <= inf -0 <= orders_in_stock[69,2] <= inf -0 <= orders_in_stock[69,3] <= inf -0 <= orders_in_stock[69,4] <= inf -0 <= orders_in_stock[69,5] <= inf -0 <= orders_in_stock[69,6] <= inf -0 <= orders_in_stock[69,7] <= inf -0 <= orders_in_stock[69,8] <= inf -0 <= orders_in_stock[69,9] <= inf -0 <= orders_in_stock[69,10] <= inf -0 <= orders_in_stock[69,11] <= inf -0 <= orders_in_stock[69,12] <= inf -0 <= orders_in_stock[70,0] <= inf -0 <= orders_in_stock[70,1] <= inf -0 <= orders_in_stock[70,2] <= inf -0 <= orders_in_stock[70,3] <= inf -0 <= orders_in_stock[70,4] <= inf -0 <= orders_in_stock[70,5] <= inf -0 <= orders_in_stock[70,6] <= inf -0 <= orders_in_stock[70,7] <= inf -0 <= orders_in_stock[70,8] <= inf -0 <= orders_in_stock[70,9] <= inf -0 <= orders_in_stock[70,10] <= inf -0 <= orders_in_stock[70,11] <= inf -0 <= orders_in_stock[70,12] <= inf -0 <= orders_in_stock[71,0] <= inf -0 <= orders_in_stock[71,1] <= inf -0 <= orders_in_stock[71,2] <= inf -0 <= orders_in_stock[71,3] <= inf -0 <= orders_in_stock[71,4] <= inf -0 <= orders_in_stock[71,5] <= inf -0 <= orders_in_stock[71,6] <= inf -0 <= orders_in_stock[71,7] <= inf -0 <= orders_in_stock[71,8] <= inf -0 <= orders_in_stock[71,9] <= inf -0 <= orders_in_stock[71,10] <= inf -0 <= orders_in_stock[71,11] <= inf -0 <= orders_in_stock[71,12] <= inf -0 <= orders_in_stock[72,0] <= inf -0 <= orders_in_stock[72,1] <= inf -0 <= orders_in_stock[72,2] <= inf -0 <= orders_in_stock[72,3] <= inf -0 <= orders_in_stock[72,4] <= inf -0 <= orders_in_stock[72,5] <= inf -0 <= orders_in_stock[72,6] <= inf -0 <= orders_in_stock[72,7] <= inf -0 <= orders_in_stock[72,8] <= inf -0 <= orders_in_stock[72,9] <= inf -0 <= orders_in_stock[72,10] <= inf -0 <= orders_in_stock[72,11] <= inf -0 <= orders_in_stock[72,12] <= inf -0 <= orders_in_stock[73,0] <= inf -0 <= orders_in_stock[73,1] <= inf -0 <= orders_in_stock[73,2] <= inf -0 <= orders_in_stock[73,3] <= inf -0 <= orders_in_stock[73,4] <= inf -0 <= orders_in_stock[73,5] <= inf -0 <= orders_in_stock[73,6] <= inf -0 <= orders_in_stock[73,7] <= inf -0 <= orders_in_stock[73,8] <= inf -0 <= orders_in_stock[73,9] <= inf -0 <= orders_in_stock[73,10] <= inf -0 <= orders_in_stock[73,11] <= inf -0 <= orders_in_stock[73,12] <= inf -0 <= orders_in_stock[74,0] <= inf -0 <= orders_in_stock[74,1] <= inf -0 <= orders_in_stock[74,2] <= inf -0 <= orders_in_stock[74,3] <= inf -0 <= orders_in_stock[74,4] <= inf -0 <= orders_in_stock[74,5] <= inf -0 <= orders_in_stock[74,6] <= inf -0 <= orders_in_stock[74,7] <= inf -0 <= orders_in_stock[74,8] <= inf -0 <= orders_in_stock[74,9] <= inf -0 <= orders_in_stock[74,10] <= inf -0 <= orders_in_stock[74,11] <= inf -0 <= orders_in_stock[74,12] <= inf -0 <= orders_in_stock[75,0] <= inf -0 <= orders_in_stock[75,1] <= inf -0 <= orders_in_stock[75,2] <= inf -0 <= orders_in_stock[75,3] <= inf -0 <= orders_in_stock[75,4] <= inf -0 <= orders_in_stock[75,5] <= inf -0 <= orders_in_stock[75,6] <= inf -0 <= orders_in_stock[75,7] <= inf -0 <= orders_in_stock[75,8] <= inf -0 <= orders_in_stock[75,9] <= inf -0 <= orders_in_stock[75,10] <= inf -0 <= orders_in_stock[75,11] <= inf -0 <= orders_in_stock[75,12] <= inf -0 <= orders_in_stock[76,0] <= inf -0 <= orders_in_stock[76,1] <= inf -0 <= orders_in_stock[76,2] <= inf -0 <= orders_in_stock[76,3] <= inf -0 <= orders_in_stock[76,4] <= inf -0 <= orders_in_stock[76,5] <= inf -0 <= orders_in_stock[76,6] <= inf -0 <= orders_in_stock[76,7] <= inf -0 <= orders_in_stock[76,8] <= inf -0 <= orders_in_stock[76,9] <= inf -0 <= orders_in_stock[76,10] <= inf -0 <= orders_in_stock[76,11] <= inf -0 <= orders_in_stock[76,12] <= inf -0 <= orders_in_stock[77,0] <= inf -0 <= orders_in_stock[77,1] <= inf -0 <= orders_in_stock[77,2] <= inf -0 <= orders_in_stock[77,3] <= inf -0 <= orders_in_stock[77,4] <= inf -0 <= orders_in_stock[77,5] <= inf -0 <= orders_in_stock[77,6] <= inf -0 <= orders_in_stock[77,7] <= inf -0 <= orders_in_stock[77,8] <= inf -0 <= orders_in_stock[77,9] <= inf -0 <= orders_in_stock[77,10] <= inf -0 <= orders_in_stock[77,11] <= inf -0 <= orders_in_stock[77,12] <= inf -0 <= orders_in_stock[78,0] <= inf -0 <= orders_in_stock[78,1] <= inf -0 <= orders_in_stock[78,2] <= inf -0 <= orders_in_stock[78,3] <= inf -0 <= orders_in_stock[78,4] <= inf -0 <= orders_in_stock[78,5] <= inf -0 <= orders_in_stock[78,6] <= inf -0 <= orders_in_stock[78,7] <= inf -0 <= orders_in_stock[78,8] <= inf -0 <= orders_in_stock[78,9] <= inf -0 <= orders_in_stock[78,10] <= inf -0 <= orders_in_stock[78,11] <= inf -0 <= orders_in_stock[78,12] <= inf -0 <= orders_in_stock[79,0] <= inf -0 <= orders_in_stock[79,1] <= inf -0 <= orders_in_stock[79,2] <= inf -0 <= orders_in_stock[79,3] <= inf -0 <= orders_in_stock[79,4] <= inf -0 <= orders_in_stock[79,5] <= inf -0 <= orders_in_stock[79,6] <= inf -0 <= orders_in_stock[79,7] <= inf -0 <= orders_in_stock[79,8] <= inf -0 <= orders_in_stock[79,9] <= inf -0 <= orders_in_stock[79,10] <= inf -0 <= orders_in_stock[79,11] <= inf -0 <= orders_in_stock[79,12] <= inf -0 <= is_used[0] <= 1 -0 <= is_used[1] <= 1 -0 <= is_used[2] <= 1 -0 <= is_used[3] <= 1 -0 <= is_used[4] <= 1 -0 <= is_used[5] <= 1 -0 <= is_used[6] <= 1 -0 <= is_used[7] <= 1 -0 <= is_used[8] <= 1 -0 <= is_used[9] <= 1 -0 <= is_used[10] <= 1 -0 <= is_used[11] <= 1 -0 <= is_used[12] <= 1 -0 <= is_used[13] <= 1 -0 <= is_used[14] <= 1 -0 <= is_used[15] <= 1 -0 <= is_used[16] <= 1 -0 <= is_used[17] <= 1 -0 <= is_used[18] <= 1 -0 <= is_used[19] <= 1 -0 <= is_used[20] <= 1 -0 <= is_used[21] <= 1 -0 <= is_used[22] <= 1 -0 <= is_used[23] <= 1 -0 <= is_used[24] <= 1 -0 <= is_used[25] <= 1 -0 <= is_used[26] <= 1 -0 <= is_used[27] <= 1 -0 <= is_used[28] <= 1 -0 <= is_used[29] <= 1 -0 <= is_used[30] <= 1 -0 <= is_used[31] <= 1 -0 <= is_used[32] <= 1 -0 <= is_used[33] <= 1 -0 <= is_used[34] <= 1 -0 <= is_used[35] <= 1 -0 <= is_used[36] <= 1 -0 <= is_used[37] <= 1 -0 <= is_used[38] <= 1 -0 <= is_used[39] <= 1 -0 <= is_used[40] <= 1 -0 <= is_used[41] <= 1 -0 <= is_used[42] <= 1 -0 <= is_used[43] <= 1 -0 <= is_used[44] <= 1 -0 <= is_used[45] <= 1 -0 <= is_used[46] <= 1 -0 <= is_used[47] <= 1 -0 <= is_used[48] <= 1 -0 <= is_used[49] <= 1 -0 <= is_used[50] <= 1 -0 <= is_used[51] <= 1 -0 <= is_used[52] <= 1 -0 <= is_used[53] <= 1 -0 <= is_used[54] <= 1 -0 <= is_used[55] <= 1 -0 <= is_used[56] <= 1 -0 <= is_used[57] <= 1 -0 <= is_used[58] <= 1 -0 <= is_used[59] <= 1 -0 <= is_used[60] <= 1 -0 <= is_used[61] <= 1 -0 <= is_used[62] <= 1 -0 <= is_used[63] <= 1 -0 <= is_used[64] <= 1 -0 <= is_used[65] <= 1 -0 <= is_used[66] <= 1 -0 <= is_used[67] <= 1 -0 <= is_used[68] <= 1 -0 <= is_used[69] <= 1 -0 <= is_used[70] <= 1 -0 <= is_used[71] <= 1 -0 <= is_used[72] <= 1 -0 <= is_used[73] <= 1 -0 <= is_used[74] <= 1 -0 <= is_used[75] <= 1 -0 <= is_used[76] <= 1 -0 <= is_used[77] <= 1 -0 <= is_used[78] <= 1 -0 <= is_used[79] <= 1 +is_used[0] <= 1 +is_used[1] <= 1 +is_used[2] <= 1 +is_used[3] <= 1 +is_used[4] <= 1 +is_used[5] <= 1 +is_used[6] <= 1 +is_used[7] <= 1 +is_used[8] <= 1 +is_used[9] <= 1 +is_used[10] <= 1 +is_used[11] <= 1 +is_used[12] <= 1 +is_used[13] <= 1 +is_used[14] <= 1 +is_used[15] <= 1 +is_used[16] <= 1 +is_used[17] <= 1 +is_used[18] <= 1 +is_used[19] <= 1 +is_used[20] <= 1 +is_used[21] <= 1 +is_used[22] <= 1 +is_used[23] <= 1 +is_used[24] <= 1 +is_used[25] <= 1 +is_used[26] <= 1 +is_used[27] <= 1 +is_used[28] <= 1 +is_used[29] <= 1 +is_used[30] <= 1 +is_used[31] <= 1 +is_used[32] <= 1 +is_used[33] <= 1 +is_used[34] <= 1 +is_used[35] <= 1 +is_used[36] <= 1 +is_used[37] <= 1 +is_used[38] <= 1 +is_used[39] <= 1 +is_used[40] <= 1 +is_used[41] <= 1 +is_used[42] <= 1 +is_used[43] <= 1 +is_used[44] <= 1 +is_used[45] <= 1 +is_used[46] <= 1 +is_used[47] <= 1 +is_used[48] <= 1 +is_used[49] <= 1 +is_used[50] <= 1 +is_used[51] <= 1 +is_used[52] <= 1 +is_used[53] <= 1 +is_used[54] <= 1 +is_used[55] <= 1 +is_used[56] <= 1 +is_used[57] <= 1 +is_used[58] <= 1 +is_used[59] <= 1 +is_used[60] <= 1 +is_used[61] <= 1 +is_used[62] <= 1 +is_used[63] <= 1 +is_used[64] <= 1 +is_used[65] <= 1 +is_used[66] <= 1 +is_used[67] <= 1 +is_used[68] <= 1 +is_used[69] <= 1 +is_used[70] <= 1 +is_used[71] <= 1 +is_used[72] <= 1 +is_used[73] <= 1 +is_used[74] <= 1 +is_used[75] <= 1 +is_used[76] <= 1 +is_used[77] <= 1 +is_used[78] <= 1 +is_used[79] <= 1 binary @@ -2351,4 +1311,5 @@ orders_in_stock[79,9] orders_in_stock[79,10] orders_in_stock[79,11] orders_in_stock[79,12] + end diff --git a/tests/examples/diet_problem/input_data/foods.csv b/tests/examples/diet_problem/input_data/foods.csv index c039ae5..476b65e 100644 --- a/tests/examples/diet_problem/input_data/foods.csv +++ b/tests/examples/diet_problem/input_data/foods.csv @@ -1,10 +1,10 @@ -food,cost -hamburger,2.49 -chicken,2.89 -hot_dog,1.50 -fries,1.89 -macaroni,2.09 -pizza,1.99 -salad,2.49 -milk,0.89 -ice_cream,1.59 \ No newline at end of file +food,cost,stock +hamburger,2.49,40 +chicken,2.89,30 +hot_dog,1.50,20 +fries,1.89,20 +macaroni,2.09,40 +pizza,1.99,50 +salad,2.49,60 +milk,0.89,6.8 +ice_cream,1.59,80 \ No newline at end of file diff --git a/tests/examples/diet_problem/model.py b/tests/examples/diet_problem/model.py index 1f6e1f2..4063602 100644 --- a/tests/examples/diet_problem/model.py +++ b/tests/examples/diet_problem/model.py @@ -12,14 +12,14 @@ def main(input_dir, directory, **kwargs): - food_cost = pl.read_csv(input_dir / "foods.csv").to_expr() + food = pl.read_csv(input_dir / "foods.csv") nutrients = pl.read_csv(input_dir / "nutrients.csv") min_nutrient = nutrients.select(["category", "min"]).to_expr() max_nutrient = nutrients.select(["category", "max"]).to_expr() food_nutrients = pl.read_csv(input_dir / "foods_to_nutrients.csv").to_expr() m = Model() - m.Buy = Variable(food_cost, lb=0) + m.Buy = Variable(food[["food"]], lb=0, ub=food[["food", "stock"]]) m.min_nutrients = ( min_nutrient <= sum("food", m.Buy * food_nutrients).drop_unmatched() @@ -28,7 +28,7 @@ def main(input_dir, directory, **kwargs): sum("food", m.Buy * food_nutrients).drop_unmatched() <= max_nutrient ) - m.minimize = sum(m.Buy * food_cost) + m.minimize = sum(m.Buy * food[["food", "cost"]]) m.solve("gurobi", directory=directory, **kwargs) diff --git a/tests/examples/diet_problem/model_gurobipy.py b/tests/examples/diet_problem/model_gurobipy.py index 5598915..38db2c8 100644 --- a/tests/examples/diet_problem/model_gurobipy.py +++ b/tests/examples/diet_problem/model_gurobipy.py @@ -26,7 +26,7 @@ def main(input_dir, output_dir): m = Model() # Create decision variables for the foods to buy - buy = m.addVars(foods, name="Buy") + buy = m.addVars(foods, name="Buy", ub=df["stock"]) # Nutrition constraints m.addConstrs( diff --git a/tests/examples/diet_problem/results/buy.csv b/tests/examples/diet_problem/results/buy.csv index 7c20f97..1843506 100644 --- a/tests/examples/diet_problem/results/buy.csv +++ b/tests/examples/diet_problem/results/buy.csv @@ -1,10 +1,10 @@ food,solution -hamburger,0.6045138888888888 +hamburger,0.5552631578947368 chicken,0.0 hot_dog,0.0 fries,0.0 macaroni,0.0 pizza,0.0 salad,0.0 -milk,6.970138888888889 -ice_cream,2.5913194444444447 +milk,6.8 +ice_cream,2.90921052631579 diff --git a/tests/examples/diet_problem/results/gurobipy.lp b/tests/examples/diet_problem/results/gurobipy.lp index 28f9632..8dd6763 100644 --- a/tests/examples/diet_problem/results/gurobipy.lp +++ b/tests/examples/diet_problem/results/gurobipy.lp @@ -1,4 +1,3 @@ -\ Model diet \ LP format - for model browsing. Use MPS format to capture full model detail. Minimize 2.49 Buy[hamburger] + 2.89 Buy[chicken] + 1.5 Buy[hot_dog] @@ -22,4 +21,15 @@ Subject To + 820 Buy[pizza] + 1230 Buy[salad] + 125 Buy[milk] + 180 Buy[ice_cream] <= 1779 Bounds + Buy[hamburger] <= 40 + Buy[chicken] <= 30 + Buy[hot_dog] <= 20 + Buy[fries] <= 20 + Buy[macaroni] <= 40 + Buy[pizza] <= 50 + Buy[salad] <= 60 + Buy[milk] <= 6.8 + Buy[ice_cream] <= 80 + + End diff --git a/tests/examples/diet_problem/results/gurobipy.sol b/tests/examples/diet_problem/results/gurobipy.sol index 3ffda30..a9c66a9 100644 --- a/tests/examples/diet_problem/results/gurobipy.sol +++ b/tests/examples/diet_problem/results/gurobipy.sol @@ -1,11 +1,10 @@ -# Solution for model diet -# Objective value = 1.1828861111111111e+01 -Buy[hamburger] 6.0451388888888880e-01 +# Objective value = 12.06025 +Buy[hamburger] 5.5526315789473679e-01 Buy[chicken] 0 Buy[hot_dog] 0 Buy[fries] 0 Buy[macaroni] 0 Buy[pizza] 0 Buy[salad] 0 -Buy[milk] 6.9701388888888891e+00 -Buy[ice_cream] 2.5913194444444447e+00 +Buy[milk] 6.8 +Buy[ice_cream] 2.90921052631579 diff --git a/tests/examples/diet_problem/results/max_nutrients.csv b/tests/examples/diet_problem/results/max_nutrients.csv index 51b23ae..d88d86a 100644 --- a/tests/examples/diet_problem/results/max_nutrients.csv +++ b/tests/examples/diet_problem/results/max_nutrients.csv @@ -1,4 +1,4 @@ category,dual -calories,0.0 -sodium,-0.0015661375661375656 fat,0.0 +calories,0.0 +sodium,-0.012000000000000002 diff --git a/tests/examples/diet_problem/results/min_nutrients.csv b/tests/examples/diet_problem/results/min_nutrients.csv index f25875c..58e0fb3 100644 --- a/tests/examples/diet_problem/results/min_nutrients.csv +++ b/tests/examples/diet_problem/results/min_nutrients.csv @@ -1,3 +1,3 @@ category,dual -calories,-0.0034179894179894184 -protein,-0.09299603174603173 +protein,-0.46875 +calories,0.0 diff --git a/tests/examples/diet_problem/results/pyoframe-problem.lp b/tests/examples/diet_problem/results/pyoframe-problem.lp index 66c4b13..4728b09 100644 --- a/tests/examples/diet_problem/results/pyoframe-problem.lp +++ b/tests/examples/diet_problem/results/pyoframe-problem.lp @@ -6,6 +6,15 @@ obj: s.t. +Buy_ub[chicken]: Buy[chicken] <= 30 +Buy_ub[fries]: Buy[fries] <= 20 +Buy_ub[hamburger]: Buy[hamburger] <= 40 +Buy_ub[hot_dog]: Buy[hot_dog] <= 20 +Buy_ub[ice_cream]: Buy[ice_cream] <= 80 +Buy_ub[macaroni]: Buy[macaroni] <= 40 +Buy_ub[milk]: Buy[milk] <= 6.8 +Buy_ub[pizza]: Buy[pizza] <= 50 +Buy_ub[salad]: Buy[salad] <= 60 min_nutrients[calories]: -410 Buy[hamburger] -420 Buy[chicken] -560 Buy[hot_dog] -380 Buy[fries] -320 Buy[macaroni] -320 Buy[pizza] -320 Buy[salad] -100 Buy[milk] -330 Buy[ice_cream] <= -1800 min_nutrients[protein]: -24 Buy[hamburger] -32 Buy[chicken] -20 Buy[hot_dog] -4 Buy[fries] -12 Buy[macaroni] -15 Buy[pizza] -31 Buy[salad] -8 Buy[milk] -8 Buy[ice_cream] <= -91 max_nutrients[calories]: 410 Buy[hamburger] +420 Buy[chicken] +560 Buy[hot_dog] +380 Buy[fries] +320 Buy[macaroni] +320 Buy[pizza] +320 Buy[salad] +100 Buy[milk] +330 Buy[ice_cream] <= 2200 @@ -15,13 +24,5 @@ max_nutrients[sodium]: 730 Buy[hamburger] +1190 Buy[chicken] +1800 Buy[hot_dog] bounds -0 <= Buy[hamburger] <= inf -0 <= Buy[chicken] <= inf -0 <= Buy[hot_dog] <= inf -0 <= Buy[fries] <= inf -0 <= Buy[macaroni] <= inf -0 <= Buy[pizza] <= inf -0 <= Buy[salad] <= inf -0 <= Buy[milk] <= inf -0 <= Buy[ice_cream] <= inf + end diff --git a/tests/examples/diet_problem/results/pyoframe-problem.sol b/tests/examples/diet_problem/results/pyoframe-problem.sol index 716d470..2aa17ab 100644 --- a/tests/examples/diet_problem/results/pyoframe-problem.sol +++ b/tests/examples/diet_problem/results/pyoframe-problem.sol @@ -1,11 +1,11 @@ # Solution for model obj -# Objective value = 1.1828861111111111e+01 -Buy[hamburger] 6.0451388888888880e-01 +# Objective value = 12.06025 +Buy[hamburger] 5.5526315789473679e-01 Buy[chicken] 0 Buy[hot_dog] 0 Buy[fries] 0 Buy[macaroni] 0 Buy[pizza] 0 Buy[salad] 0 -Buy[milk] 6.9701388888888891e+00 -Buy[ice_cream] 2.5913194444444447e+00 +Buy[milk] 6.8 +Buy[ice_cream] 2.90921052631579 diff --git a/tests/examples/facility_problem/results/gurobipy.lp b/tests/examples/facility_problem/results/gurobipy.lp index 24a532f..f6b0f61 100644 --- a/tests/examples/facility_problem/results/gurobipy.lp +++ b/tests/examples/facility_problem/results/gurobipy.lp @@ -31,4 +31,5 @@ Subject To Bounds Binaries open[0] open[1] open[2] open[3] open[4] + End diff --git a/tests/examples/facility_problem/results/pyoframe-problem.lp b/tests/examples/facility_problem/results/pyoframe-problem.lp index 3a5e156..25f9329 100644 --- a/tests/examples/facility_problem/results/pyoframe-problem.lp +++ b/tests/examples/facility_problem/results/pyoframe-problem.lp @@ -19,31 +19,11 @@ con_meet_demand[3]: transport[3,0] + transport[3,1] + transport[3,2] + transport bounds -0 <= open[0] <= 1 -0 <= open[1] <= 1 -0 <= open[2] <= 1 -0 <= open[3] <= 1 -0 <= open[4] <= 1 -0 <= transport[0,0] <= inf -0 <= transport[0,1] <= inf -0 <= transport[0,2] <= inf -0 <= transport[0,3] <= inf -0 <= transport[0,4] <= inf -0 <= transport[1,0] <= inf -0 <= transport[1,1] <= inf -0 <= transport[1,2] <= inf -0 <= transport[1,3] <= inf -0 <= transport[1,4] <= inf -0 <= transport[2,0] <= inf -0 <= transport[2,1] <= inf -0 <= transport[2,2] <= inf -0 <= transport[2,3] <= inf -0 <= transport[2,4] <= inf -0 <= transport[3,0] <= inf -0 <= transport[3,1] <= inf -0 <= transport[3,2] <= inf -0 <= transport[3,3] <= inf -0 <= transport[3,4] <= inf +open[0] <= 1 +open[1] <= 1 +open[2] <= 1 +open[3] <= 1 +open[4] <= 1 binary @@ -53,4 +33,5 @@ open[1] open[2] open[3] open[4] + end diff --git a/tests/test_examples.py b/tests/test_examples.py index 44a905f..51cb142 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -49,15 +49,15 @@ def test_examples(example: Example): symbolic_solution_file = symbolic_output_dir / "pyoframe-problem.sol" dense_solution_file = dense_output_dir / "pyoframe-problem.sol" - dense_model = main_module.main( - input_dir, directory=dense_output_dir, solution_file=dense_solution_file - ) symbolic_model = main_module.main( input_dir, directory=symbolic_output_dir, solution_file=symbolic_solution_file, use_var_names=True, ) + dense_model = main_module.main( + input_dir, directory=dense_output_dir, solution_file=dense_solution_file + ) if example.check_params is not None: for param, value in example.check_params.items(): @@ -141,7 +141,9 @@ def check_sol_equal(expected_sol_file, actual_sol_file): expected_result, actual_result ): assert expected_name == actual_name - assert expected_value - tol <= actual_value <= expected_value + tol + assert ( + expected_value - tol <= actual_value <= expected_value + tol + ), f"Solution file does not match expected values {expected_sol_file}" def parse_gurobi_sol(sol_file_path) -> List[Tuple[str, float]]: