You are on page 1of 11

Homework 05

Question 01:

Recreate the example LINGO (LINDO syntax) LP model presented on slide number 18 of the
Lecture notes (provided in Canvas). Here are additional requirements.

(a) [25] define each variable explicitly. You may use the same definitions in the example but you
must spell out the definition of each variable.

 MWORK: Number of staff members working on Monday.

 TWORK: Number of staff members working on Tuesday.

 WWORK: Number of staff members working on Wednesday.

 THWORK: Number of staff members working on Thursday.

 FWORK: Number of staff members working on Friday.

 SWORK: Number of staff members working on Saturday.

 SUWORK: Number of staff members working on Sunday.

(b) [50] Type the linear program (LP) in Standard Form including non-negativity restrictions.

Objective Function;

Min =

300*MWORK+325*TWORK+360*WWORK+360*THWORK+360*FWORK+360*SWORK+335*SUW
ORK;

Constraints;

MWORK+THWORK+FWORK+SWORK+SUWORK>=20;

MWORK+TWORK+FWORK+SWORK+SUWORK>=13;

MWORK+TWORK+WWORK+SWORK+SUWORK>=10;
MWORK+TWORK+WWORK+THWORK+SUWORK>=12;

MWORK+TWORK+WWORK+THWORK+FWORK>=16;

TWORK+WWORK+THWORK+FWORK+SWORK>=18;

WWORK+THWORK+FWORK+SWORK+SUWORK>=20;

Non Negativity;

MWORK>=0; TWORK>=0; WWORK>=0; THWORK>=0; FWORK>=0; SWORK>=0; SUWORK>=0;

(c) [50] If the Surplus variable associated with the constraint labeled, "MON" is called "SUP_MON"
and so on for the other constraints, provide the complete AUGMENTED (LP) in Standard Form
including non-negativity restrictions.

Objective Function;

Min =

300*MWORK+325*TWORK+360*WWORK+360*THWORK+360*FWORK+360*SWORK+335*SUW
ORK;

Constraints;

MWORK+THWORK+FWORK+SWORK+SUWORK−SUP_MON=20 (MON)

MWORK+TWORK+FWORK+SWORK+SUWORK−SUP_TUE=13 (TUE)

MWORK+TWORK+WWORK+SWORK+SUWORK−SUP_WED=10 (WED)

MWORK+TWORK+WWORK+THWORK+SUWORK−SUP_THU=12 (THU)

MWORK+TWORK+WWORK+THWORK+FWORK−SUP_FRI=16 (FRI)

TWORK+WWORK+THWORK+FWORK+SWORK−SUP_SAT=18 (SAT)

WWORK+THWORK+FWORK+SWORK+SUWORK−SUP_SUN=20 (SUN)

Non Negativity;
MWORK>=0; TWORK>=0; WWORK>=0; THWORK>=0; FWORK>=0; SWORK>=0; SUWORK>=0;

SUP_MON≥0, SUP_TUE≥0, SUP_WED≥0, SUP_THU≥0, SUP_FRI≥0, SUP_SAT≥0, SUP_SUN≥0

(d) [175] Re-create the LINGO LP on slide number 18 and solve it using LINGO (LINDO subset).

In your LINDO LP you must include the following:

(A) The TITLE option must be used. On the TITLE line you must include "Your Name (Last, First), CVEG
4304 - Homework 5 - March 28, 2024 IDLAST3" IDLAST3 is ID with the last 3 digits of your student
ID attached to it (one word). BE SURE not to place! before the word "TITLE"

! Title (Sada, Compoare), CVEG 4304 - HOMEOWORK 5 - MARCH 28, 2024 868;

(B) You must precede the Objection Function (OF) with a description of the OF.

! OF;
Min =
300*MWORK+325*TWORK+360*WWORK+360*THWORK+360*FWORK+360*SWORK+335*SUW
ORK;
(C) You must precede each constraint with the description of that constraint.

! Constraints;
! Monday Staff Workers Needed;
MWORK+THWORK+FWORK+SWORK+SUWORK>=20;
! Tuesday Staff Workers Needed;
MWORK+TWORK+FWORK+SWORK+SUWORK>=13;
! Wednesday Staff Workers Needed;
MWORK+TWORK+WWORK+SWORK+SUWORK>=10;
! Thursday Staff Workers Needed;
MWORK+TWORK+WWORK+THWORK+SUWORK>=12;
! Friday Staff Workers Needed;
MWORK+TWORK+WWORK+THWORK+FWORK>=16;
! Saturday Staff Workers Needed;
TWORK+WWORK+THWORK+FWORK+SWORK>=18;
! Sunday Staff Workers Needed;
WWORK+THWORK+FWORK+SWORK+SUWORK>=20

