# Explorations in Artificial Intelligence Prof. Carla P. Gomes gomes@cs.cornell.ed

## Explorations in Artificial Intelligence Prof. Carla P. Gomes gomes@cs.cornell.ed

Obert, Richard, High School Sports Reporter has reference to this Academic Journal, PHwiki organized this Journal Explorations in Artificial Intelligence Prof. Carla P. Gomes gomes@cs.cornell.edu Module 7 Part 3 Integer Programming Divisibility Decision variables in an LP model are allowed to have any values, including noninteger values, that satisfy the functional in addition to nonnegativity constraints. i.e., activities can be run at fractional levels. What to do when divisibility assumption violated: realm of integer programming!!! Revisiting the TBA Airlines Problem An Example where Integrality Matters

This Particular University is Related to this Particular Journal

The TBA Airlines Problem TBA Airlines is a small regional company that specializes in short flights in small airplanes. The company has been doing well in addition to has decided to exp in addition to its operations. The basic issue facing management is whether to purchase more small airplanes to add some new short flights, or start moving into the national market by purchasing some large airplanes, or both. Question: How many airplanes of each type should be purchased to maximize their total net annual profit Data as long as the TBA Airlines Problem Linear Programming Formulation Let S = Number of small airplanes to purchase L = Number of large airplanes to purchase Maximize Profit = S + 5L (\$millions) subject to Capital Available: 5S + 50L 100 (\$millions) Max Small Planes: S 2 in addition to S 0, L 0.

Graphical Method as long as Linear Programming Violates Divisibility Assumption of LP Divisibility Assumption of Linear Programming: Decision variables in a linear programming model are allowed to have any values, including fractional values, that satisfy the functional in addition to nonnegativity constraints. Thus, these variables are not restricted to just integer values. Since the number of airplanes purchased by TBA must have an integer value, the divisibility assumption is violated. Integer Programming Formulation Let S = Number of small airplanes to purchase L = Number of large airplanes to purchase Maximize Profit = S + 5L (\$millions) subject to Capital Available: 5S + 50L 100 (\$millions) Max Small Planes: S 2 in addition to S 0, L 0 S, L are integers.

Graphical Method as long as Integer Programming Graphical Method as long as Integer Programming When an integer programming problem has just two decision variables, its optimal solution can be found by applying the graphical method as long as linear programming with just one change at the end. We begin as usual by graphing the feasible region as long as the LP relaxation, determining the slope of the objective function lines, in addition to moving a straight edge with this slope through this feasible region in the direction of improving values of the objective function. However, rather than stopping at the last instant the straight edge passes through this feasible region, we now stop at the last instant the straight edge passes through an integer point that lies within this feasible region. This integer point is the optimal solution. Why integer programs Advantages of restricting variables to take on integer values More realistic More flexibility Disadvantages More difficult to model Can be much more difficult to solve

Integer Programming When are non-integer solutions okay Solution is naturally divisible e.g., \$, pounds, hours Solution represents a rate e.g., units per week Solution only as long as planning purposes When is rounding okay When numbers are large e.g., rounding 114.286 to 114 is probably okay. When is rounding not okay When numbers are small e.g., rounding 2.6 to 2 or 3 may be a problem. Binary variables yes-or-no decisions Types of Integer Programming Problems Pure integer programming problems are those where all the decision variables must be integers. Mixed integer programming problems only require some of the variables (the integer variables) to have integer values so the divisibility assumption holds as long as the rest (the continuous variables). Binary variables are variables whose only possible values are 0 in addition to 1. Binary integer programming (BIP) problems are those where all the decision variables restricted to integer values are further restricted to be binary variables. Such problems can be further characterized as either pure BIP problems or mixed BIP problems, depending on whether all the decision variables or only some of them are binary variables. Examples of Applications of Binary Variables Making yes-or-no type decisions Build a factory Manufacture a product Do a project Assign a person to a task Logical constraints Alternative constraints Conditional constraints Representing non-linear functions Fixed Charge Problem If a product is produced, must incur a fixed setup cost. If a warehouse is operated, must incur a fixed cost. Piecewise linear representation Diseconomies of scale Approximation of nonlinear functions Set-covering, in addition to set partitioning Make a set of assignments that cover a set of requirements. Partition a set into subsets meeting given requirements

