pybnb.pyomo.misc

Miscellaneous utilities used for development.

Copyright by Gabriel A. Hackebeil (gabe.hackebeil@gmail.com).

pybnb.pyomo.misc.hash_joblist(jobs)[source]

Create a hash of a Python list by casting each entry to a string.

pybnb.pyomo.misc.add_tmp_component(model, name, obj)[source]

Add a temporary component to a model, adjusting the name as needed to make sure it is unique.

pybnb.pyomo.misc.correct_integer_lb(lb, integer_tolerance)[source]

Converts a lower bound for an integer optimization variable to an integer equal to ceil(ub), taking care not to move a non-integer bound away from an integer point already within a given tolerance.

pybnb.pyomo.misc.correct_integer_ub(ub, integer_tolerance)[source]

Converts an upper bound for an integer optimization variable to an integer equal to floor(ub), taking care not to move a non-integer bound away from an integer point already within a given tolerance.

pybnb.pyomo.misc.create_optimality_bound(problem, pyomo_objective, best_objective_value)[source]

Returns a constraint that bounds an objective function with a known best value. That is, the constraint will require the objective function to be better than the given value.

pybnb.pyomo.misc.generate_cids(model, prefix=(), **kwds)[source]

Generate forward and reverse mappings between model components and deterministic, unique identifiers that are safe to serialize or use as dictionary keys.