Upload PDF
Upload PDF
Problem# 1:
Minimize Tradeo : 1000*wt * Total_Cost + (1-wt) * Total_Cals;
A) let wt := 0.0;
B) let wt := 1.0;
In case when wt=1.0 , Tradeo = 1000 * Total_Cost which means , when wt = 1 , Solver will
minimize Total_Cost.
C)
wt cost Calories
D)
3000
Calories
2000
1000
0
15.20 15.31 15.76 15.76 17.16
Cost
ff
ff
ff
HW2 Ashutosh Gangrade 2 of 6
E) In current problem , I think this is the most e cient solution because of the way tradeo is
de ned, Either we can minimize Total Cost or Calories but we can’t minimize both.
In other words, Increasing Total cost , It trades o to lowering calories or vice versa.
Problem# 2:
A)
SaSu, SuMo, MoTu, TuWe, WeTh, ThFr, FrSa are employee schedule Plans
And Since restaurant opens 7 days a week, which means everyday employees are needed
based on the need for each speci c day.
From Problem :sched[d,p] =1 , which means employee who follows plan ‘p’ should be counted
as part of total head count of restaurant on a speci c day ‘d’.
sched is the table which relates employee schedule plan and day of work.
From table , sched[SaSu , Mon] =1, which means an employee who follows workplace SaSu
will be present in restaurant on Monday.
Also, sched[SaSu , Sat] = 0 , mean same employee mentioned above will not be available to
work on Saturday.
Suppose XSaSu, XSuMo, XMoTu, XTuWe, XWeTh, XThFr, XFrSa are number of employees
following each plan.
LHS (Left Hand Side) of the equation be , Index through each day then
Sum of employees follow Plan on that speci c day schedule should be counts as available
head count for that day and
that day’s minimum need in RHS (Right Hand Side) of the linear equation.
B)
ampl: reset;
fi
fi
ffi
ff
fi
ff
HW2 Ashutosh Gangrade 3 of 6
TuWe 5.33333
WeTh 0
ThFr 7.33333
FrSa 0
;
After running above code in AMPL, Found the output in fractions as follows :
An observation: There is no employee who follows schedule Friday to Tuesday and Sunday to
Thursday.
C)
Observation:
Without roundoff , total manpower counts coming up as : 22.3333
After applying “ceil” , total manpower counts coming up as : 25
D)
ampl: model "sched2.mod";
ampl: data "sched1.dat";
ampl: solve;
MINOS 5.51: ignoring integrality of 7 variables
MINOS 5.51: optimal solution found.
2 iterations, objective 22.33333333
ampl: option solver cplex;
ampl: solve;
CPLEX 20.1.0.0: optimal integer solution; objective 23
5 MIP simplex iterations
0 branch-and-bound nodes
ampl: display Work;
Work [*] :=
SaSu 3
SuMo 4
MoTu 2
TuWe 6
WeTh 0
ThFr 8
FrSa 0
;
Observation:
While comparing section C and section D, total number of
employees are coming up 21 and 23 respectively.
In rounding solution , it is rounding to nearest integer.
While using culex solver, solver did best judgement and came up
with optimal solution, It didn’t come out same as rounding
solution.
E)
ampl: display need, MeetNeed.body;
: need MeetNeed.body :=
Mon 16 17
Tue 11 15
Wed 17 17
Thu 13 15
Fri 15 15
Sat 19 20
Sun 14 16;
Observation:
On Monday , Tuesday , Thursday , Saturday and Sunday number of
employees working more than needed by 1 , 4 , 2 , 1 and 2
respectively.
F)
“MeetNeed constraint to be =“
Observation:
By Applying below condition:
subj to MeetNeed {d in DAYS}:
sum {p in PLANS} sched[d,p] * Work[p] = need[d];
Actual working employee came to 0 for each day of the week.
G)
Considering the PLANS , For Ex:According to PLAN “SaSu” , A
employee who follows this plan will work on Monday , Tuesday ,
Wednesday , Thursday & Friday.
Which means 1 employee is counted 5 times while considering all
the schedules.
****************
****************
H)
ampl: model "sched2.mod";
ampl: data "sched2.dat";
ampl: solve;
CPLEX 20.1.0.0: optimal integer solution; objective 21
9 MIP simplex iterations
0 branch-and-bound nodes
ampl: display sum {i in PLANS} Work[i];
sum{i in PLANS} Work[i] = 21