optimization programs in APL

Quote:

> > Can anyone point me to some APL/APL2 functions/workspaces with

> > optimization routines, including linear programming (mixed integer),

> > heuristic, genetic algorithm, simulated annealing, etc.

> > How practical is it to use APL for moderate sized linear programming

> > problems?

> A great deal depends on what you mean by `moderate'. IME codes specifically

> designed to handle particular classes of the various programming domains are

> usually able to exploit special characteristics of the problems and provide for

> `special methods' to a much grater degree than general purpose codes, particularly

> those implemented in a language like APL.

> You might want to give some metric that would indicate what you are thinking of

> when you say `moderate'. You might also indicate the broad domain of your problem

> as again IME `small' IP problems are often a lot more demanding computationally than

> `large' LP problems, etc

> ...

Many, many years ago, when I was a young and upcoming APLer (and my

beard was still black, not grey) I rewrote the (in)famous Honey

Blending System for Reckitt & Colman Foods. The system ran on the IP

Sharp time-sharing service and was based around their 43 LINPROG

workspace.

The system was designed to be used by factory production staff to

produce two batches of blended honey, one clear and runny, the other

crystalline and set, from various stocks of raw honey which came from

a number of suppliers around the world. There were, iirc, about ten

or twelve parameters which had to be optimized, with different

optimization values for each of the two blends. In addition, there

were upper and lower constraints for some but not all of these

parameters. Two further restrictions were the requirement to use the

oldest stocks first and to produce the blend at minimal cost, even if

this produced a sub-optimal result.

The way the problem was set up it had 24 or 26 optimizations, plus

about 120 constraints.

As a final twist, instead of using the exact proportions which

resulted from the LP solution, the result had to be rounded so that

each batch consisted of an exact number of full drums from each of the

source stocks. Again, iirc, this meant rounding the proportions to the

nearest 5% of the total.

The system also included a stock control and management system, so

that when running a blend, the factory staff simply had to enter the

stock number(s) of what supplies they had available rather than

entering all the parameters each time.

The system was used on a weekly basis by the honey production

department for several years, until R & C got rid of APL in the late

1980's.

I believe that the original version of this system was written up in

one of the early APL conference proceedings, about 1980.

John Warden

(aka Henry Crun, an ancient Goon and APLer)