help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Problems with Connecting GLPK to Excel


From: aly
Subject: Re: [Help-glpk] Problems with Connecting GLPK to Excel
Date: Thu, 8 Jul 2010 02:21:52 -0400 (EDT)

Hi Xypron, Noli and all,

Thanks for your continuous support. It has always been really helpful.

Now, I have the following problems/concerns. I'd really appreciate any help, 
especially for the first one:

1. I read data and write variable values back to Access. One parameter is 
t_ijp, that is the transportation cost between facility i and facility j for 
product p, and one variable is x_ijp, that is the flow variable from facility i 
to facility j for product p. The facility could be a supplier, transformer or a 
customer. The origin and destination facilities could be a supplier and a 
transformer, or a transformer and another transformer, or a transformer and a 
customer.

In Access, there is a table called Channels, that contains three fields, one 
called Channel ID, another for origin facilities and a third for the 
corresponding destination facilities for all pairs that have flow between them. 

Then, there is a table called ChannelsProducts that has a field for Channel ID, 
another for products, a third for transportation cost (from which t_ijp should 
be read), and a fourth for the flow variable values (which is the one x_ijp 
needs to be written back in).

The question is: how can I read t_ijp from and write x_ijp to this table? As 
you see there are only two fields for the indices (channel and product), while 
t_ijp and x_ijp have three indices (origin facility, destination facility, and 
product).

One way to solve this was to create temporary tables in Access using queries. 
That table would have the 3 necessary indices. But this way is not too 
efficient since it includes extra manual work, especially that I will have to 
copy values back from those temporary tables to the ChannelsProducts table. In 
addition, I might have to a LOT of tables (which is data extensive). Also, it 
doesn't seem to work easily when the origin and destination facilities are of 
the same type (both are transformers).

In AMPL, there is some kind of a "cross" statement that might solve that, but I 
don't know a corresponding one in GLPK, and how to use it if it exists!


2. For another model, I read data and write variable values to Excel. When 
writing variable values to Excel, I put a dummy row with numeric values under 
the columns that should have the variable values (as advised by you before) so 
that the values are pasted as "numeric" instead of text. The problem is that 
when values get written back, some random number of rows are kept empty, and 
then the values start being pasted in rows below those empty rows. Is there any 
way I can force values to be written immediately after that dummy row?


Thanks a lot,

Aly


-- 
PhD Student

Rm. 407 Main Building
H. Milton Stewart School of Industrial and Systems Engineering
Georgia Institute of Technology
765 Ferst Dr., NW
Atlanta, Georgia 30332-0205, USA





reply via email to

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