help-glpk
[Top][All Lists]

## Re: [Help-glpk] A Simple MIP model in MathProg - (simple cplex mip model

 From: Noli Sicad Subject: Re: [Help-glpk] A Simple MIP model in MathProg - (simple cplex mip model included) Date: Wed, 7 Nov 2012 11:36:04 +1100

```You are saying that this formulation will give the right results.

#######
param number := 4;

set NUMBER := {1..number};

var x{n in NUMBER}, integer;

s.t. c1: - x + x + x+ 10 * x, <= 20;
s.t. c2: x - 3 * x + x, <= 30;
s.t. c3: x - 3.5 * x, == 0;
s.t. x1: 0 <= x <= 40;
s.t. x4: 2 <= x <= 3;

maximize obj: x + 2 * x + 3 * x + x;

#####

X2 and X3 needs to Float / Real, based on the results of the Original
Cplex problem.

This is the answer of the CPLEX problem.

######
No. Column name       Activity     Lower bound   Upper bound
------ ------------    ------------- ------------- -------------
1 x1                         40             0            40
2 x2                       10.5             0
3 x3                       19.5             0
4 x4           *              3             2             3
######

Still the question remains the same,

How you exactly translate this variable

var x{n in NUMBER}?

Noli

On 11/7/12, Raniere Gaia Silva <address@hidden> wrote:
>
> ###
>
> param number := 4;
>
> set NUMBER := {1..number};
>
> var x{n in NUMBER};
>
> s.t. c1: - x + x + x+ 10 * x, <= 20;
> s.t. c2: x - 3 * x + x, <= 30;
> s.t. c3: x - 3.5 * x, == 0;
> s.t. x1: 0 <= x <= 40;
> s.t. x4: 2 <= x <= 3;
>
> maximize obj: x + 2 * x + 3 * x + x;
>
> end;
>
> ###
>
> Once your problem is a MIP, for the integer variables you must use:
>
> ###
>
> var x{n in NUMBER}, integer;
>
> ###
>
> And for binary variables:
>
> ###
>
> var x{n in NUMBER}, binary;
>
> ###
>
> Raniere
>

```