LINGO Part III (IE 311 – Lab) Spring ‘07. Variables Domain Function  Variables in a LINGO model default to being nonnegative and continuous.  LINGO.

Slides:



Advertisements
Similar presentations
Rostering Problem Liverpool Hope University. Covering problem Computational problem that ask whether a certain combinatorial structure covers another.
Advertisements

Operation Research By Anitha Chandran Chitra.R Radha.R Sudhit Sethi.
Operations Management Linear Programming Module B - Part 2
Deterministic methods of operations research Introduction.
IENG 431_LAB2 27/03/09 Friday.
1 Optimization – Part II More Applications of Optimization to Operations Management In this session, we continue our discussion of “Optimization” and its.
CS 206 Introduction to Computer Science II 03 / 06 / 2009 Instructor: Michael Eckmann.
CSI 101 Elements of Computing Spring 2009 Lecture #10 – Functions and Subroutines Monday, March 16th.
CS 206 Introduction to Computer Science II 10 / 17 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 10 / 20 / 2008 Instructor: Michael Eckmann.
Approximation Algorithms
1 Linear Programming Using the software that comes with the book.
LINEAR PROGRAMMING: THE GRAPHICAL METHOD

1 1 Slide © 2009 South-Western, a part of Cengage Learning Slides by John Loucks St. Edward’s University.
Adding and Subtracting Integers.
1 1 Slide LINEAR PROGRAMMING: THE GRAPHICAL METHOD n Linear Programming Problem n Properties of LPs n LP Solutions n Graphical Solution n Introduction.
1 Sections 17.1, 17.2, & 17.4 Linear and Absolute Value Inequalities.
Introduction to Mathematical Programming OR/MA 504 Chapter 5 Integer Linear Programming.
Kerimcan OzcanMNGT 379 Operations Research1 LP: Sensitivity Analysis and Interpretation of Solution Chapter 3.
A GAMS TUTORIAL. WHAT IS GAMS ? General Algebraic Modeling System Modeling linear, nonlinear and mixed integer optimization problems Useful with large,
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
Classifying optimization problems By the independent variables: –Integer optimization --- integer variables –Continuous optimization – real variables By.
Topics Covered Discrete probability distributions –The Uniform Distribution –The Binomial Distribution –The Poisson Distribution Each is appropriately.
Linear Programming: Basic Concepts
2.4 Sequences and Summations
GAMS Anwendung Nutzeroberfläche eigene Programme Modellierungs- System GAMS AMPL ILOG Studio … Solver CPLEX, CONOPT, MINOS, COIN, BARON,...
Spreadsheet Modeling & Decision Analysis:
When we add or subtract integers we can use a number line to help us see what is happening with the numbers.
Types of IP Models All-integer linear programs Mixed integer linear programs (MILP) Binary integer linear programs, mixed or all integer: some or all of.
Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-1 Integer Linear Programming Chapter 6.
THE GALAXY INDUSTRY PRODUCTION PROBLEM -
Chapter 7 Introduction to Linear Programming
Lists Computers and Programming. Agenda What is a list? How to access elements in the list? The for statement Operations on lists Looping with.
Linear Programming: Sensitivity Analysis and Interpretation of Solution Pertemuan 5 Matakuliah: K0442-Metode Kuantitatif Tahun: 2009.
Operational Research & ManagementOperations Scheduling Workforce Scheduling 1.Days-Off Scheduling 2.Shift Scheduling 3. Cyclic Staffing Problem (& extensions)
Notes 5IE 3121 Knapsack Model Intuitive idea: what is the most valuable collection of items that can be fit into a backpack?
Compound Absolute Values Equalities and Inequalities More than one absolute value in the equation.
1 The Dual in Linear Programming In LP the solution for the profit- maximizing combination of outputs automatically determines the input amounts that must.
Slide Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Adding Integers. Zero Pair = 0 Why it works… __________ Property says you can add or subtract zero without changing the value of an expression.
1-5 Adding Integers There are three parts to today's lesson: Adding positive integers Adding negative integers Adding a positive integer and a negative.
CS161 Topic #16 1 Today in CS161 Lecture #16 Prepare for the Final Reviewing all Topics this term Variables If Statements Loops (do while, while, for)
RESEARCH ASSISTANTS Mazyar Ghadirinejad & Farhood Rismanchian.
CONFIDENTIAL 1 Algebra1 Graphing and Writing Inequalities.
10.4 Adding and Subtracting Radical Expressions. Simplify radical expressions involving addition and subtraction. Objective 1 Slide
8.1 Sequences and Series Essential Questions: How do we use sequence notation to write the terms of a sequence? How do we use factorial notation? How.
USING SETS IN LINGO What Are Sets? Sets are simply groups of related objects. A set might be a list of products, trucks, or employees. Each member in the.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Slides by JOHN LOUCKS St. Edward’s University.
Common Intersection of Half-Planes in R 2 2 PROBLEM (Common Intersection of half- planes in R 2 ) Given n half-planes H 1, H 2,..., H n in R 2 compute.
Example 15: A manufacturer has 4 warehouses and 5 vendors all in different cities. In the first warehouse there are 50 products, in the second warehouse.
Chapter 3 Lect 6 Forecasting. Seasonality – Repetition at Fixed Intervals Seasonal variations –Regularly repeating movements in series values that can.
Structural Optimization
Applied Discrete Mathematics Week 2: Functions and Sequences
Using Variable Domain Functions
OPSM301 Spring 2012 Class11: LP Model Examples
Example 15: A manufacturer has 4 warehouses and 5 vendors all in different cities. In the first warehouse there are 50 products, in the second warehouse.
USING SETS IN LINGO What Are Sets?
MON TUE WED THU
Section 9.1 Sequences and Series.
Lecture 23: Workforce Scheduling 1
LINGO TUTORIAL 2.
1.6) Storing Integer:.
Sun Mon Tue Wed Thu Fri Sat
Sun Mon Tue Wed Thu Fri Sat
2016 | 10 OCT SUN MON TUE WED THU FRI SAT
Sun Mon Tue Wed Thu Fri Sat
1.6) Storing Integer: 1.7) storing fraction:
Integer Linear Programming
Presentation transcript:

