[Top][All Lists]

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

[Help-glpk] How to code restriction on number of variables > 0

From: Baake, Wouter
Subject: [Help-glpk] How to code restriction on number of variables > 0
Date: Thu, 20 Feb 2014 10:49:06 +0000



I'm modelling a problem where I need to make several products with different specifications. Each product undergoes several unit operations where ingredients are added.

var ingredient_used {Products, Unit_operations,Ingredients} >= 0;


Each ingredient has a cost and the total cost is to be minimized:

minimize total_cost: sum{p in Products,u in Unit_operations, i in Ingredients}  cost[i] * ingredient_used [p,u,i];


Each ingredient consists of several elements in different concentrations. Each of the products has an aim value for concentration of each of the elements in the product:

Subject to {p in Products, e in Elements}: sum {u in Unit_operations, i in Ingredients} (ingredient_used [p,u,i]*concentration[i,e]) = aim[p,e];


This problem I can model and solve, but I need to add some more constraints.

One constraint is that there is a maximum number of ingredients that can be kept in stock at a given unit operation. As an example, at the first unit operation, I cannot keep more than 10 ingredients in stock, but the amount per ingredient is unlimited.


How could I translate this into a mathprog constraint?






This transmission is confidential and must not be used or disclosed by anyone other than the intended recipient. Neither Tata Steel Europe Limited nor any of its subsidiaries can accept any responsibility for any use or misuse of the transmission by anyone.

For address and company registration details of certain entities within the Tata Steel Europe group of companies, please visit


reply via email to

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