GAMS: General Algebraic Modeling System Part 4 Integer Programming - PowerPoint PPT Presentation

1 / 32
About This Presentation
Title:

GAMS: General Algebraic Modeling System Part 4 Integer Programming

Description:

Solvers: ZOOM (in GAMS student version), OSL, LAMPS, XA, CPLEX. IP Solution ... An example of modeling fixed costs and logical condition ... – PowerPoint PPT presentation

Number of Views:556
Avg rating:3.0/5.0
Slides: 33
Provided by: Jo91
Category:

less

Transcript and Presenter's Notes

Title: GAMS: General Algebraic Modeling System Part 4 Integer Programming


1
GAMS General Algebraic Modeling SystemPart
4 Integer Programming
  • Tanya Borisova and Xiaobing Zhao
  • For Graduate Seminar ARE 696 by Dr. Fletcher
  • Tatiana.Borisova_at_mail.wvu.edu
  • xbzhao_at_mail.wvu.edu

2
Outline
  • Integer Programming (IP)
  • Model Scaling
  • GAMS Seminar Evaluation

3
References
  • IP
  • McCarl, Bruce A., and Thomas H. Spreen. Applied
    Mathematical Programming Using Algebraic Systems.
  • http//agecon.tamu.edu/faculty/mccarl/regbook.htm
  • Model Scaling
  • McCarl, Bruce A. GAMS User Guide.
  • (GAMS Menu Help-McCarl Guide)

4
IP When use it?
  • discontinuous decision variables
  • machines, workers
  • fixed costs
  • investment portfolio optimization fixed costs
    if buy a stock
  • logical conditions
  • Complementary products if A is produced, then B
    must be produced
  • Mutually exclusive products if A is produced,
    than B can not be produced
  • discrete levels of resources
  • acres of crop limited by area of 1, 2, or 3 fields

5
Examples of IP Problems
  • hiker selects the most valuable items to carry,
    subject to a weight or capacity limit
  • Partial items are not allowed, thus choices are
    depicted by zero-one variables.
  • minimum cost route for a salesman visiting N
    cities then returning home
  • decision variable Xij equals one if the salesman
    goes from city i to city j, and zero otherwise.
  • machinery selection when one maximizes profits,
    trading off the annual costs of machinery
    purchase with the extra profits obtained by
    having that machinery
  • decision variables Yk are integer numbers of
    units of the k type machinery purchased

6
? General Types of Mathematical Programming
Problems

7
Classes of IP Problems
  • Linear or nonlinear
  • In the class, we focus on linear problems
  • Pure IP all variables are integers
  • Mixed IP integers and continuous variables
  • Zero-one IP integer variables are restricted to
    equal either 0 or 1
  • Pure zero-one IP problems
  • Mixed zero-one IP problems

8
IP in GAMS
  • Variable declaration
  • Binary Variables or Integer Variables
  • Solve statement (example for linear model)
  • Solve ModelName using mip minimizing
    VariableName
  • Solvers ZOOM (in GAMS student version), OSL,
    LAMPS, XA, CPLEX

9
IP Solution
  • IP problems are difficult to solve
  • there is no rule for the number of feasible
    solutions or their location
  • most IP algorithms enumerate all possible integer
    solutions requiring substantial search effort
  • duality is not well-defined
  • discontinuous feasible solution region
  • many of the shadow prices reported by GAMS are
    not relevant to the original problem, but are
    rather relevant to a problem transformed during
    the solution process

10
Linear IP Example
Linear objective function
Linear constraints
Continuous variables
X 0 and integer Y 0 or 1
Integer variables
Zero-one variables
11
Warehouse location
  • Extension of transportation problem
  • An example of modeling fixed costs and logical
    condition
  • Mutual exclusivity - only one warehouse is
    constructed
  • Construction costs are incurred only if warehouse
    is constructed

12
Warehouse location (cont.)
  • Locate warehouses within a transportation system
    to minimize total transportation costs
  • Tradeoff between fixed warehouse construction
    costs and transportation costs
  • Closely related examples location of processing
    facility, store or distribution center

13
GAMS Program
  • Open GAMS
  • Create a new project in a convenient location
    (Desktop or MyDocuments)
  • Open warehouse.gms file from the Desktop

