# Decision Optimization

View Only

## Is there a way to check feasibilty for given values of decision variables in CPLEX?

• #### 1.  Is there a way to check feasibilty for given values of decision variables in CPLEX?

Posted Mon November 29, 2021 11:20 PM

Hello,

right now I am trying to implement a particle swarm optimization algorithm in CPLEX to solve a Vehicle Routing Problem with a large number of customers.

Firstly, I wrote an optimization model in OPL that is now able to get solutions for smaller instances. In order to now also be able to solve problems with a bigger number of customers, I want to do it using a heuristic I have from a paper (Particle Swarm Optimization).

For this, I am implementing each step of the algorithm in a main-block (control flow) in ILOG Script. In each iteration, the algorithm proposes a solution ( = values for the decision variables) that now needs to be checked if it is feasible and what the solution value is. In the next iteration, the solution then is tried to be improved. This is repeated until a certain number of iterations is reached.

I already got the algorithm to work. But now I don't know how I can do the feasibility check.

I basically now have values for the decision variables that I need to run in the model to check if all constraints hold for this solution. How does this work in CPLEX using control flow?

Obviously, I know how to trigger OPL to generate the model and run the CPLEX solver to get a solution for it, but how does it work when you want to give CPLEX the values for the decision variables and just want it to test the feasibility and not do any optimization?

------------------------------
Johannes Uhrmann
------------------------------

• #### 2.  RE: Is there a way to check feasibilty for given values of decision variables in CPLEX?

Posted Tue November 30, 2021 10:42 AM
One option is to set the lower and upper bounds of each variable to the heuristic value (so that all variables are fixed), have CPLEX solve the model, and check the final solver status (which will presumably be either "optimal" or "infeasible").

------------------------------
Paul Rubin
Professor Emeritus
Michigan State University
------------------------------

• #### 3.  RE: Is there a way to check feasibilty for given values of decision variables in CPLEX?

Posted Tue November 30, 2021 11:27 AM

I'll try that out.

------------------------------
Johannes Uhrmann
------------------------------

• #### 4.  RE: Is there a way to check feasibilty for given values of decision variables in CPLEX?

Posted Wed December 01, 2021 03:29 AM
Same question at https://stackoverflow.com/questions/70108795/is-there-a-way-to-check-feasibilty-for-given-values-of-decision-variables-in-cpl/70168748#70168748 in stackoverflow

------------------------------
[Alex] [Fleischer]
[EMEA CPLEX Optimization Technical Sales]
[IBM]
------------------------------