(D) The Objection Function (OF) must have a "LABEL" in proper LINDO syntax.

! OF;
Min =
300*MWORK+325*TWORK+360*WWORK+360*THWORK+360*FWORK+360*SWORK+335*SUW
ORK;
(E) Each constraint must have a "LABEL" in proper LINDO syntax.

! Constraints;
! Monday Staff Workers Needed;
MWORK+THWORK+FWORK+SWORK+SUWORK>=20;
! Tuesday Staff Workers Needed;
MWORK+TWORK+FWORK+SWORK+SUWORK>=13;
! Wednesday Staff Workers Needed;
MWORK+TWORK+WWORK+SWORK+SUWORK>=10;
! Thursday Staff Workers Needed;
MWORK+TWORK+WWORK+THWORK+SUWORK>=12;
! Friday Staff Workers Needed;
MWORK+TWORK+WWORK+THWORK+FWORK>=16;
! Saturday Staff Workers Needed;
TWORK+WWORK+THWORK+FWORK+SWORK>=18;
! Sunday Staff Workers Needed;
WWORK+THWORK+FWORK+SWORK+SUWORK>=20

(F) Present the LINDO model on a separate page

MIN PAYROLL) 300 MWORK + 325 TWORK + 360 WWORK + 360 THWORK + 360 FWORK

+ 360 SWORK + 335 SUWORK


! This is a comment – it is not part of the Linear Program

! Comments can be used to provide additional information about a model and

! typically describe a model, the constraints and other important details

!DEFINITION OF VARIABLES

! MWORK - Staff that start work on Monday

! TWORK - Staff that start work on Tuesday

! WWORK, THWORK, …, and so on, similarly.

SUBJECT TO

MON) MWORK + THWORK + FWORK + SWORK + SUWORK >= 20 ! Monday workers/staff

TUE) MWORK + TWORK + FWORK + SWORK + SUWORK > 13

WED) MWORK + TWORK + WWORK + SWORK + SUWORK > 10

THU) MWORK + TWORK + WWORK + THWORK + SUWORK > 12

FRI) MWORK + TWORK + WWORK + THWORK + FWORK > 16

SAT) TWORK + WWORK + THWORK + FWORK + SWORK > 18

SUN) WWORK + THWORK + FWORK + SWORK + SUWORK > 20

END

(G) Combine (concatenate) the LINDO model (first) followed by the solution. Use a line to demarcate
the LP model from the LINGO solution. As such, the LP model will be immediately followed by the
LP solution.

! Title (Sada, Compoare), CVEG 4304 - HOMEOWORK 5 - MARCH 28, 2024 868;
! OF;
Min =
300*MWORK+325*TWORK+360*WWORK+360*THWORK+360*FWORK+360*SWORK+335*SUW
ORK;
! Decision Variables
MWORK = Staff that works on Monday
TWORK = Staff that works on Tuesday
WWORK = Staff that works on Wednesday
THWORK = Staff that works on Thursday
FWORK = Staff that works on Friday
SWORK = Staff that works on Saturday
SUWORK = Staff that works on Sunday ;
! Constraints;
! Constraints;
! Monday Staff Workers Needed;
MWORK+THWORK+FWORK+SWORK+SUWORK>=20;
! Tuesday Staff Workers Needed;
MWORK+TWORK+FWORK+SWORK+SUWORK>=13;
! Wednesday Staff Workers Needed;
MWORK+TWORK+WWORK+SWORK+SUWORK>=10;
! Thursday Staff Workers Needed;
MWORK+TWORK+WWORK+THWORK+SUWORK>=12;
! Friday Staff Workers Needed;
MWORK+TWORK+WWORK+THWORK+FWORK>=16;
! Saturday Staff Workers Needed;
TWORK+WWORK+THWORK+FWORK+SWORK>=18;
! Sunday Staff Workers Needed;
WWORK+THWORK+FWORK+SWORK+SUWORK>=20

! Non Negativity;
MWORK>=0; TWORK>=0; WWORK>=0; THWORK>=0; FWORK>=0; SWORK>=0; SUWORK>=0;
Optimal Solution from LINGO:
Objective value: 7750.000

Variable Value Reduced Cost


MWORK 2.000000 0.000000
TWORK 0.000000 100.0000
WWORK 2.000000 0.000000
THWORK 7.000000 0.000000
FWORK 5.000000 0.000000
SWORK 4.000000 0.000000
SUWORK 2.000000 0.000000

