Lab Section ♦ Excel Solver: Capacitated Plant Location Model ♦ Lingo: ♦ ♦ ♦ Lingo Model Components Transportation problem Assignment problem 1. Capacitated Plant Location Model = number of potential plant locations/capacity = number of markets or demand points = annual demand from market j = potential capacity of plant i = annualized fixed cost of keeping plant i open = = 1 if plant i is open, 0 = otherwise quantity shipped from plant i to market j cost of producing and shipping one unit from plant i to market j (cost includes production, inventory, transportation, and tariffs) subject to Network Optimization Model Capacitated Plant Location Model Capacitated Plant Location Model Capacitated Plant Location Model Excel Solver Model Excel Solver Results 2. The LINGO Computer Package ♦ LINGO is a user friendly computer package that can be used to solve linear, integer, and nonlinear, stochastic programming problems. ♦ LINGO assumes all variables are nonnegative ♦ View the LINGO Help file for syntax questions ♦ View the LINGO examples for studying different cases ♦ To solve the model, select the SOLVE command or click the red bulls eye button. ♦ Some useful settings in OPTIONS MODELING ON LINGO ♦ The first statement in a LINGO model is MODEL: END ♦ The objective function will be represented by MAX or MIN commands to solve a maximization or minimization problem. ♦ Enter the constraints by typing directly on the next line. ♦ Ending command line in LINGO is “;” mark. The “!” mark is used for comments. 10 Example 1 11 The Outputs ♦ The optimal z-value = 280 ♦ VALUE gives the value of the variable in the optimal LP solution. Thus the optimal solution calls for production of 2 desks, 0 tables, and 8 chairs. ♦ SLACK OR SURPLUS gives (by constraint row) the value of slack or excess in the optimal solution. ♦ REDUCED COST gives the coefficient in row 0 of the optimal tableau (in a max problem). The reduced cost of each basic variables must be 0. Reduced cost is the amount the objective function coefficient for variable i would have to be increased for there to be an alternative optimal solution. 12 Shadow Prices ♦ Shadow prices are shown in the Dual Prices section of LINGO output. ♦ Shadow prices are the amount the optimal z-value improves if the rhs of a constraint is increased by one unit (assuming no change in basis). ♦ ≥ constraints: nonpositive shadow prices. ♦ ≤ constraints: nonnegative shadow prices. ♦ = constraints: a positive, a negative, or 0 shadow price. ♦ For any inequality constraint, the product of the values of the constraint’s slack/excess variable and the constraint’s shadow price must equal zero. ♦ This implies that any constraint whose slack or excess variable > 0 will have a zero shadow price. ♦ Similarly, any constraint with a nonzero shadow price must be binding (have slack or excess equaling zero). ♦ For constraints with nonzero slack or excess: Type of Constraint Allowable Increase for rhs Allowable Decrease for rhs ≤ ∞ = value of slack ≥ = value of excess ∞ 2.1. LINGO Model Components Variables & parameters definition Objective function Constraints Input Data 14 2.2. Transportation Problem ♦ A transportation problem basically deals with the problem, which aims to find the best way to fulfill the demand of n demand points using the capacities of m supply points. ♦ While trying to find the best way, generally a variable cost of shipping the product from one supply point to a demand point or a similar constraint should be taken into consideration. Example 2: ABC-Delivery Company ♦ ABC-Delivery has three warehouses that supply the coffee needs of retailers (customers). ♦ The associated supply of each warehouse and demand of each customer is given in the Table 1. ♦ The cost of sending 1000 boxes of coffee from a warehouse to a customer depends on the travelling distance Ex. 2 - continued ♦ A transportation problem is specified by the supply, the demand, and the shipping costs. Relevant data can be summarized in a transportation tableau. From To C1 C2 C3 C4 Supply (1000 boxes) WH 1 $8 $6 $10 $9 35 WH 2 $9 $12 $13 $7 50 WH 3 $14 $9 $16 $5 40 Demand (1000 boxes) 45 20 30 30 Example 2: Solution ♦ Decision Variables ♦ ABC must determine how much coffee is sent from each warehouse to each customer so xij = Amount of coffee stocked at warehouse i and sent to customer j ♦ x14 = Amount of coffee stocked at warehouse 1 and sent to customer 4 ♦ Constraints ♦ ♦ ♦ A supply constraint ensures that the total quality stocked does not exceed warehouse capacity. Each warehouse is a supply point. A demand constraint ensures that a location receives its demand. Each customer/retailer is a demand point. Since a negative amount of coffee can not be shipped all xij’s must be non negative LP Formulation Min Z = 8x11+6x12+10x13+9x14+9x21+12x22+13x23+7x24+14x31+9x32+16x33+5x34 S.T.: x11+x12+x13+x14 <= 35 x21+x22+x23+x24 <= 50 x31+x32+x33+x34 <= 40 (Supply Constraints) x11+x21+x31 >= 45 (Demand Constraints) x12+x22+x32 >= 20 x13+x23+x33 >= 30 x14+x24+x34 >= 30 xij >= 0 (i= 1,2,3; j= 1,2,3,4) ♦ In general, a transportation problem is specified by the following information: ♦ ♦ ♦ A set of m supply points from which a good is shipped. Supply point i can supply at most si units. A set of n demand points to which the good is shipped. Demand point j must receive at least di units of the shipped good. Each unit produced at supply point i and shipped to demand point j incurs a variable cost of cij. ♦ xij = number of units shipped from supply point i to demand point j The Lingo Model of The Transportation Problem 22 Transportation Problem Characteristics ♦ If then total supply equals to total demand, the problem is said to be a balanced transportation problem. ♦ If total supply exceeds total demand, we can balance the problem by adding dummy demand point. Since shipments to the dummy demand point are not real, they are assigned a cost of zero. ♦ If a transportation problem has a total supply that is strictly less than total demand the problem has no feasible solution. ♦ No doubt that in such a case one or more of the demand will be left unmet. ♦ Generally in such situations a penalty cost is often associated with unmet demand and as one can guess the total penalty cost is desired to be minimum. ♦ The basic solution method for a balanced TP is the Northwest Corner Method 2.3. Assignment Problems ♦ In general an assignment problem is balanced transportation problem in which all supplies and demands are equal to 1. ♦ The assignment problem’s matrix of costs is its cost matrix. ♦ All the supplies and demands for this problem are integers which implies that the optimal solution must be integers. ♦ The Hungarian Method is usually used to solve assignment problems. Example 3: Machine Assignment Problem ♦ Machineco has four jobs to be completed. ♦ Each machine must be assigned to complete one job. ♦ The time required to setup each machine for completing each job is shown. Time (Hours) Job1 Job2 Job3 Job4 Machine 1 14 5 8 7 Machine 2 2 12 6 5 Machine 3 7 8 3 9 Machine 4 2 4 6 10 ♦ Machineco wants to minimize the total setup time needed to complete the four jobs. Solution ♦ Machineco must determine which machine should be assigned to each job. ♦ i,j=1,2,3,4 ♦ xij=1 (if machine i is assigned to meet the demands of job j) ♦ xij=0 (if machine i is not assigned to meet the demands of job j) LINGO Model 27