This type of problem is usually handed by employing a standardized
file format tailored to the problem at hand.  For linear programming
problems, the old, commonly-used format is MPS:

http://en.wikipedia.org/wiki/MPS_(format)

I don't know if there is a format which might be better/newer (if any)
since I don't pretend to be an expert in this area.

Nonetheless, I think your best bet would be to find your preferred
file format for LP problems and write an importer for it (or find one
which somebody has already created).  Don't try to write a parser for
your own format since it's a pain to do, and the problem has already
been solved a number of times.

Best of luck,

Stuart



On Tue, 18 Nov 2014, Bodo Kaiser wrote:

In university we have a course where we have a course where you define a
"linear program" to find out which product or product-combination is best
to product to have maximum revenue.

The basic approach is to define a target equation:

z = 4x + 3y


x := amount of product 1
y := amount of product 2

which we maximize under some side conditions:

1. 5x + 10y ? 100
2. x ? 20


The first case could mean that we have 100h of working hours as capacity
where it takes 5h to produce product 1 and 10h to produce product 2.
The second case could mean that we have to supply the market with a minimum
amount of 20 units of product 1.

You can put this into a matrix:

A = [5 10 1 0 100; 1 0 0 1 20; 4 3 0 0 -1]


and apply the "Simplex" algorithm to find the value of x and y where z
reaches maximum without breaking side conditions.

To cut a long story short to apply the simplex algorithm we need to
transform all conditions into a "canonical form" (e.g. convert greater then
to less then).
If I now would like to write a julia script which does solve linear
programs for me I need to "read" the equation and change it.
Do I need to write some sort of string based equation parser or is there
some package which would do this for me?

Best,
Bo

Reply via email to