help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Sparse matrix representation in GLPK?


From: glpk xypron
Subject: Re: [Help-glpk] Sparse matrix representation in GLPK?
Date: Fri, 20 Jun 2008 07:45:20 +0200

Hello Yaron,

if You have a problem where all 5000 warehouses can deliver to all 5000 
customers sparsity cannot be exploited.

If each warehouse can only deliver to a subset of the customers appropriate 
modeling would be to create a set consisting of the valid combinations only (L 
in the appended example).

As You are obviously handling large amounts of data consider linking to an SQL 
data base with Your sample data. See doc/table.txt in the source distribution
http://glpk.dyndns.org/viewvc/svn/glpk/glpk/trunk/glpk-4.28/doc/tables.txt?revision=202
and the examples in examples/sql.

Best regards

Xypron

#warehouses
set W;

#customers
set C;

#distribution lanes
set L dimen 2;

#demand
param dem{c in C};

#capacity
param cap{w in W};

#distance
param dist{(w,c) in L};

#selected distribution channel
var x{(w,c) in L} >= 0;

minimize totalCost :
  sum{(w,c) in L} x[w,c] * dist[w,c];

s.t. satisfaction{c in C} :
  sum{(w,c) in L} x[w,c] - dem[c] = 0;
s.t. capacity{w in W} :
  sum{(w,c) in L} x[w,c] - cap[w] <= 0;

solve;
display x;

data;
set W := w1, w2, w3;
set C := c1, c2;
set L :=
  (w1, c1)
  (w1, c2)
  (w2, c1)
  (w3, c2);
param dem :=
  c1 20
  c2 25;
param cap :=
  w1 18
  w2 37
  w3 10;
param dist :=
  [w1, c1] 4
  [w1, c2] 7
  [w2, c1] 2
  [w3, c2] 1;
end;

-------- Original-Nachricht --------
> Datum: Thu, 19 Jun 2008 13:46:09 -0700
> Von: "Yaron Kretchmer" <address@hidden>
> An: address@hidden
> Betreff: [Help-glpk] Sparse matrix representation in GLPK?

> Hi There
> For a VLSI application, I'm trying to solve a variant of the warehouse
> location problem. My problem stems from the fact that there are ~5K
> "customers" and "warehouses", which translates into a 5K by 5K matrix.
> This
> leads me to wonder whether GLPK supports some sort of sparse matrix
> representation, one which support mathprog matrix multiplcations etc. ?
> 
> Thanks
> Yaron

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer




reply via email to

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