You are on page 1of 30

Course Introduction & Intro to LP

MSCI 603 Section 1


Instructor: Mehrdad Pirnia

Course Overview
Instructor: Mehrdad Pirnia
Email: mpirnia@uwaterloo.ca
Office Hours (CPH 3671): Tuesday: 02:30-03:30 or by

appointment
Teaching Assistants:
Taghi Khaniyev
Email: thanalio@uwaterloo.ca
Office Hours (CPH 3669): Wednesday: 03:30-04:30
Mobina Masaeli
Email: mobina.masaeli@uwaterloo.ca
MSCI 603 Lecture 1: Course Introduction

Textbook
Hillier, F.S. and Lieberman, G.J. (2015). Introduction to

Operations Research, 10th edition. Connect e-book. ISBN


9781259174001
Also acceptable:
Older editions of Introduction to Operations Research by

Hillier and Lieberman


Older editions of Introduction to Mathematical Programming
by Winston and Venkataramanan

MSCI 603 Lecture 1: Course Introduction

Topics
Linear Programming
Integer Programming
Network Models

MSCI 603 Lecture 1: Course Introduction

Problem Formulation
Graphical Solution
Simplex Method
Formulations
Sensitivity Analysis
Branch-and-Bound
Duality Theory
Formulations
Transportation Simplex
Assignment Problems
Hungarian Method

Course Objectives
Formulate linear and integer programming problems.
Use popular algorithms, such as Simplex, Branch and Bound, etc. to solve optimization

problems.
Implement optimization problems in Excel or other optimization programs, such as

GAMS, AIMMS, Lindo, etc and interpret results obtained from such models.
Use sensitivity analysis techniques to provide solution to uncertain problems.
Develop awareness of the usefulness and limitations of OR models in different

applications, such as transportation, scheduling, communications, etc.

MSCI 603 Lecture 1: Course Introduction

Assessment
Assignments (5):

30%

Group Project:

20%

Proposal:
Report:

5%
15%

Tests (2):

50%

Friday, October 21 (in class)


Friday, December 2nd (in class, non-cumulative)

MSCI 603 Lecture 1: Course Introduction

Getting to Know You


Submit one paragraphs about yourself:
Professional experience
Academic background
Some highlights about your major achievemnets

Another paragraph:
Your expectation from this course

How it could be useful for your future career

MSCI 603 Lecture 1: Course Introduction

Projects
Formulate and solve a realistic problem using OR
Based on journal articles, to be discussed in a later class

Analyze the results


Provide recommendations on how to implement the solution
Work in groups of 2 students
Due Dates:
Project Proposals: Tuesday, November 4
Project Reports: Wednesday, December 2

MSCI 603 Lecture 1: Course Introduction

Late or Missed Policy


No late projects will be accepted
Missed tests will not be rescheduled

Exception: valid excuses


E.g. illness, severe family emergency, etc.
Discuss with me as soon as possible so that alternate

arrangements can be made

MSCI 603 Lecture 1: Course Introduction

Software Excel-based
Excel Solver (free)
Limited to 200 decision variables

OpenSolver (free) [opensolver.org]


Ability to solve larger models in Excel with no limitations on model

size (but limited by available memory)


SolverStudio (free) [solverstudio.org]
Ability to solve in Excel using more sophisticated programming

languages or solvers, such as AMPL, GAMS, or Gurobi


