Vous êtes sur la page 1sur 12

IEE 574 Appl. Deter. Oper. Rsch Dr.

Muhong Zhang
Homework 2 Solutions Dening (Polo) Peng
3.4-11
(a)
Decision Variables:

1
: # of full time consultants working shift 8 A.M. 4 P.M.

2
: # of full time consultants working shift 12 P.M. 8 P.M.

3
: # of full time consultants working shift 4 P.M. 12 A.M.

1
: # of part time consultants working shift 8 A.M. 12 P.M.

2
: # of part time consultants working shift 12P.M. 4 P.M.

3
: # of part time consultants working shift 4 P.M. 8 P.M.

4
: # of part time consultants working shift 8 P.M. 12 A.M.
Objective:
= (40 8)

3
=1
+ (30 4 )

4
=1

Subject to:

1
+
1
4

1
+
2
+
2
8

2
+
3
+
3
10

3
+
4
6

1
2
1


1
+
2
2
2


2
+
3
2
3


3
2
4

0 = 1,2,3

0 = 1,2,3,4
(b)
Model file:
param FC; # hourly cost of full-time consultants
param PC; # hourly cost of part-time consultants
param R {i in 1..4}; # of consultants required to be on duty

var f {i in 1..3} integer; # of full-time consultants on duty
var p {i in 1..4} integer; # of part-time consultants on duty

minimize C: 8*FC*sum{i in 1..3}f[i]+4*PC*sum{i in 1..4}p[i];

subject to shift1: f[1]+p[1]>=R[1];
subject to shift2: f[1]+f[2]+p[2]>=R[2];
subject to shift3: f[2]+f[3]+p[3]>=R[3];
subject to shift4: f[3]+p[4]>=R[4];

IEE 574 Appl. Deter. Oper. Rsch Dr. Muhong Zhang
Homework 2 Solutions Dening (Polo) Peng
subject to staff1: f[1]>=2*p[1];
subject to staff2: f[1]+f[2]>=2*p[2];
subject to staff3: f[2]+f[3]>=2*p[3];
subject to staff4: f[3]>=2*p[4];

subject to nonneg1 {i in 1..3}: f[i]>=0;
subject to nonneg2 {i in 1..4}: p[i]>=0;

Data File:
param FC:=40;
param PC:=30;
param R:=1 4 2 8 3 10 4 6;

Results:
ampl: model 3-4-11.mod;
ampl: data 3-4-11.dat;
ampl: option solver cplex;
ampl: solve;
CPLEX 12.5.1.0: optimal integer solution; objective 4160
7 MIP simplex iterations
0 branch-and-bound nodes
ampl: display f;
f [*] :=
1 3
2 3
3 4
;

ampl: display p;
p [*] :=
1 1
2 2
3 3
4 2
IEE 574 Appl. Deter. Oper. Rsch Dr. Muhong Zhang
Homework 2 Solutions Dening (Polo) Peng
;

If variables are treated as continuous, the solution is:
ampl: option solver minos;
ampl: solve;
MINOS 5.51: ignoring integrality of 7 variables
MINOS 5.51: optimal solution found.
4 iterations, objective 4106.666667
ampl: display f;
f [*] :=
1 2.66667
2 2.66667
3 4
;

ampl: display p;
p [*] :=
1 1.33333
2 2.66667
3 3.33333
4 2
;
3.4-13
(b)
Variables:

= amount invested in A at beginning of year (for =1, 2,,4)


= amount invested in B at beginning of year (for =1, 2, 3)


= amount available not invested at beginning of year (for =1,2,,5)


= amount invested in C
= amount invested in D
Objective:
= 1.40
4
+ 1.70
3
+ 1.90 + 1.30 +
5

Subject to:

1
+
1
+
1
= 60000

2
+
2
+ +
2
=
1

3
+
3
+
3
=
2
+1.40
1

4
+
4
=
3
+1.40
2
+ 1.70
1

IEE 574 Appl. Deter. Oper. Rsch Dr. Muhong Zhang
Homework 2 Solutions Dening (Polo) Peng
+
5
=
4
+1.40
3
+ 1.70
2

, , ,

0

(c)
Model:
param Pa; #profit of A
param Pb; #profit of B
param Pc; #profit of C
param Pd; #profit of D
param I; #initial available balance

var A {t in 1..4}; #investment in A
var B {t in 1..3}; #investment in B
var C; #investment in C
var D; #investment in D
var R {t in 1..5};

maximize P: Pa*A[4]+Pb*B[3]+Pc*C+Pd*D;

