Solving Integer programming example with LPSOLVE: How to add

Solving Integer programming example with LPSOLVE: How to add

Postby Guest » Thu Jan 20, 2022 5:12 pm

Problem:

A company is attempting to decide the mix of products which it should produce
next week. It has seven products, each with a profit (£) per unit and a production
time (man-hours) per unit as shown below:

|Product |Profit (£ per unit) |Production time (man-hours per unit)|
|:---------|:--------------------:|----------------------------------------------|
|1---------| 10------------------| 1.0-----------------------------------------|
|2 --------| 22------------------| 2.0-----------------------------------------|
|3 --------| 35------------------| 3.7-----------------------------------------|
|4 --------| 19------------------| 2.4-----------------------------------------|
|5 --------| 55------------------| 4.5-----------------------------------------|
|6---------| 10------------------| 0.7-----------------------------------------|
|7---------| 115-----------------| 9.5-----------------------------------------|

The company has 720 man-hours available next week.
Incorporate the following additional restrictions into your integer program
(retaining linear constraints and a linear objective):

1. If any of product 7 are produced an additional fixed cost of £2000 is incurred.
2. Each unit of product 2 that is produced over 100 units requires a production
time of 3.0 man-hours instead of 2.0 man-hours (e.g. producing 101 units of
product 2 requires 100(2.0) + 1(3.0) man-hours).
3. If both product 3 and product 4 are produced 75 man-hours are needed for
production line setup and hence the (effective) number of man-hours
available falls to 720 - 75 = 645.

Formulate the problem of how many units (if any) of each product to produce next
week as an integer program in which all the constraints are linear

Variables

- xi (integer >=0) be the number of units of product i produced then the
integer program is
- z7 = 1 if produce product 7 (x7 >= 1), 0 otherwise
- y2 = number of units of product 2 produced in excess of 100 units, y2 >= 0
- z3 = 1 if produce product 3, 0 otherwise
- z4 = 1 if produce product 4, 0 otherwise
- Z = 1 if produce both product 3 and product 4, otherwise

Restrictions

1.0x1 + 2.0x2 + 3.7x3 + 2.4x4 + 4.5x5 + 0.7x6 + 9.5x7 <= 720
- x7 <= Mz7
- x2 <= 100 (This will work because x2 and y2 have the same objective function coefficient but y2 requires longer to produce so will always get more flexibility by producing x2 first (up to the 100 limit) before producing y2.)
- 1.0x1 + (2.0x2 + 3.0y2) + 3.7x3 + 2.4x4 + 4.5x5 + 0.7x6 + 9.5x7 <= 720 - 75Z
- x3 <= Mz3 and x4 <= Mz4
- Z = z3z4

which we linearise by replacing the non-linear constraint by the two linear
constraints
- Z >= z3 + z4 - 1
- Z <= (z3 + z4)/2

Objective
maximise W = 10x1 + 22(x2 + y2) + 35x3 + 19x4 + 55x5 + 10x6 + 115x7

Question : How to add the restrictions to lpsolve to solve the problem?
I'm using https://sourceforge.net/projects/lpsolve/ LpSolve software to help me solve the problem, but i'm having some difficulties writing the restrictions.
Code: Select all
/* Objective function */
max:10x1+22x2+35x3+19x5+10x6+115x7 ;

/* Variable bounds */
x1 >=0;
x2 >=0;
x3 >=0;
x4 >=0;
x5 >=0;
x6 >=0;
x7 >=0;
1.0x1 + 2.0x2 + 3.7x3 + 2.4x4 + 4.5x5 + 0.7x6 + 9.5x7 <= 720;
Guest
 

Return to Simultaneous Equations, Systems of Equations/Inequalities



Who is online

Users browsing this forum: No registered users and 5 guests

cron