Homework 9
.docx
keyboard_arrow_up
School
University of Illinois, Urbana Champaign *
*We aren’t endorsed by this school
Course
360
Subject
Industrial Engineering
Date
Dec 6, 2023
Type
docx
Pages
9
Uploaded by JusticeButterfly25625
Homework 9 Question 1: Suppose we have a building that is 183 by 200 feet and we want to place 6 departments. The flows between these six departments are shown in the following table a)
Use AMPL to develop an integer programming model to solve this layout problem approximately. Use the above data to create a data file. Solve the problem.
Mod:
reset
;
option
solver gurobi
;
set
departments;
param
area{i in
departments};
param
LowerLength;
param
UpperLength;
param
LowerWidth;
param
UpperWidth;
param
buildingX;
param
buildingY;
param
M;
param
perimeterLower{i in
departments} := 0.99*4*
sqrt
(area[i]);
param
perimeterUpper{i in
departments} := 1.01*4*
sqrt
(area[i]);
param
v{i in
departments, j in
departments};
var
x{i in
departments}>=0;
var
l{i in
departments}>=0;
var
y{i in
departments};
var
w{i in
departments};
var
a{i in
departments, j in
departments};
var
b{i in
departments, j in
departments};
var
zX{i in
departments, j in
departments} binary
;
var
zY{i in
departments, j in
departments} binary
;
minimize
distTimesflow: sum
{i in
departments, j in
departments}v[i,j]*(a[i,j]+b[i,j]);
subject
to
perimeterBound{i in
departments}: perimeterLower[i]<=(2*(w[i]+l[i]))<= perimeterUpper[i];
subject
to
lengthBound{i in
departments}: LowerLength<=l[i]<= UpperLength;
subject
to
widthBound{i in
departments}: LowerWidth<=w[i]<= UpperWidth;
subject
to
buildingLimit{i in
departments}: x[i]<=(buildingX-
l[i]);
subject
to
buildingLimit2{i in
departments}: y[i]<=(buildingY-
w[i]);
subject
to
overlap{i in
departments,j in
departments: i!=j}: x[i]+l[i]<=x[j]+M*(1 - zX[i,j]);
subject
to
overlap3{i in
departments,j in
departments: i!=j}: y[i]+w[i]<=y[j]+M*(1 - zY[i,j]);
subject
to
summationConstraint{i in
departments, j in
departments: i<j}: zX[i,j]+zX[j,i]+zY[i,j]+zY[j,i]>=1;
subject
to
absConstraint{i in
departments, j in
departments}:
a[i,j] >= x[i]+(0.5*l[i])- x[j]-(0.5*l[j]);
subject
to
absConstraint2{i in
departments, j in
departments}: a[i,j] >= -1*(x[i]+(0.5*l[i])-x[j]-(0.5*l[j]));
subject
to
absConstraint3{i in
departments, j in
departments}: b[i,j] >= y[i]+(0.5*w[i])-y[j]-(0.5*w[j]);
subject
to
absConstraint4{i in
departments, j in
departments}: b[i,j]>= -1*(y[i]+(0.5*w[i])-y[j]-(0.5*w[j]));
data
HW9.dat
;
solve
;
display
_varname, _var;
display
distTimesflow;
display
x, y, l, w;
Dat:
set
departments:= 1 2 3 4 5 6;
param
area:=
1 3600
2 10000
3 6400
4 4900
5 8100
6 3600;
param
LowerLength:= 25;
param
UpperLength:= 200;
param
LowerWidth:= 40;
param
UpperWidth:= 200;
param
buildingX:= 183;
param
buildingY:= 200;
param
M:= 100000;
param
v:
1 2 3 4 5 6:=
1 0 0 20 40 60 0
2 0 0 10 15 0 60
3 20 10 0 50 10 50
4 40 15 50 0 10 0
5 60 0 10 10 0 0
6 0 60 50 0 0 0;
Answer:
distTimesflow = 20750
: x y l w :=
1 100 63.4 25 96.2
2 0 23 25 177
3 50 43.2 25 136.6
4 75 53.3 25 116.4
5 125 33.1 25 156.8
6
25 64.6 25 93.8
;
b)
Draw the solution approximately. Why do areas of the departments obtained in the solution not match the required areas? Why area constraints are difficult to add to the model?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help