Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

ISTANBUL TECHNICAL UNIVERSITY

FACULTY OF MANAGEMENT
INDUSTRIAL ENGINEERING DEPARTMENT

END331E Operations Research I

Instructor: Hüseyin Kutay Tinç

Course Assistant: Seval Ata Demirkan


Zikriye Melisa Erdoğan
Berk Memduhi 070200105
Mert Çoban 070200119
F. Buğrahan Sülek 070210808
Selin Sezgi Erdoğan 070200160
Yasin Arslan 070200107
Answer – 1

PARAMETERS
İ = {1,…,7} (Districts A,B,C,D,E,F,G)
J = {1,…,10,Jd} (Operators)
K = {1,…,5} (Days, Monday to Friday)

DECISION VARIABLES
Sijk = # of service by an operator on which district and
which day

Cjk = Capacity table from the question

OBJECTIVE FUNCTION

Min z =1000 (j = jd)

CONSTRAINTS

Sijk => 0 ꓯ i, j, k (Positive constraint)


(Constraints of operator locations)
S1 ijk = (i = {1,3,7}, j = {1,2,3},
S2 ijk = (i = {1,4,6}, j = {4,5,6},
S3 ijk = (i = {2,3,4}, j = {7,8},
S4 ijk = (i = {2,4,5}, j = {9,10},
(Capacity constraint)
Sijk Cjk (j = {1, …,10}, k = {1, …,5}),

Answer – 2

PARAMETERS
i = Product name/type {1,2}
j = Which factory produces it {1 = China, 2 = Korea}
k = What month is it produced {1 = November, 2 =
December}
m = Production method {1, 2}
n = If it’s shipped or not {1 = not shipped, 2 = shipped}

DECISION VARIABLES
Xijkmn = The amount of the product produced with each
types, their original factories, the month that they are
produced, their production method, and if they are shipped
or not)

Zij = Each type of products that are left in each factories’


inventories
Cijm = PRODUCTION COST (Table in homework file)

Pijm = PRODUCTION AMOUNT (Table in homework file)

OBJECTIVE FUNCTION
REVENUE FROM SELLING THE PRODUCTS

Σ(83X 1jkm1 + 112X2jkm1 + 74X1jkm2 + 105X2jkm2) (j = {1, 2}, k = {1, 2}, m =


{1,2})
Revenue from sales calculated by summing up locally produced
products and shipped products separately

INVENTORY COST

Σ(3Z + 4Z2j) (j = {1,2})


1j

Costs from items left in inventory

PRODUCTION COST

Σ(X x (Cijm)) (i = {1, 2}, j = {1, 2}, k = {1, 2}, m = {1,2}, n = {1, 2})
ijkmn

Costs from production of the materials by multiplying the specified


products with their costs from the table summed up

COMBINED FUNCTION

max z = Σ(83X + 112X + 74X + 105X ) (j = {1, 2}, k =


1jkm1 2jkm1 1jkm2 2jkm2

{1, 2}, m = {1,2}) - Σ(3Z + 4Z ) (j = {1,2}) - Σ(X


1j 2j x (C )) (i = {1, 2}, j
ijkmn ijm

= {1, 2}, k = {1, 2}, m = {1,2}, n = {1, 2})

CONSTRAINTS

POSITIVE CONSTRAINT

Xijknm, Zij => 0 ꓯ i,j,k,n,m


DEMAND CONSTRAINT

Demands for November calculated by adding the


produced product type and its factory location and adding
its shipped counterpart if needed. The inventory leftovers
are also added to the right side since they can be counted
as excess products if the production exceeds the demand

X111m1 + X121m2 <= 3600 + Z11

X121m1 + X111m2 <= 4900 + Z12

X211m1 + X221m2 <= 4500 + Z21

X221m1 + X221m2 <= 5100 + Z22

Demands for December calculated the same way as


before, the only difference being the inventory variable is
now supposed to decrease the needed amount as they will
supply a certain amount of demand themselves

X112m1 + X122m2 <= 6300 - Z11

X122m1 + X112m2 <= 4200 - Z12

X212m1 + X222m2 <= 5400 - Z21

X222m1 + X212m2 <= 6000 - Z22

INVENTORY CONSTRAINT

Each factory can hold 1000 products in total


Σ (Z1j + Z2j) <= 1000 ꓯ j
PRODUCTION CONSTRAINT

Xijkmn <= Pijm x (17 + 3K) ꓯ i,j,k,n,m

This constraint indicates that one type of product that is


produced in one factory with one of the processes will have a
special production limit according to the Daily production limit
table. Furthermore the last part of the inequality is present to
calculate the total days worked in one month.
When k = 1, (17 +3k) = 20 which is the working days of
November and when k = 2, (17 +3k) = 23 which is the working
days of December.

Answer – 3

SETS
i product name/type
/1*2/
j factory
/1*2/
k month
/1*2/
m production method
/1*2/
n shipped or not
/1*2/;
PARAMETERS
demand(i,k) demand for each product in each month
/1.1 3600, 1.2 4500, 2.1 6300, 2.2 5400/
production_days(j,k) production days available in each month for each
factory
/1.1 20, 1.2 23, 2.1 20, 2.2 23/
inventory_capacity(i) inventory capacity for each product
/1 1000, 2 1000/
holding_cost(i) cost of holding inventory for each product
/1 3, 2 4/
net_sales_revenue(i) net sales revenue for each product sold within
the country
/1 83, 2 112/
shipping_cost(i) extra shipping cost for each product shipped to the
other factory
/1 9, 2 7/;

TABLE C(i,j,m)
1 2
1 62 59 61 65
2 78 85 89 86;

TABLE P(i,j,m,m)
1.1 2.1 1.2 2.2
1.1 100 140 130 110
2.1 120 150 160 130
1.2 100 140 130 110
2.2 120 150 160 130;

VARIABLES
X(i,j,k,m,n) amount of product produced with each type, factory,
month, production method, and if it's shipped or not
Z(j,i) amount of each type of product left in each factory's inventory
Profit total profit to be maximized;

POSITIVE VARIABLES
X, Z, Profit;

EQUATIONS
Production_Constraint(j,i,k) production cannot exceed production
days
Inventory_Constraint(i) inventory cannot exceed capacity
Demand_Constraint(i,k) demand must be met
Profit_Equation objective function to maximize profit;

Production_Constraint(j,i,k)..
sum(m, sum(n, X(i,j,k,m,n) * P(i,j,m,k)) ) <= production_days(j,k) *
Z(j,i);

Inventory_Constraint(i)..
sum(j, Z(j,i)) + sum(m, sum(n, X(i,j,1,m,n) )) + Z(i) =
inventory_capacity(i);
Demand_Constraint(i,k)..
sum(j, sum(m, sum(n, X(i,j,k,m,n) ))) >= demand(i,k);

Profit_Equation..
Profit = sum(j, sum(i, net_sales_revenue(i) * sum(k, sum(n, X(i,j,k,1,n)
+ X(i,j,k,2,n) ))))
- sum(j, sum(i, sum(k, sum(m, sum(n, X(i,j,k,m,n) * C(i,j,m)))) +
sum(i, Z(j,i) * holding_cost(i))))
- sum(i$(i=1)), sum(j$)

Answer – 4

Sets
H /1*8/
N /1*5/
M /1*3/
S(N+1..N+M)
V /1*4/;

Parameters
d(N, S)
q(N)
c(V)
D(V)
gamma(N, S);

Scalar
inf / 100000 /;

d(N, S) =
0, 20, 15, 30, 0, 20, 15, 30, 0, 20, 15, 30,
20, 0, 10, 25, 20, 0, 10, 25, 20, 0, 10, 25,
15, 10, 0, 35, 15, 10, 0, 35, 15, 10, 0, 35,
30, 25, 35, 0, 30, 25, 35, 0, 30, 25, 35, 0,
0, 20, 15, 30, 0, 20, 15, 30, 0, 20, 15, 30,
20, 0, 10, 25, 20, 0, 10, 25, 20, 0, 10, 25,
15, 10, 0, 35, 15, 10, 0, 35, 15, 10, 0, 35,
30, 25, 35, 0, 30, 25, 35, 0, 30, 25, 35, 0;

q(N) = 100, 150, 200, 250, 300;

c(V) = 10, 15, 20, 25;

D(V) = 60, 70, 80, 90;

gamma(N, S) =
0, 50, 100, 0, 0, 50, 100,
0, 0, 50, 100, 0, 0, 50, 100,
0, 0, 0, 50, 0, 0, 0, 50,
0, 0, 0, 0, 0, 0, 0, 0,
0, 50, 100, 0, 0, 50, 100,
0, 0, 50, 100, 0, 0, 50, 100,
0, 0, 0, 50, 0, 0, 0, 50,
0, 0, 0, 0, 0, 0, 0, 0;

Binary Variable
x(H,H,V);
Binary Variable
y(N,S);

Positive Variable
Q(N,V);

Equations
obj
supply(k)
demand(i)
cap(i,j,k)
dist(i,j)
flow(i)
balance;

obj..
z =e= sum((i,j,k)$x(i,j,k)*d(i,j)*q(i)) +
sum((i,j)$gamma(i,j)*y(i,j)*q(i)*300);

supply(k)..
sum((i,j:H)$x(i,j,k)) - sum((j,i:H)$x(i,j,k)) = 0;

demand(i)..
sum((j,k)$x(i,j,k)) + q(i) = sum((j,k)$x(j,i,k));

cap(i,j,k)..
x(i,j,k) <= inf*sum(v$(c(v)=k));

dist(i,j)..
sum(k$(x(i,j,k)=1)) = 1;

flow(i)..
sum((j,k)$x(i,j,k)) = q(i) + sum((j,k)$x(j,i,k));

balance..
sum((i,k)$Q(i,k)) = sum((i,j,k)$x(i,j,k));

option optcr=0.01;
option optca=0.01;
option optcr=0.001;
option optca=0.001;

Initialize Q with a feasible solution


Q(i,k)$(c(k) = 1) = 0;
Q(i,k)$(c(k) = 2) = 0;
Q(i,k)$(c(k) = 3) = 0;
Q(i,k)$(c(k) = 4) = 0;

solve with mip using nlp;

display z.l, x.l, y.l, Q.l;

You might also like