Row Slack or Surplus Dual Price


1 7750.000 -1.000000
2 0.000000 -100.0000
3 0.000000 0.000000
4 0.000000 -100.0000
5 1.000000 0.000000
6 0.000000 -100.0000
7 0.000000 -25.00000
8 0.000000 -135.0000
9 2.000000 0.000000
10 0.000000 0.000000
11 2.000000 0.000000
12 7.000000 0.000000
13 5.000000 0.000000
14 4.000000 0.000000
15 2.000000 0.000000
The global optimal solution found for both LINGO and LINDO is as follows:
 MWORK = 2

 TWORK = 0

 WWORK = 2

 THWORK = 7

 FWORK = 5

 SWORK = 4

 SUWORK = 2

The objective value is 7750.000.


Question 02:

A steel girder supply plant in Cypress, TX runs 24 hours a day, 7 days a week. During various times
throughout the day, different numbers of workers are needed to run the various machines in the
production system. The following table provides the people needed to safely run the plant during
the various shifts. Each worker works two consecutive 4-hour shifts.

What is the minimum number of workers needed to safely run the steel girder supply operation?
On which shifts?

The linear program (LP) to solve the human resources problem is provided with some detail - but
probably not enough. The variables have been defined in this case to assist you but you must
incorporate the definition in your LINGO (LINDO syntax) LP. Closely follow the best practices for the
LINGO model development and solution presentation AND provide the complete LINGO model and
solution. You MUST fully describe the LINGO solution (in sentences) in the context stated in the
problem description.

The minimum number of workers needed to safely run the steel girder supply operation is 35. This
is achieved with 9 workers during the 12:00 AM - 4:00 AM shift (EARAM), 6 workers during the
4:00 AM - 8:00 AM shift (MIDAM), 9 workers during the 8:00 AM - 12:00 PM shift (REGAM), 3
workers during the 12:00 PM - 4:00 PM shift (REGPM), 8 workers during the 4:00 PM - 8:00 PM
shift (DAYPM), and 0 workers during the 8:00 PM - 12:00 PM shift (LATPM).

This allocation ensures that there are enough workers to safely run the plant during each shift
while minimizing the total number of workers needed.

! Objective Function;
! No of workers required by Steel Grider on different shits/ shifts period;
Min = EARAM+MIDAM+REGAM+REGPM+DAYPM+LATPM;
!Decision Varibales
EARAM = no of workers required at EARAM during 12:00 AM - 4:00 AM
MIDAM = no of workers required by MIDAM during 4:00 AM - 8:00 AM
REGAM = no of workers required by REGAM during 8:00 AM - 12:00 PM
REGPM = No of workers required by REGPM during 12:00 PM - 4:00 PM
DAYPM = No of workers required by DAYPM during 4:00 PM - 8:00 PM
LATPM = No of workers required by LATPM during 8:00 PM - 12:00 PM;

! Constraints;
!==========Since Each worker must work 2 consecutive hours===========;
! No of workers needed by EARAM during 12:00 AM - 4:00 AM;
EARAM+LATPM>=9;
! No of workers needed by MIDAM during 4:00 AM - 8:00 AM;
MIDAM+EARAM>=10;
! No of workers needed by REGAM during 8:00 AM - 12:00 PM;
REGAM+MIDAM>=15;
! No of workers needed by REGPM during 12:00 PM - 4:00 PM;
REGPM+REGAM>=12;
! No of workers needed by DAYPM during 4:00 PM - 8:00 PM;
DAYPM+REGPM>=11;
! No of workers needed by LATPM during 8:00 PM - 12:00 PM;
LATPM+DAYPM>=8;
! Non Negativity Constraint;
EARAM>0; MIDAM>=0; REGAM>=0; REGPM>=0; DAYPM>=0; LATPM>=0;

The optimal Solution is:

Objective value: 35.00000

Variable Value Reduced Cost

EARAM 9.000000 0.000000


MIDAM 6.000000 0.000000

REGAM 9.000000 0.000000

REGPM 3.000000 0.000000

DAYPM 8.000000 0.000000

LATPM 0.000000 0.000000

Row Slack or Surplus Dual Price

1 35.00000 -1.000000

2 0.000000 -1.000000

3 5.000000 0.000000

4 0.000000 -1.000000

5 0.000000 0.000000

6 0.000000 -1.000000

7 0.000000 0.000000

8 9.000000 0.000000

9 6.000000 0.000000

10 9.000000 0.000000

11 3.000000 0.000000

12 8.000000 0.000000

13 0.000000 0.000000

You might also like