help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Add constraints


From: Heinrich Schuchardt
Subject: Re: [Help-glpk] Add constraints
Date: Thu, 05 Nov 2015 22:26:27 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0

Hello Fernando,

glp_set_mat_row() allows to set the coefficients of the row.

If you deactivate the presolver you can use glp_create_index() to create
a column index and glp_find_col() to identify columns by name using the
index.

Best regards

Heinrich Schuchardt

On 11/05/2015 11:33 AM, Fernando Garcia wrote:
> Good afternoon,
> 
> I am trying to solve a problem of Benders Decomposition. In this method,
> I have to solve iteratively 2 problems until certain conditions are met.
> In each iteration, one constraint is being added to the first problem,
> so I need to know how to introduce this new constraints into it.
> 
> My problems are read from a ".lp" file in a  C++ compiler. For adding
> this constraints I have thought two methods:
> 
> -The first one is creating in this ".lp" file a set
> of *empty* constraints, that I will go filling in each iteration. The
> problem here is that these constraints are occupying much space (even if
> all values there are 0 at the begging).
> 
> -The second one is to add them in each iteration. The problem here is
> that I don't know how to define them. My equations are like the type
> "*s(iteration)=1*", "*z(iteration)=0*", "*h(iteration)=0*", but with the
> functions showed in the manual its hard to understand. For all I read,
> first I have to create the rows (*glp_add_rows(problem, number of new
> constraints)*) and then set their bounds with *glp_set_row_bnds(problem,
> row, type, lowerB,upperB)*. But how can I assigned to them the form of
> the equation to make  "*s(iteration)=1*"?
> 
> I hope you can help me with that, it will be a good support,
> 
> Thanks in advance,
> 
> Fernando




reply via email to

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