# Integer variable optimization - decreasing execution time

I have a variable declared as follows in AMPL:

var i {j in UNIT, t in PERIOD}
integer <= 3;

# therefore, an integer variable is declared that can take values ...,-1,0,1,2,3


Below are the two constraints where this integer variable is used.

\begin{align}c(j,t) &\le E(j,t)\cdot i(j,t)\\d(j,t)&\le F(j,t)\cdot i(j,t)\end{align}

The capital letters denote parameters and small letters are variables. There is a need to optimize the integer variable this way for later use in the formulation. Is there a way I can reformulate the constraints or formulate the variable condition declaration as constraint to make the execution time of the program faster?

• Are you sure your declaration precludes negative integer values? I'm not an AMPL user, but that looks rather suspicious to me. – Mark L. Stone Mar 24 '20 at 20:04
• You are correct, I edited that part. – S_Scouse Mar 24 '20 at 20:06
• Can you clarify what the problem is with the current formulation? These constraints seem pretty straightforward -- is there something tricky here that you're trying to accomplish? – LarrySnyder610 Mar 25 '20 at 1:41
• For some reason, the code executes slowly, I was wondering if there is a way I can reformulate that might make the execution faster. – S_Scouse Mar 25 '20 at 12:26