Also allows for models to be solved on NEOS servers
[http://www.neos-server.org/]
MSCI 603 Lecture 1: Course Introduction

10

Software More advanced


Gurobi [gurobi.com] or CPLEX [register for access]
A bit more involved, but better for very large problems
Free academic license (no limitations)
Can use MATLAB interface, or code in C++, Python, VB, Java

MATLAB (installed in CPH 4335)


GAMS [gams.com]
LINDO/LINGO [lindo.com]
Free student download (problem size limitations)

AIMMS
AMPLE
MSCI 603 Lecture 1: Course Introduction

11

Intro to Linear Programming

MSCI 603 Lecture 1: Course Introduction

12

What is Operations Research?


Technical definition:
Maximizing or minimizing a function by finding the best input

values subject to a set of constraints


Real life definition (from Hillier and Lieberman):
The process of allocating available resources to various

activities in a way that is most effective for the organization as


a whole

MSCI 603 Lecture 1: Course Introduction

13

History of Operations Research


Developed during WWII: research on (military) operations
Allocate scarce resources to various military operations and

activities within each operation in an effective manner


Success in WWII motivated application of OR outside of the

military in early 1950


With industrialization came more complex and specialized

problems, similar to what OR specialists faced during the war


Rapid development of techniques (simplex method) and

computers also responsible for growth of OR


MSCI 603 Lecture 1: Course Introduction

14

The Nature of Operations Research


Process

Carefully observe and formulate the problem


Gather data
Construct a mathematical model
Test whether the model represents the actual situation
Modify the model as appropriate and validate again

Broad viewpoint
Considers what is best for organization as a whole
Attempts to identify best possible course of action

Team approach
Consists of individuals with diverse backgrounds and skills
Necessary for considering ramifications of problem throughout

organization
MSCI 603 Lecture 1: Course Introduction

15

The Rise of Analytics Together with


Operations Research
Analytics (business analytics)
Introduced in 2006 by Thomas H. Davenport
Article: Competing on analytics
Books: Competing on analytics: the new science of winning
Analytics at work: smarter decisions, better results

Similar in concept to operations research


Transforms data into insight to make better decisions

Big data
Refers to the massive amounts of data available today

MSCI 603 Lecture 1: Course Introduction

16

Categories of analytics applications


Descriptive analytics
Identify interesting patterns to describe what is currently
happening, e.g., data mining
Predictive analytics
Using data to predict what will happen in the future,
e.g., statistical forecasting methods
Prescriptive analytics
Using data to prescribe what should be done in the
future
MSCI 603 Lecture 1: Course Introduction

17

Categories of analytics applications


OR focuses on predictive and prescriptive

analytics
Famous analytics applications
2012 U.S. presidential campaign
The Obama team used data to target voters and
donors
Moneyball (book and subsequent movie)
The Oakland Athletics baseball team used analytics
to identify athletes to draft
MSCI 603 Lecture 1: Course Introduction

18

Applications for OR
Finance
Portfolio Investments

Health Care
Operating Room Scheduling
Nurse Scheduling
ER Waiting Rooms

Manufacturing
Production and Inventory Planning
Job Sequencing
Reliability Planning

Transportation
Distribution
Vehicle Routing
MSCI 603 Lecture 1: Course Introduction

19

Example 1: A Linear Program


Farmer Jones must determine how many acres of corn and

wheat to plant this year. An acre of wheat yields 25 bushels


of wheat and requires 10 hours of labour per week. An acre
of corn yields 10 bushels of corn and requires 4 hours of
labour per week.
All wheat can be sold at $4 a bushel, and all corn can be
sold at $3/bushel. Seven acres of land and 40 hours per
week of labour are available.
Government regulations require that at least 30 bushels of
corn be produced during the current year.
Formulate an LP whose solution will tell Farmer Jones how
to maximize the total revenue from wheat and corn.
MSCI 603 Lecture 1: Course Introduction

20

A Complete Linear Programming Model


Let x1 be the number of acres of wheat planted
Let x2 be the number of acres of corn planted

max z 100 x1 30 x2
s.t.

x1

Decision variables

Objective Function

x2 7

10 x1 4 x2 40
10 x2 30

Constraints

x1 , x2 0
MSCI 603 Lecture 1: Course Introduction

21

Assumptions of an LP
Constraints and Objective Function exhibit:
Proportionality: exponent on each term must be 1
Additivity: Every function in a linear programming model is

the sum of the individual contributions of the activities


Divisibility:
Data is known with certainty
Costs, profits, demands, available resources, etc.

Model must be linear!


Cannot multiply or divide decision variables
MSCI 603 Lecture 1: Course Introduction

22

Problem Formulation, in general


Translate the problem statement into a mathematical model

Understand the problem and describe the overall objective


2. Define the decision variables
3. Write the objective function in terms of the decision
variables
4. Describe and write the constraints in terms of the decision
variables
1.

MSCI 603 Lecture 1: Course Introduction

23

Model Building Process


Observe the system
Find and define the problem
Translate the problem into quantitative form
Formulate a mathematical program (model) of the problem

Verify the model


Find a suitable solution for the problem
Analyze the solution results
Present your recommendations

MSCI 603 Lecture 1: Course Introduction

24

Quick Review
Equations of Lines
Matrix Algebra
Solving Systems of Equations

MSCI 603 Lecture 1: Course Introduction

25 25

Equations of Lines
Example 2: Graph the following line

4x1 + 3x2 = 24

Example 3: Determine the slope of the line in Example 1

Example 4: Graph the following region

5x1 + 9x2 45
MSCI 603 Lecture 1: Course Introduction

26

Matrix Algebra
Matrix: any rectangular array of numbers

3 2
1 5 ,

1 2 3
4 5 6 ,

3 0 7

Example 5: What are the sizes of the matrices above?

Vector:
Column vector: a matrix with only one column

Row vector: a matrix with only one row

MSCI 603 Lecture 1: Course Introduction

1
2

3 8

27

Matrix Algebra (continued)


1 2 3
A

1
1

1 2 3
B

2
1

1
C 2
1

D 4 2 1

Example 6: Compute the following


a)
b)
c)
d)
e)
f)
g)

A+B
A+C
3C
DC
CD
BC
AT

MSCI 603 Lecture 1: Course Introduction

28

Solving Systems of Equations


Example 7: Find the solution to the following equations

x1 2 x2 5
2 x1 x2 0
Example 8: Express the equations in Example 7 in

augmented matrix form and solve using the Gauss-Jordan


method (elementary row operations)

MSCI 603 Lecture 1: Course Introduction

29

Next class
More problem formulations
Solving an LP graphically
Bring a ruler!

MSCI 603 Lecture 1: Course Introduction

30

You might also like