help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] [Fwd: Modeling GLPK problem statement]


From: Andrew Makhorin
Subject: [Help-glpk] [Fwd: Modeling GLPK problem statement]
Date: Sun, 03 Nov 2013 03:15:51 +0400

-------- Forwarded Message --------
From: Pankhuri Gupta <address@hidden>
To: address@hidden
Subject: Modeling GLPK problem statement
Date: Sat, 2 Nov 2013 18:14:42 -0400

Hi,


I am trying to solve a maximization optimization problem using the GLPK
software. This is my first time and I am having difficulty in
formulating my model. I have tried reading through the entire GLPK
programming manual and other places on the internet, but am not able to
get any handle on how I should formulate my model for these equations.
Can anybody give me an idea as to how can I proceed or any other
material I should look into/refer to? It would be of great help.

I have been trying to solve it using API routine calls in C (as
mentioned in the start of the GLPK manual kit)

 

The problem is mentioned below:

 

                  The objective function that is to be maximized is of
the form:

                   objFunc = (A[1] * y[1])  + (A[2] * y[2]) + (A[3] *
y[3])  +  (A[4] * y[4]) 

                  

                  Constraints:

                                    P = B[1]z[1] + B[2]z[2] + B[3]z[3] +
B[4]z[4] +   B[5]z[5] +  B[6]z[6] +  B[7]z[7]

                                    y[1]  <= max ( C[1]z[1] , C[4]z[4] ,
C[7]z[7]) 

                                    y[2]  <= max ( C[2]z[2],  C[4]z[4])

                                    y[3]  <= max ( C[1]z[1] , C[2]z[2],
C[5]z[5] , C[7]z[7])

                                    y[4]  <= max ( C[3]z[3] , C[5]z[5] ,
C[6]z[6])

 

                  Bounds:

                                    0 <= P <= 500

                                    0 <= y[1] <= 1

                                    0 <= y[2] <= 1

                                    0 <= y[3] <= 1

                                    0 <= y[4] <= 1

                                    z[1], z[2] …..  , z[7] : all are
binary variables.

                  

                  The structural variables (for which I have to find the
values) : z[1], … , z[7]

 

1.    Adding Constraints for y’s: 

I was trying to build a constraint matrix with 7 columns (one for each
z[i]) (and one row for each constraint). However, with this approach I
was not able to model addition of constraints on the y’s (since in this
case it is selecting one maximum value and not a summation of all
values).

Even if I model y’s as:

Y[1]  =  C[1]z[1]W[1] + C[4]z[4]W[2] + C[7]z[7]W[3]

where, only one of W[1], W[2], W[3] can be one, this calls for adding
several more structural variables into my set of equations. 

 

2.    Objective Coefficients:

The objective function is in terms of y’s (and has only 4 values).
Hence, I was confused as to how should I set up my objective
coefficients in the matrix.

 

 

Thanks,

Pankhuri







reply via email to

[Prev in Thread] Current Thread [Next in Thread]