14
Warehouse location (cont.)
  • Indexes
  • i producers
  • j markets
  • k warehouse locations
  • Data
  • Producers production capacities si
  • Demand on the markets dj
  • Warehouses storage capacities CAPk
  • Fixed costs of construction warehouses fk
  • Total number of warehouses b

15
Warehouse location (cont.)
  • Variables
  • qik shipment from producers to warehouses
  • ykj shipment from warehouses to markets
  • xij shipment directly from producers to markets
  • vk indicate if warehouse k is constructed
    (binary)

16
Warehouse Location Objective Function
  • Minimize total costs in the system, which include
  • fixed costs of facility construction
  • transportation costs from producers to warehouses
  • transportation costs from warehouses to markets
  • transportation costs directly from producers to
    markets

Producers-warehouses
Producers-markets
Fixed costs
Warehouses-markets
17
Warehouse location constraints
  • Subject to supply constraints
  • Total supply from ith producer to all warehouses
    qik and directly to all markets xij is no greater
    than the total production capacities si
  • Demand constraints
  • For jth market, total supply from all warehouses
    ykj and directly from all producers xij, is no
    less than the demand on the market dj

18
Warehouse location constraints (cont.)
  • Balance constraint 1
  • Total supply of goods from all producers to kth
    warehouse is no less than total delivery from
    this warehouse to all markets
  • Balance constraint 2
  • Total shipment of goods from kth warehouse is no
    greater than the warehouses storage capacities,
    given that warehouse is constructed

19
Warehouse location constraints (cont.)
  • Configuration constraint
  • total number of warehouses is no greater than b

20
Warehouse location Results
  • Which warehouse location is selected?
  • What are the total transportation costs?
  • Which producers ship to warehouse?

21
Fixing Improperly Working Models Scaling
  • Model solutions within GAMS - manipulation of
    large matrices and many computations
  • Poorly scaled models can cause excessive time to
    be taken in solving or can cause the solver to
    fail

22
Well-Scaled model
  • Each of the following model components are
    ranging in absolute value from 0.01 to 100
  • Optimal variable values
  • Constants in the model equations
  • Absolute values of the nonzero constraint
    marginals
  • Derivatives of nonlinear terms (Jacobian
    elements) in equations

23
Scaling
  • Scaling using aggregate units
  • (tons instead of pounds or thousand instead of
    )
  • We can scale
  • objective function
  • constraints
  • variables
  • combination of the above

24
Scaling (cont.)
  • By yourself
  • divide both sides of constraints by a scalar
  • divide an objective function by a scalar
  • change measurement units for variables and adjust
    variables coefficients
  • note changes in reduced costs and marginals
  • Using GAMS assistance
  • variablename.scale(setdependency)k1
  • equationname.scale(setdependency)k2

25
GAMS Program Example
  • Open the file scaling.gms from your desktop
  • Note three parts of the program
  • Initial problem
  • Scaling with GAMS help
  • Scaling by yourself

26
Example Initial LP Model
27
  • Step 1 constraint scaling
  • divide the 1st constraint by 10,000
  • divide the 3rd constraint by 1,000
  • divide the 4th constraint by 50
  • Result

28
  • Step 2 scale variables X1 and X4
  • X1 X1 / 10,000 -- aggregate units
  • X4 X4 50 -- smaller units
  • Coefficients in objective function and
    constraints
  • X1 coefficients 10,000 X1 coefficients
  • X4 coefficients X4 coefficients / 50

Result
29
  • Step 3 scale the objective function
  • divide the objective function by 10,000

Result
30
Program Output
  • Run the program
  • Find the outputs for the three models
  • Compare number of iterations and computer
    resource use for the models
  • Compare marginal values and reduced costs

31
GAMS Seminar Summary
  • Basics of GAMS language
  • Linear Programming (Primal and Dual)
  • Nonlinear Programming
  • Integer Programming

32
Course Evaluation
  • Operations Research (OR)
  • Scientific approach to analyzing problems and
    making decisions
  • Involves understanding and structuring of complex
    situations
  • Focus on optimization of system performance
  • Use analytical and numerical techniques to
    develop and manipulate mathematical and computer
    models of organizational systems composed of
    people, machines, and procedures.
Write a Comment
User Comments (0)
About PowerShow.com