Search code examples
pythonoptimizationmathematical-optimizationpyomo

objective function with binary variables


I am working on a complex model in pyomo. Unfortunately, i have to change the formula of the objective function, based on how is the previous value.

In particular my objective function is composed of two terms ,call them A and B, that have different order of magnitude (A is usually 2 or 3 order of magnitude higher than B, but this may vary)

In order to guarantee that A and B have the same weight of the formula, i need to write my objective function as below:

objective= A + B*K`

Where K is the value which bring the second term at the same scale/magnitude of A

example:
A=4e10
B=2e3
K=1e(10-3)=1e7

The problem is that, in order to know K, i must know the values of A and B, but pyomo doesn't give value, it just pass an expression to the solver.

I have read that thanks to a smart use of binary variables is possible to overcome this issue, anyone could suggest a useful methodology?

Kind regards


Solution

  • It seems like you are dealing with a multi-objective optimization problem. Since the values of variables involved in A and B are not known before solving the model, you can't define the value of K based on A and B.

    There are different ways to solve multi-objective optimization problems which you can consider for your specific problem (e.g., ε-constraints method). In these problems, usually you are not interested in finding a single solution, but finding a set of Pareto optimal solutions which are not dominated by any other solution in the feasible region.