help-glpk
[Top][All Lists]
Advanced

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

glpsol will not handle example


From: Michael Hennebry
Subject: glpsol will not handle example
Date: Sun, 12 Nov 2023 13:08:09 -0600 (CST)
User-agent: Alpine 2.21 (DEB 202 2017-01-01)

From the glpk manual, I copied example E.1 to ex1.gmpl .
glpsol did not like it:
[hennebry@fedora triangle-free]$ glpsol --glp ex1.gmpl
GLPSOL--GLPK LP/MIP Solver 5.0
Parameter(s) specified in the command line:
 --glp ex1.gmpl
Reading problem data from 'ex1.gmpl'...
ex1.gmpl:1: error: problem line missing or invalid
GLPK LP/MIP file processing error
[hennebry@fedora triangle-free]$

Here is ex1.gmpl:
# A TRANSPORTATION PROBLEM
#
# This problem finds a least cost shipping schedule that meets
# requirements at markets and supplies at factories.
#
# References:
#
Dantzig G B, "Linear Programming and Extensions."
#
Princeton University Press, Princeton, New Jersey, 1963,
#
Chapter 3-3.
set I;
/* canning plants */
set J;
/* markets */
param a{i in I};
/* capacity of plant i in cases */
param b{j in J};
/* demand at market j in cases */
param d{i in I, j in J};
/* distance in thousands of miles */

param f;
/* freight in dollars per case per thousand miles */
param c{i in I, j in J} := f * d[i,j] / 1000;
/* transport cost in thousands of dollars per case */
var x{i in I, j in J} >= 0;
/* shipment quantities in cases */
minimize cost: sum{i in I, j in J} c[i,j] * x[i,j];
/* total transportation costs in thousands of dollars */
s.t. supply{i in I}: sum{j in J} x[i,j] <= a[i];
/* observe supply limit at plant i */
s.t. demand{j in J}: sum{i in I} x[i,j] >= b[j];
/* satisfy demand at market j */
data;

set I := Seattle San-Diego;
set J := New-York Chicago Topeka;
param a := Seattle
San-Diego350
600;
param b := New-York
Chicago
Topeka325
300
275;
param d :New-York
2.5
2.5
Seattle
San-Diego
Chicago
1.7
1.8
param f := 90;
end;

What is going on and what can I do about it?

--
Michael   hennebry@mail.cs.ndsu.NoDak.edu
"I was just thinking about the life of a pumpkin.  Grow up in the sun,
happily entwined with others, and then someone comes along,
cuts you open, and rips your guts out."      --       Buffy



reply via email to

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