LINGO Part III (IE 311 – Lab) Spring ‘07

Variables Domain Function  Variables in a LINGO model default to being nonnegative and continuous.  LINGO provides four variable domain function that allow you to override the default domain of a Restricts a variable to being an integer Makes a variable binary (i.e. 0 or Allows a variable to assume any real value, positive or Limits a variable to fall within a finite range.

@GIN  By default, LINGO assume all variables in a model are continuous. In many applications, fractional values may be undesirable. For example, you won’t be able two hire two-third of a person, or sell half an automobile.  In these instances, you will want to make use of the general integer variable

 the scalar variable X general makes the variable Produce(5) general integer makes all the variables of the START attribute general integer

@BIN  A binary variable is a special case of an integer makes the scalar variable, X, a binary makes the variable Produce(5) variable binary makes all the variables of the START attribute binary

@FREE  It removes the lower bound of zero and lets a variable take negative  makes the scalar variable, X, makes the variable Produce(5) free makes all the variables of the START attribute free

@BND  It lets you, set specific upper and lower bounds on a variable_name, upper_bound);  constrains X to lie in the interval QUANTITY(4),200) constrains QUANTITY(4) to fall within 100 to 200

@SUM  Consider the following set: SETS: VENDORS/V1,V2,V3,V4,V5/:DEMAND; ENDSETS DATA: DEMAND= ; ENDDATA  We could sum up the values of the DEMAND attribute by adding the following expression after the ENDDATA statement: TOTAL_DEMAND

 LINGO evaluates function by first initializing an internal accumulator zero.  Then, it begins looping over the members in the VENDORS set. The set index variable J, is set to the first member of VENDORS (i.e., V1) and DEMAND(V1) is then added to the accumulator …  The value of the sum is then stored into the TOTAL_DEMAND variable.  Suppose we want to sum the first three elements of DEMAND: DEMAND_3 #LE# 3: DEMAND(J));

@MIN functions are used to find the minimum and maximum of an expression over members of a set.  Again, consider the following set: SETS: VENDORS/V1,V2,V3,V4,V5/:DEMAND; ENDSETS DATA: DEMAND= ; ENDDATA

@MIN (cont).  To find the minimum and the maximum DEMAND, the following two lines are needed: MIN_DEMAND MAX_DEMAND  Suppose we had just wanted to compute the minimum and maximum values of the first three elements of DEMAND: MIN_3 |J #LE# 3 : DEMAND(J)); MAX_3 |J #LE# 3 : DEMAND(J));

Example:  Suppose you run the popular Pluto Dogs hot dog stand that is open seven days a week. You hire employees to work a five-day workweek with two consecutive days off. Each employee receives the same weekly salary. Some days of the week are busier than others and, based on past experience, you know how many workers are required on a given day of the week. In particular, your forecast calls for these staffing requirements: DayMon.Tue.Wed.Thu.Fri.Sat.Sun Staff Required

Example: (cont) You need to determine how many employees to start on each day of the week in order to minimize the total number of required employees, while still meeting or exceeding staffing requirements.

Solution:  What are the relevant sets and their attributes: We have a single primitive set, the days of the weeks We will concerned with two attributes of the DAY set:  The number of staff required on each day  The number of staff to start on each day

DATA: REQUIRED = ; ENDDATA  It’s useful to determine what attributes are data and what are decision variables. REQUIRED attribute is given to us  Data START attribute is something we need to determine  Decision Variable SETS: DAYS / MON, TUE, WED, THU, FRI, SAT, SUN / : REQUIRED, START; ENDSETS Solution (cont.) :

Solution (cont.) :  Objective: Our objective is to minimize the sum of the total number of employees we start during the week. MIN : START(I));

Solution (cont.) :  Constraint: We must have enough staff on duty each day to meet or exceed staffing requirements. Staff on duty today  Staff required today for each day of the week RHS = The quantity REQUIRED(I) LHS = No. starting today + No. starting 1 day ago + No. starting 2 days ago +No. starting 3 days ago + No. starting 4 days ago

Solution (cont.) :  It says, for each day of a week, the sum of the employees starting over the five day period beginning four days ago and ending today must be greater than or equal to the required number of staff for the day.

Solution (cont.) :  IF you try to solve our model, we get the error message:  To see why we get this error message, consider what happens on Thursday (Index 4 in our DAYS set):

Solution (cont.) : START(4-1+1) + START(4-2+1) + START(4-3+1) + START(4-4+1) + START(4-5+1) >= REQUIRED(4);  START(4) + START(3) + START(2) + START(1) + START(0) >= REQUIRED(4)  We would like to have any indices less than or equal to 0 wrap around to the end of the week. (0 would correspond to Sunday (7), -1 to Saturday (6) and so on)

Solution (cont.) :  LINGO has a function It takes two argument: INDEX LIMIT will subtract or add LIMIT to INDEX until it falls in the range 1 to LIMIT: I #LE# 5 : >= REQUIRED(J));

Solution (cont.) :