subject to balance1: A[1]+B[1]+R[1]=I;
subject to balance2: A[2]+B[2]+C+R[2]=R[1];
subject to balance3: A[3]+B[3]+R[3]=R[2]+Pa*A[1];
subject to balance4: A[4]+R[4]=R[3]+Pa*A[2]+Pb*B[1];
subject to balance5: D+R[5]=R[4]+1.4*A[3]+1.7*B[2];

subject to nonneg1 {t in 1..4}: A[t]>=0;
subject to nonneg2 {t in 1..3}: B[t]>=0;
subject to nonneg3 {t in 1..5}: R[t]>=0;
subject to nonneg4: C>=0;
subject to nonneg5: D>=0;

Data:
param Pa:=1.4;
param Pb:=1.7;
param Pc:=1.9;
IEE 574 Appl. Deter. Oper. Rsch Dr. Muhong Zhang
Homework 2 Solutions Dening (Polo) Peng
param Pd:=1.3;
param I:=60000;
Solution:
ampl: model 3-4-13.mod;
ampl: data 3-4-13.dat;
ampl: solve;
MINOS 5.51: optimal solution found.
2 iterations, objective 152880
ampl: display A;
A [*] :=
1 60000
2 0
3 84000
4 0
;

ampl: display B;
B [*] :=
1 0
2 0
3 0
;

ampl: display C;
C = 0

ampl: display D;
D = 117600




IEE 574 Appl. Deter. Oper. Rsch Dr. Muhong Zhang
Homework 2 Solutions Dening (Polo) Peng
3.4-16
(a)
Index operators K.C., D.H., H.B., S.C., K.S. and N.K. as operator 1, 2, 3, 4, 5, 6 respectively
Index days from Monday to Friday as day 1, 2, 3, 4, 5 respectively
Index hours from 8 A.M. to 10 P.M. as hour 1, 2, 3, , 14 respectively
Parameters:

: available hours of operator on day


: wage rate of operator


Decision Variables:

: binary variable indicating whether operator is assigned to work at hour on day


Objective:
: = (

6
=1

)
12
=1
5
=1

Subject to:

14
=1

, , Available Hours Constraint


6
=1
= 1, , Exactly One Operator on Duty in Each Hour

14
=1
5
=1
8, 4 Undergraduate Operator Min-hours Constraint

14
=1
5
=1
7, 4 < 6 Graduate Operator Min-hours Constraint

(0, 1)
(b)
Model:
param a {i in 1..6, j in 1..5}; #available hours of each operator in each day
param c {i in 1..6}; #hourly rate of each operator
param Mu; #min hour requirement for undergrads
param Mg; #min hour requirement for grads
param cov; #number of consultants needed every hour

var x {i in 1..6, j in 1..5, k in 1..14} binary; #schedule

minimize C: sum{i in 1..6}(c[i]*sum{j in 1..5, k in 1..14}x[i,j,k]);

subject to avahour {i in 1..6, j in 1..5}: sum{k in 1..14}x[i,j,k]<=a[i,j]; #availability constraints
subject to coverage {j in 1..5, k in 1..14}: sum{i in 1..6}x[i,j,k]=cov; #coverage constraints
subject to minund {i in 1..4}: sum{j in 1..5, k in 1..14}x[i,j,k]>=Mu; #min hour undergrad
constraints
IEE 574 Appl. Deter. Oper. Rsch Dr. Muhong Zhang
Homework 2 Solutions Dening (Polo) Peng
subject to mingrad {i in 5..6}: sum{j in 1..5, k in 1..14}x[i,j,k]>=Mg; #min hour grad constraints

Data:
param a: 1 2 3 4 5:=
1 6 0 6 0 6
2 0 6 0 6 0
3 4 8 4 0 4
4 5 5 5 0 5
5 3 0 3 8 0
6 0 0 0 6 2;
param c:=1 25 2 26 3 24 4 23 5 28 6 30;
param Mu:=8;
param Mg:=7;
param cov:=1;

Solution:
ampl: model 3-4-16.mod;
ampl: data 3-4-16.dat;
ampl: solve;
CPLEX 12.5.1.0: optimal integer solution; objective 1755
157 MIP simplex iterations
0 branch-and-bound nodes
ampl: display x;