StockCompany Example Capital Budgeting Allocation Problem StockCompany is considering 6 investments. The cash required from each investment as well as the NPV of the investment is given next. The cash available as long as the investments is \$14,000. Stockco wants to maximize its NPV. What is the optimal strategy An investment can be selected or not. One cannot select a fraction of an investment. Data as long as the StockCompany Problem Investment budget = \$14,000 Integer Programming Formulation Max 16×1+ 22×2+ 12×3+ 8×4+ 11×5+ 19×6 5×1+ 7×2+ 4×3+ 3×4+ 4×5+ 6×6 14 xj e {0,1} as long as each j = 1 to 6 What are the decision variables Objective in addition to Constraints

Capital Budgeting Allocation Problem (one resource) Knapsack Problem Why is a problem with the characteristics of the previous problem called the Knapsack Problem It is an abstraction, considering the simple problem: A hiker trying to fill her knapsack to maximum total value. Each item she considers taking with her has a certain value in addition to a certain weight. An overall weight limitation gives the single constraint. Practical applications: Project selection in addition to capital budgeting allocation problems Storing a warehouse to maximum value given the indivisibility of goods in addition to space limitations Sub-problem of other problems e.g., generation of columns as long as a given model in the course of optimization  cutting stock problem (beyond the scope of this course) The previous constraints represent economic indivisibilities, either a project is selected, or it is not. There is no selecting of a fraction of a project. Similarly, integer variables can model logical requirements (e.g., if stock 2 is selected, then so is stock 1.) How to model logical constraints Exactly 3 stocks are selected. If stock 2 is selected, then so is stock 1. If stock 1 is selected, then stock 3 is not selected. Either stock 4 is selected or stock 5 is selected, but not both.

Formulating Constraints Exactly 3 stocks are selected x1+ x2+ x3+ x4+ x5+ x6=3 If stock 2 is selected then so is stock 1 A 2-dimensional representation Stock 2 Stock 1 The integer programming constraint: x1 x2 If stock 1 is selected then stock 3 is not selected A 2-dimensional representation Stock 3 Stock 1 The integer programming constraint: x1 + x3 1

Either stock 4 is selected or stock 5 is selected, but not both. A 2-dimensional representation stock 5 stock 4 The integer programming constraint: x4 + x5 = 1 Cali as long as nia Manufacturing Company The Cali as long as nia Manufacturing Company is a diversified company with several factories in addition to warehouses throughout Cali as long as nia, but none yet in Los Angeles or San Francisco. A basic issue is whether to build a new factory in Los Angeles or San Francisco, or perhaps even both. Management is also considering building at most one new warehouse, but will restrict the choice to a city where a new factory is being built. Question: Should the Cali as long as nia Manufacturing Company exp in addition to with factories in addition to /or warehouses in Los Angeles in addition to /or San Francisco Data as long as Cali as long as nia Manufacturing

Binary Decision Variables Algebraic Formulation Let x1 = 1 if build a factory in L.A.; 0 otherwise x2 = 1 if build a factory in S.F.; 0 otherwise x3 = 1 if build a warehouse in Los Angeles; 0 otherwise x4 = 1 if build a warehouse in San Francisco; 0 otherwise Maximize NPV = 8×1 + 5×2 + 6×3 + 4×4 (\$millions) subject to Capital Spent: 6×1 + 3×2 + 5×3 + 2×4 10 (\$millions) Max 1 Warehouse: x3 + x4 1 Warehouse only if Factory: x3 x1 x4 x2 in addition to x1, x2, x3, x4 are binary variables. Contingent decisions Mutually exclusive decisions Resource Availability Using Excel Solver to Solve Integer Programs Add the integrality constraints (or add that a variable is binary) Set the Solver Tolerance. (The tolerance is the percentage deviation from optimality allowed by solver in solving Integer Programs.) The default is 5% The default is way to high It often finds the optimum as long as small problems

It was fun to teach INFO 372! Hope you had fun too! THE END !!!

## Obert, Richard High School Sports Reporter

Obert, Richard is from United States and they belong to Arizona Republic and they are from  Phoenix, United States got related to this Particular Journal. and Obert, Richard deal with the subjects like High School Sports

## Journal Ratings by Bluefield State College

This Particular Journal got reviewed and rated by Bluefield State College and short form of this particular Institution is US and gave this Journal an Excellent Rating.