From ApCoCoAWiki
Revision as of 15:04, 12 November 2008 by StK (talk | contribs)


solve linear programms


GLPK.LPSolv(Objective_Function:POLYNOM, EQ_Polynoms:LIST, LE_Polynoms:LIST, GE_Polynoms:LIST, Bounds:LIST, Methode:STRING, MinMax:STRING)


The basic idea behind this package is to make the linear optimization program GLPK usable in/with ApCoCoA.

The package GLPK contains various functions that let you make use of the GLPK library, rather the stand-alone LP/MIP Solver glpsol.

Objective_Function: A polynomial which is equivalent to the linear objective Function.

EQ_Polynoms: List of Polinomials, which are equivalent to the equality-part in the list of conditions.


<em>Linear programming example 1996 MBA exam</em>

A cargo plane has three compartments for storing cargo: front, centre and rear. 
These compartments have the following limits on both weight and space:

Compartment   Weight capacity (tonnes)   Space capacity (cubic metres)
Front         10                         6800
Centre        16                         8700
Rear          8                          5300

Furthermore, the weight of the cargo in the respective compartments must be the same 
proportion of that compartment's weight capacity to maintain the balance of the plane.

The following four cargoes are available for shipment on the next flight:

Cargo   Weight (tonnes)   Volume (cubic metres/tonne)  Profit (£/tonne)
C1      18                480                          310
C2      15                650                          380
C3      23                580                          350
C4      12                390                          285

Any proportion of these cargoes can be accepted. The objective is to determine how much 
(if any) of each cargo C1, C2, C3 and C4 should be accepted and how to distribute each 
among the compartments so that the total profit for the flight is maximised. 

To solve this problem we had to compose a linear program.