IEE 574 Appl. Deter. Oper. Rsch Dr. Muhong Zhang
Homework 2 Solutions Dening (Polo) Peng
x [*,1,*] (tr)
: 1 2 3 4 5 6 :=
1 0 0 0 0 1 0
2 1 0 0 0 0 0
3 1 0 0 0 0 0
4 0 0 0 1 0 0
5 0 0 1 0 0 0
6 0 0 1 0 0 0
7 0 0 0 1 0 0
8 0 0 0 1 0 0
9 0 0 1 0 0 0
10 1 0 0 0 0 0
11 0 0 0 1 0 0
12 0 0 0 1 0 0
13 0 0 0 0 1 0
14 0 0 1 0 0 0

[*,2,*] (tr)
: 1 2 3 4 5 6 :=
1 0 0 0 1 0 0
2 0 0 0 1 0 0
3 0 0 0 1 0 0
4 0 0 0 1 0 0
IEE 574 Appl. Deter. Oper. Rsch Dr. Muhong Zhang
Homework 2 Solutions Dening (Polo) Peng
5 0 0 0 1 0 0
6 0 0 1 0 0 0
7 0 0 1 0 0 0
8 0 0 1 0 0 0
9 0 0 1 0 0 0
10 0 0 1 0 0 0
11 0 1 0 0 0 0
12 0 0 1 0 0 0
13 0 1 0 0 0 0
14 0 0 1 0 0 0

[*,3,*] (tr)
: 1 2 3 4 5 6 :=
1 0 0 1 0 0 0
2 0 0 1 0 0 0
3 0 0 0 0 1 0
4 0 0 1 0 0 0
5 0 0 0 1 0 0
6 0 0 0 1 0 0
7 0 0 0 1 0 0
8 0 0 0 0 1 0
9 0 0 1 0 0 0
10 1 0 0 0 0 0
IEE 574 Appl. Deter. Oper. Rsch Dr. Muhong Zhang
Homework 2 Solutions Dening (Polo) Peng
11 0 0 0 1 0 0
12 0 0 0 1 0 0
13 0 0 0 0 1 0
14 1 0 0 0 0 0

[*,4,*] (tr)
: 1 2 3 4 5 6 :=
1 0 0 0 0 0 1
2 0 0 0 0 0 1
3 0 0 0 0 0 1
4 0 0 0 0 1 0
5 0 0 0 0 0 1
6 0 0 0 0 1 0
7 0 1 0 0 0 0
8 0 1 0 0 0 0
9 0 1 0 0 0 0
10 0 1 0 0 0 0
11 0 1 0 0 0 0
12 0 1 0 0 0 0
13 0 0 0 0 0 1
14 0 0 0 0 0 1

[*,5,*] (tr)
IEE 574 Appl. Deter. Oper. Rsch Dr. Muhong Zhang
Homework 2 Solutions Dening (Polo) Peng
: 1 2 3 4 5 6 :=
1 0 0 1 0 0 0
2 0 0 0 1 0 0
3 0 0 0 1 0 0
4 0 0 0 0 0 1
5 0 0 0 1 0 0
6 0 0 0 1 0 0
7 0 0 0 1 0 0
8 0 0 1 0 0 0
9 0 0 1 0 0 0
10 0 0 1 0 0 0
11 1 0 0 0 0 0
12 1 0 0 0 0 0
13 1 0 0 0 0 0
14 1 0 0 0 0 0
;











IEE 574 Appl. Deter. Oper. Rsch Dr. Muhong Zhang
Homework 2 Solutions Dening (Polo) Peng
3.6-7
(a)
Parameters:
: 1,,10 denote mills
: 1,,1000 denote customers
: 1,,5 denote type of paper
: 1,2,3 denote machines
: 1,2,3,4 denote materials

: production cost per unit made in mill using paper and machine

: transport cost per unit for paper from mill to customer

: demand of paper by customer

: number of units of material needed to produce 1 unit of paper type on machine

: units of material available in mill

: capacity units of machine that will produce 1 unit of paper type

: capacity units of machine available in mill


Decision Variables:

: amount of paper type to be made at mill on machine type

: amount of paper type to be shipped from mill to customer


Objective:



Subject to:


, Demand Constraints
(

, Raw Material Constraints


(

, Capacity Constraints




, Production-transportation Balance

0,

0 , , , Non-negativity Constraints
(b)
Number of decision variables:
(

) = 10 5 3 = 150
(

) = 10 1000 5 = 50000
Total is 50150
Number of Constraints:
Demand Constraints: 1000*5=5000
Raw Material Constraints: 10*4=40
Capacity Constraints: 10*3=30
Production-transportation Balance: 5*10=50
Non-negativity Constraints: 10*5*3+10*1000*5=50150
Total is 55270

Vous aimerez peut-être aussi