A company produces i different products and at the end of a week (six working days) has to meet a weekly demand (WeeklyDemand). The production manager knows how many pieces of each product can be produced within one hour (CycleTimes) and is limited to a maximum capacity of hours per day (WeeklyCapacity).

The optimal production program (ProductionProgram) can be calculated as follows:

The variance of the production program of each product must be minimised (see MinVarProductionProgram).

The production program of each product has to meet its total demand per week (ConstraintDemand)

The production program must not exceed the available max. capacity (ConstraintCapa).

MinVarProductionProgram represents a non-linear function. Hence I was thinking about a Lagrangian relaxation approach.

Your objective "function" is a list. Do you want to minimize its sum? The sum of its squares? (That would be nicer because then you'll have a quadratic objective.) For that could use MinStandDeviProductionProgram = Simplify[StandardDeviation /@ ProductionProgram, Assumptions -> Element[Flatten@ProductionProgram, Reals]]; MinStandDeviProductionProgram.MinStandDeviProductionProgram
–
Daniel LichtblauMay 9 '12 at 23:36

@belisarius: No, it's not homework. I'm trying to level the production in the company I work for.
–
JohnMay 9 '12 at 23:39

@John Sorry, but the writing sounds like a homework or book exercise. That doesn't mean you will not get answers, but we answer homework-related questions in a more "teach to fish" way.
–
belisariusMay 9 '12 at 23:39

@belisarius: :D no problem. In fact it's been my intention to write it like that. Sometimes this style is more comprehensive than the abstract way.
–
JohnMay 9 '12 at 23:44

Since the objective is nonlinear Mathematica only has NMinimize to try to enforce integrality of variables. Here is the altered code for this situation. I start by rounding the result from FindMinimum, to be used as initial variable ranges for NMinimize.

As the message indicates, possibly one could do better. Notice though that the min is now considerably lower than what we had from FindMinimum, so progress has been made in the globval optimization effort. And of course we can keep going. This time I'll narrow the start range lengths.

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.