help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] how to read files in *.txt format


From: Brady Hunsaker
Subject: Re: [Help-glpk] how to read files in *.txt format
Date: Fri, 15 Oct 2004 21:53:35 -0400

On Tue, 2004-10-12 at 00:27, Ricardo A. Castro wrote:
> Dear Andrew,
> 
> I'm begining to apply LP problem to my research (My 1th time in a real LP
> problem and program) and It's just a part of my work, please I thank you
> very much about your reply.
> 
> So, I have a difficulty finding a solution to my LP problem. Here are some
> details.
> Let z be the object function
> z=[0 0 0 ... 1] [x1
>                  x2
>                  :
>                  xn
>                  c]
> (loosely speaking, z = c)
> subject to the linear constraint
> [A]*[x] - [b] + c*[e] = 0
> and the variable boundaries
>     0 =< c =< 1
> [x_min] =< [x] =< [x_max],
> where ''A'' is a square matrix of n=2000x2000 elements, ''b'' is a vector
> of 2000 elements, ''c'' is a constant (real number), "e" is a vector of
> 2000 elements, and "x" is a vector of 2000 elements (which is what I am
> looking for!). I would like to know the sub-routine (or function) used to
> find "x", considering that the matrix "A" is in text format (A.txt); on
> the other hand, the vectors "b" and "e" are "b.txt" and "e.txt", while
> ''x_min'' and ''x_max'' are "x_min.txt" and "x_max.txt", in text format,
> respectively. I believe this has been done already by you or somebody
> else.
> 

GLPK currently accepts four input formats: MPS, CPLEX LP, GNU MathProg
(subset of AMPL modeling language), and GNU LP format (a native GLPK
format).  Any other format will either need to be converted to one of
these formats, or you can use the GLPK API combined with your own
parsing routines.  If you only have a few files I recommend converting
to one of those formats.  If you have many, then you will probably need
to write your own parser and load the problem using GLPK's API.  See the
reference manual for the API.

It may be that someone else on the list has already done something like
this, but I don't remember noticing the discussion.  You'll probably
have to give more details about the current format of the .txt files if
you want to see if that is the case.

If you plan to convert your data, I would recommend either CPLEX LP or
GNU LP format.

Brady






reply via email to

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