help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Name assignments to a large number of variables


From: Erwin Kalvelagen
Subject: Re: [Help-glpk] Name assignments to a large number of variables
Date: Mon, 23 Mar 2015 20:59:57 -0400

I would suggest to first prototype the model using the GLPK modeling language.You can experiment with formulations and observe performance of the solver. When translating this into a "flat" C representation, Inventing a naming scheme is often not extremely difficult, e.g. use something like "x_1_2_3_4" which can be assembled or parsed when needed . 

----------------------------------------------------------------
Erwin Kalvelagen
Amsterdam Optimization Modeling Group
address@hidden
http://amsterdamoptimization.com
----------------------------------------------------------------

On Sun, Mar 22, 2015 at 5:35 AM, john tass <address@hidden> wrote:
Good morning to everyone,
I have a question which may be too simple to answer. Nevertheless I am not quite sure how to proceed.
I intend to use GLPK within an ANSI C application and I want to use the API of GLPK.
The model I want to solve is too large as far as its size is concerned, i.e. it contains a large number of decision variables. For instance, I have to use the binary variables Xtcpd, where t, c, p, d are indices, t = 1,...,100, c = 1,...,30, p = 1,...7, d = 1,..,5. So far, the number of Xtcpd variables is obviously 100*30*7*5 = 105000. In addition, I need to use an extra large amount of auxiliary variables, and a large number of constraints.
The question is how to create the names of all these variables and the names of all these constraints. Obviously, I can not create all these names in a hard coded fashion. Perhaps I can make use of matrices (?). An if so, how exactly shall I write the code?
Any answer will be very appreciated.

--
Ioannis X. Tassopoulos

_______________________________________________
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]