FORS 8450 • Advanced Forest Planning Lecture 2 Linear Programming FORS 4710 / 6710 Forest Planning Mathematical programming A name given to a group of techniques that take problems explicitly defined with an objective function and a set of constraints, and efficiently search through solutions to try to find the one that is optimum, with respect to the objective function. Linear programming is the most widely used mathematical programming technique for forest-level problems. Others include: Non-linear programming Monte Carlo simulation Binary search Heuristics Dynamic programming FORS 4710 / 6710 Forest Planning Linear Programming Although developed independently a few years earlier by Russian and Dutch scientists, "Linear programming" was formalized in a general form in 1947 when colleagues of George Dantzig suggested he use the term as a descriptor for the solution technique he had developed for the U.S. Air Force. The reasoning behind the choice of words was: (a) Dantzig's problem-solving methods were based on linear equations, and (b) the term "programming" was (in 1947) synonymous with "planning" in the military. Many, if not all of the U.S. National Forest plans developed from about 1970 to today have used linear programming. In addition, a number of industrial companies, state forest management organizations, and Canadian Provinces also use linear programming for the development of forest plans. Linear Programming Components A. Objective Function An objective function for a linear programming model is a linear function which helps you evaluate the quality of a solution to a problem. It is used by the model to evaluate all potential combinations of management actions. Associated with objective functions is that notion that something is either being maximized or minimized. As you begin the development of the objective function, you must first remember what you are attempting to do..... Linear Programming Components B. Accounting Rows Accounting rows are used to aggregate values that may be needed for reporting purposes, although the values accumulated through an accounting row could also be used to constrain the solution to a problem. As an example, a natural resource management organization may be developing a plan that maximizes the net present value of activities over a 20-year time horizon and subject to a variety of constraints. The management organization may also desire to understand how much habitat, or how much timber volume is produced each time period. To do so, they would need to somehow add up the habitat or volume produced in each time period. To develop an accounting row, you must understand what values you are trying to accumulate. Linear Programming Components C. Resource Constraints These are constraints that prevent the problem from using more than what might be available to the organization. For example, stand-level resource constraints might indicate that the sum of the area assigned for harvest over the time horizon should not exceed the total size of each stand. Resource constraints could also reflect limiting budgets and other items. Linear Programming Components D. Policy Constraints These are constraints that prevent the problem from scheduling activities based on landowner policies. • Constraints on harvested area • Constraints on harvested volume • Constraints on habitat development or maintenance Linear Programming We will examine LP two ways: 1. By viewing a linear problem as a graph with a set of lines representing the objective function and constraints. 2. By viewing a linear problem as a set of equations to be solved with a piece of LP software (either LINDO or SOLVER). FORS 4710 / 6710 Forest Planning Viewing a linear problem as a graph Steers and Trees from Davis et al. (2001) FORS 4710 / 6710 Forest Planning Steers and Trees Problem Problem summary Objective function: maximize Constraints: Land Budget Labor Contract Nonnegativity Scott Bauer, USDA ARS, www.forestryimages.org Image number 1320069 FORS 4710 / 6710 Forest Planning 1000 X1 + 500 X2 4 X1 + 1.5 X2 24 240 X1 + 30 X2 1200 20 X1 + 20 X2 200 X1 2 X1 0 X2 0 David J. Moorhead, The University of Georgia, www.forestryimages.org Image number 2651045 Viewing a linear problem as a graph Steers and trees problem Land constraint: 4 X1 + 1.5 X2 24 Set one of the two variables to 0, solve for the other. X2, number of tree lots 20 4 (0) + 1.5 (X2) = 24 1.5 (X2) = 24 X2 = (24 / 1.5) X2 = 16 15 10 So X2 = 16 when X1 = 0, creating a coordinate for a end point of the line of (0, 16). 5 Solving X1 when X2 = 0 yields the coordinate (6, 0). 2 4 6 8 X1, number of steers FORS 4710 / 6710 Forest Planning 10 Viewing a linear problem as a graph Steers and trees problem Feasible region The set of all points that satisfy the constraints. X2, number of tree lots 20 The area of the graph where potential solutions do not violate the constraints. 15 10 5 2 4 6 8 X1, number of steers FORS 4710 / 6710 Forest Planning 10 Viewing a linear problem as a graph Steers and trees problem Budget Constraint: 240 X1 + 30 X2 1200 Endpoints of line: X2, number of tree lots 20 When X1 = 0, XY coords are: (0, 40) 15 When X2 = 0, XY coords are: (5, 0) 10 5 2 4 6 8 X1, number of steers FORS 4710 / 6710 Forest Planning 10 Viewing a linear problem as a graph Steers and trees problem Labor Constraint: 20 X1 + 20 X2 200 Endpoints of line: X2, number of tree lots 20 When X1 = 0, XY coords are: (0, 10) 15 When X2 = 0, XY coords are: (10, 0) 10 5 2 4 6 8 X1, number of steers FORS 4710 / 6710 Forest Planning 10 Viewing a linear problem as a graph Steers and trees problem Contract Constraint: X1 2 Endpoints of line: 15 X1 2 X2, number of tree lots 20 A little different, since X1 is not in the equation. It is a vertical line at X1 = 2. 10 5 2 4 6 8 X1, number of steers FORS 4710 / 6710 Forest Planning 10 Viewing a linear problem as a graph Steers and trees problem Nonnegativity Constraint: X1 0 X2 0 X2, number of tree lots 20 The first equation is redundant we already have an equation X1 2. 15 10 5 X2 0 2 4 6 8 X1, number of steers FORS 4710 / 6710 Forest Planning 10 Viewing a linear problem as a graph Steers and trees problem X2, number of tree lots Each point within the gray box represents a feasible solution to the problem. 20 This is the solution space. 15 The question now is to determine which of the areas within the feasible region include inefficient solutions, and which represent the optimal solution. 10 5 2 4 6 8 X1, number of steers FORS 4710 / 6710 Forest Planning 10 Viewing a linear problem as a graph Steers and trees problem To find the most efficient (or optimal) solution, we must now display the objective function. X2, number of tree lots 20 (0, 18) Objective function: 1000 X1 + 500 X2 This isn't a constraint - there is no right hand side to the equation (no equality or inequality). 15 (0, 12) Various levels of X1 and X2 can be used, and it is our job to determine how many of each. 10 (0, 6) 5 (3, 0) 2 4 (9, 0) (6, 0) 6 8 X1, number of steers FORS 4710 / 6710 Forest Planning 10 Viewing a linear problem as a graph Steers and trees problem Graphically, we find the place in the feasible region of the solution space that touches the objective function value line of the highest value. X2, number of tree lots 20 15 Lines are developed by placing a proposed objective function value as the right-hand side of the objective function, for example: 10 1000 X1 + 500 X2 = 9000 5 (3, 0) 2 4 6 8 X1, number of steers FORS 4710 / 6710 Forest Planning 10 Viewing a linear problem as a graph Steers and trees problem Graphically, we find the place in the feasible region of the solution space that touches the objective function value line of the highest value. X2, number of tree lots 20 15 10 5 (3, 0) 2 4 6 8 X1, number of steers FORS 4710 / 6710 Forest Planning 10 Viewing a linear problem as a graph Steers and trees problem Graphically, we find the place in the feasible region of the solution space that touches the objective function value line of the highest value. X2, number of tree lots 20 15 10 5 (3, 0) 2 4 6 8 X1, number of steers FORS 4710 / 6710 Forest Planning 10 Viewing a linear problem as a graph Steers and trees problem The optimal solution is found at the point (3.6, 6.4), which means that we should produce: X2, number of tree lots 20 3.6 steer 6.4 lots of trees 15 10 6.4 5 3.6 (3, 0) 2 4 6 8 X1, number of steers FORS 4710 / 6710 Forest Planning 10 Viewing a linear problem as a graph Steers and trees problem What does linear programming do? It defines the solution space, as we have done here graphically. X2, number of tree lots 20 Then, it identifies the corners, and searches from corner to corner for improvements in the objective function value. 15 The corner with the highest objective function value is the optimal solution. 10 5 (3, 0) 2 4 6 8 X1, number of steers FORS 4710 / 6710 Forest Planning 10 Viewing a linear problem as a graph Steers and trees problem Solution space (gray polygon) X2, number of tree lots 20 15 Optimal solution Inefficient, feasible solution 10 5 Infeasible solution 2 4 6 8 X1, number of steers FORS 4710 / 6710 Forest Planning 10 Linear Programming Output Problem summary Objective function: maximize 1000 X1 + 500 X2 Constraints: Land Budget Labor Contract Nonnegativity 4 X1 + 1.5 X2 24 240 X1 + 30 X2 1200 20 X1 + 20 X2 200 X1 2 X2 0 Linear Programming Output Problem formulation within LINDO Max 1000 X1 + 500 X2 subject to 2) 4 X1 + 1.5 X2 <= 24 3) 240 X1 + 30 X2 <= 1200 4) 20 X1 + 20 X2 <= 200 5) X1 >= 2 6) X2 >= 0 end Objective function Land constraint Budget constraint Labor constraint Contract constraint Nonneg. constraint Linear Programming Output LINDO solution values LP OPTIMUM FOUND AT STEP 3 OBJECTIVE FUNCTION VALUE 1) VARIABLE X1 X2 ROW 2) 3) 4) 5) 6) 6800.000 VALUE 3.600000 6.400000 SLACK OR SURPLUS 0.000000 144.000000 0.000000 1.600000 6.400000 REDUCED COST 0.000000 0.000000 DUAL PRICES 200.000000 0.000000 10.000000 0.000000 0.000000 Linear Programming Output LINDO solution values Reduced costs: These relate to the decision variables. If a decision variable had a value of 0 in the optimal solution, this is the amount that the value of a product (in the objective function) would have to increase before the product would appear in the optimal solution. In other words it is.... The amount (in objective function value terms, which in your lab's case is net present value) that the coefficient for each decision variable in the objective function must increase before that decision becomes competitive enough, given the other choices available, to enter the solution. Decision variables with values other than 0 have no reduced cost. Linear Programming Output LINDO solution values Slack or surplus: These relate to the constraints. They represent the amount of the right hand side value of a constraint that is not being used in the optimal solution. Example: The slack for constraint equation 3 (Budget constraint) is $144. If we check the budget constraint using the values of the optimal solution, we find that we have not used all of the budget, in fact, we have $144 left over not used (the budget was $1,200, we used $1,056). $240 per steer (3.6 steer) + $30 per lot of trees (6.4 lots) = $1,056 Linear Programming Output LINDO solution values Dual prices (shadow prices): These relate to the constraints. This is the maximum amount that the value of the objective function would change if one more unit of a constraint (the right hand side) were added or subtracted. For example, if the problem were changed to this: Max 1000 X1 + 500 X2 subject to 2) 4 X1 + 1.5 X2 <= 25 3) 240 X1 + 30 X2 <= 1200 4) 20 X1 + 20 X2 <= 200 5) X1 >= 2 6) X2 >= 0 end The objective function value should change $200 - - - if some other constraint does not, in the meantime, become binding within the new problem. Linear Programming Output LINDO solution values We find, in fact, that the objective function value increases $200... OBJECTIVE FUNCTION VALUE 1) VARIABLE X1 X2 ROW 2) 3) 4) 5) 6) 7000.000 VALUE 4.000000 6.000000 SLACK OR SURPLUS 0.000000 60.000000 0.000000 2.000000 6.000000 REDUCED COST 0.000000 0.000000 DUAL PRICES 200.000000 0.000000 10.000000 0.000000 0.000000 Linear Programming Assumptions 1. Proportionality Each variable in a linear programming problem is associated with a coefficient (e.g., revenue per unit produced, cost per mile of road built). The contribution of each product produced (or road built, etc.) to the objective function is proportional to the number of units of each product produced (or number of miles of roads of each type developed). If one unit of X1 accounts for a change in $100 in the objective function, then two units of X1 account for a change of $200 in the objective function. If one unit of X1 accounts for $100 in the objective function, and one unit of X2 accounts for $200 in the objective function, then together they account for $300 in the objective function. Linear Programming Assumptions 2. Additivity Each variable in an objective function contributes to the objective function value in a way that is independent of the other variables. For example, the value of product A ($50 of revenue per unit produced) does not increase or decrease with the number of units of products B and C that are produced. Linear Programming Assumptions 3. Certainty With this linear programming assumption, the coefficients associated with each variable are assumed to be known with certainty. This implies that there are no stochastic (random) variations in the coefficients within a linear programming model. For example, the revenue for each unit of product A is $50, not $50 some random interaction (e.g., $49.35 in some instances, $52.94 in others, and so on). In addition, when we discuss constraints to linear models, all of the right-hand side values of the equations (the goals) are known with certainty. Linear Programming Assumptions 4. Divisibility The values (solution) for each variable can take on any positive number, integer or non-integer. The value assigned to each variable in a linear programming model is assumed to be a continuous real number, thus can be assigned fractional values. For example, a solution to a maximization problem could be A = 3.24, B = 112.94, and C = 12. Each value must be zero or greater, if this is not apparent at first glance. In some real-life problems, this assumption may not be valid, and require another type of solution technique to be employed. For example, if one were attempting to maximize the number of fish structures (let's assume either logs or boulders) inserted into a stream system, then a solution of 12.56 logs and 9.23 boulders would seem unreasonable.