How to include a binary variable in GMP::Column::SetAsMultiObjective ?

  • 3 September 2023
  • 5 replies
  • 83 views

Badge +1

Hi All,

I hope you are doing well! I have a question:

I am programming a model with 3 objective functions. The goal is to find the best locations for production.

I have diffrect sources, one destination and 4 products.

All the objective functions are linear and I used GMP::Column::SetAsMultiObjective to solve them similar.

 

The first function minimizes the costs (price * X(decision variable) + transportation cost * X)

The second one minimizes the produced CO2 (CO2 in production * X + CO2 during transport * X)

In the last one I want to maximize the social benefit, therefore I wanted to use a binary variable, so if X at a source location is > 0 the binary Variable Y should be 1 (0 otherwise).

so the objctive function should be: (Number of created Jobs + other social aspects) * Y

 

This is what I got so far:

 

When I add Y to v_objectiveFunktionSocial the error appears that multi objectives are only for linear models.

Is there a way to work with a binary variable here? Or mybe someone has an idea how I could change my social objective function to get similar results (bc I don’t want this to depend on the amolunt of the produced product)…

 

I hope you can understand my problem! Many thanks in advance!!!

Best, Eddy :)

 


5 replies

Userlevel 5
Badge +4

Hi @Eddy. Using a binary variable inside one of the (multi) objectives should not be a problem. I have no idea why you get this error; I would need the AIMMS project to find out. Could you please add your project here, preferably after adding it to a zip file, or send it to our support by email if your project contains sensitive information?

Badge +1

Hi Marcel,

thanks a lot for your reply!

The AIMMS Project is atteched. (there is only one AIMMS Project and only one set of data in the folder)

I am also not so sure if the “SolveMultiObj” Procedere is correct, bc when I let this run the first time it gives me this solution:

but if i let it run again it gives this solution:

Do you know what the problem could be here?

 

But back to my first question:

Is it possible to change the v_supply variable to a binary one? 

So it says:

Y is 1 if source i is used for product i and is 0 if it’s not opend? So that the created jobs do not depend on the amount of the product..

 

I hope you can understand what i am trying to say.

 

Many thanks in advance!

 

Best regards,

Eddy

Userlevel 5
Badge +4

Hi @Eddy. Thanks for sharing the project. The procedure SolveMultiObj misses a call to GMP::Instance::Generate. I added that function and used ‘mp_Cost’ as its argument because I could not find ‘mp_BW’.

If I run SolveMultiObj then I do not get an error and if I run it multiple times then I always get the same solution, namely your second solution (with v_objectiveFunctionCost equal to 118).

I have not been able to reproduce the error with the binary variable.

Not sure whether I understand your question about Y but you could create a constraint v_supply(...) <= M * Y(...), where M is some large positive value, and then use Y, instead of v_supply, in the definition of v_totalCreatedJobs.

Badge +1

Thanks for your help @Marcel Hunting !

the SolveMultiObj is running now.

I tried to implement the constraint v_supply(...) <= M * Y(...) like this:

 

But now the solution for the objective function v_objectiveFunctionSocial and the solution for v_totalCreatedJobs always stays the same..

The new file is attached..

 

Do you know what the problem is?

 

Thanks!

Userlevel 5
Badge +4

Hi @Eddy. For your model its is beneficial to set all v_Y to 1 because the model is (indirectly) maximizing the sum of all v_Y(i_source, i_destination, i_product, i_transportationmode). This is because you use a weight of -1 for v_objectiveFunctionSocial in the procedure GMP::Column::SetAsMultiObjective().

If this is indeed the way you want to model v_Y then you should realize that it is beneficial for the optimizer to set v_supply(i_source, i_destination, i_product, i_transportationmode) to a small positive value in order to make v_Y(i_source, i_destination, i_product, i_transportationmode) equal to 1.

In my opinion it makes more sense to (indirectly) minimize the sum of all v_Y, and therefore use a weight of 1 for v_objectiveFunctionSocial in the procedure GMP::Column::SetAsMultiObjective().

Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator