help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Specifying a constraint in CPLEX notation


From: glpk xypron
Subject: Re: [Help-glpk] Specifying a constraint in CPLEX notation
Date: Thu, 04 Oct 2012 08:25:12 +0200

Hello Reg,

which problems you can formulate does not depend on the input language to GLPK. 
Using the GMPL language would make writing the input file much easier. See 
glpk-4.47/doc/gmpl.pdf

> I want to constrain A[i] to be zero if all the B[i][j] in n are zero.
Checking if B[i][j] is zero will get you into trouble, if B[i,j] are not binary 
or integer. Would you consider 1E-30 as zero?

You will either have to introduce additional binary variables definining if 
B[i,j] is zero, or accept inaccuracies, e.g. in:

-M * sum{i in I, j in J} B[i,j] <= A[i] <= M * sum{i in I, j in J} B[i,j];

Best regards

Xypron

-------- Original-Nachricht --------
> Datum: Wed, 3 Oct 2012 09:55:18 -0700 (PDT)
> Betreff: [Help-glpk] Specifying a constraint in CPLEX notation

> I'm doing basis pursuit using glpsol w/ input in CPLEX LP format. This has
> worked extremely well, but I decided to modify my problem formulation and
> have gotten myself into trouble. 
> 
> The new problem formulation is:
> 
> D[k] = sum(i in m)(A[i] + sum(j in n)( B[i][j]*S[j][k]))
> 
> where the A[i] & B[i][j] are unknowns.
> 
> I want to constrain A[i] to be zero if all the B[i][j] in n are zero.
> 
> A[i] is free
> B[i][j] >= 0
> 
> m < 10
> n < 300
> 
> Can I do this in CPLEX LP format or do I need to switch to another
> notation or C?   Are there any references on doing this?  
> 
> The closest thing I found was section 20.2 in the AMPL book, but I don't
> see how to apply that to my problem. I'm a geoscientist and a long way from
> home.  So even the obvious can be baffling to me.
> 
> Thanks,
> Reg
> 
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-glpk



reply via email to

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