noitareneG nalP noitcudorP :tcejorP LPMA slliM eht rof PalmgrenMyrna saerdndAnulretseW YuanDi This report describes the project assignment of the course Applied Set Partitioning and Column Generation Tgh.oe toa phflre o jesticeostp arategleyn eraptreo ductipolna fntosmhr ie l oilrnsd teor meett hec ustomersd emand.W ep resentt hea lgorithmd esigno fo urc olumng enerationa pproach and numerical results. .1 Introduction The purpose of the project assignment is to get an insight into practical column generation by applying it to a real world production optimization problem in AMPL. The optimization model that is considered contains several parts, including harvesting different types of assortments in the forests, transport of the assortmentst ot hem ills,p roductionp lanninga tt hem ills,t ransporto fd ifferentt ypeso fp roductst ot he harbors and domestic customers, product shipment to the overseas ports as well as final delivery of prod- utcothtvoese rsecauss tomerToshv.ee raolblj ectmtieitovcesh eut e s tomedresm saoennvd e rparlo ducts at minimum cost. Our part of the project is production planning. In particular, each mill may use a number of different reci- wphbeaiyssc ,sh o rtmecanortnesv eritpnertdoo d purcoAtd su.c tpislotanan wt heurissbec eetchd oii sp e at each mill each day. The assignment is to implement a procedure of generating production plans to be used at the mills. Each production plan covers a period of 30 days. A mill is not allowed to shut down its production at any day of the period and we assume that it cannot use more than one recipe per day. Each recipeh asa n umbero fi nputa ssortments( differentt ypeso fw oods)a nda n umbero fp roductst hata ret o be transported or shipped to several locations. The basic strategy is to apply column generation as the solution process, where new columns associated with production plans are generated. Since column generation is based on LP, it solves the LP-relaxation of the integer problem. In an integer solution, only one production plan is to be used at each mill. There- fore we address the problem by applying an algorithm containing the following two parts. 1. In the first part, we solve the LP relaxation by a standard column generation approach. A number of production plans are normally generated for each mill and the solution is usually fractional. 2. In the second part, we attempt to obtain an integer solution by a constraint branching strategy. 1 of 18 TheC olumnG enerationA pproach .2 e hn ThoncimatuoalrropeCpnAeG 2.1 The General Framework Column generation is often applied when it is impractical to deal with all possible columns in an LP at once. In a general column generation framework, the solution process iterates between a master problem sauanb dp robleTmmh.ae s tperro brleaies smt rictveedr sitooohfnre i ginLaeIPlan. ic the ratiotnmh,ae s - ter problem is solved. The dual prices of the master problem act as input to the subproblem, which gener- ates a column with a preferable reduced cost as the output. The new column is then added to the master problem and the process proceeds until no column that might improve the objective is found, which impliesL P-optimality. Applyingt hec olumng enerationt echniquei sq uites traightforwardi no urc ases incet hep roblemm odel (the master problem) is already defined in AMPL. However, a model analysis is carried out before imple- mentationi no rdert oi dentifyw hichc onstraintsh avei mpacto nt her educedc osta ndh encet hec olumn generator. In this application, a column is associated with a production plan for a certain mill. In our project, the mills are not connected in the column generator in the sense that columns are separately gen- eratedf ort hem ills.C ombiningt hesec olumnsi no rdert om eett hec ustomersd emanda tm inimumc osti s left to the master problem. The following figure illustrates the column generation structure. DualP rices Master Problem Production Production Plan1 Plan 2 . .. Mill1 Mill2 In our implementation, the master problem is solved by CPLEX (version 5.0) to optimality in each itera- tion. 2.2 The Column Generator The purpose of the column generator is to generate one production plan with the lowest reduced cost for each mill. A production plan states which recipe is to be used each day for a time period of one month. 2 o f 1 8 AMPL Project: Production Plan Generation for the Mills TheC olumnG enerationA pproach Givena llt hec ostc omponentsa sw ella st hed ualp rices,f indingt hem ostb eneficialc olumnf ora c ertain mill corresponds to solving a shortest path problem in the following time-space network. Day1 Day 2 Day 30 Recipe 1 ... Recipe2 . . . Oner owi nt hen etworkc orrespondst oa c ertainr ecipe,w hilea c olumnr epresentsa c ertaind ay.A ne dge represetnrata sn sfirtro umn ncieanr gt arienc idpuer iondngrtae uoy n nrieanc gi tpdheaae fy t eHre.n ac e complete production plan corresponds to a path from day 1 to day 30. The column generator solves basi- cally a shortest path problem for each mill. The column corresponding to that plan is then added to the master problem. Starting at the end of day zero and a known recipe, the problem is to decide the production plan for the whole period by finding the shortest path through the network. As can be seen from the figure, the total number of nodes in the network is equal to the number of days times the number of recipes available at a mill. The cost of the shortest path is the sum of the costs of using the recipes, which are associated with the nodes in the network, and the costs on edges that represent the cost of changing from one recipe to anotheArd.d itioncaolcs ote fficientthsoa ctct isuhnure b problceomfm retod hmuep a rli ctomehfase s ter problem. In our implementation, the mathematical formulation of the subproblem for each mill is the classical shortest path formulation in the network described above. For each mill, we introduce variable x t = 1 if the production plan uses recipe at day and recipe a td ay a, nd0o therwise. r t r t – 1 r r 2 1 1 2 The -variableas reu sedt od efinef lowc onservationc onstraintsi nt hes hortestp athf ormulation.O ne x such variable is defined for each edge in the network. The cost coefficient of -variableas ret hec osto f x changing from one recipe to another together with dual prices in the master problem. Wea lsoi ntroducea notherh elpv ariable . y y t = 1 if the production plan runs recipe at day , and 0 otherwise. r t r This set of variables are defined by -variables as below. x y t = (cid:229) x t ," r ,t r r r 1 r 1 Each -variablie sa ssociatedw ithan etworkn ode.T hec ostc oefficiento f -variablaers teh ceo sotrf u n- y y ningr ecipest ogetherw ithd ualp riceso ft hem asterp roblem.N otet hatt hep resenceo f -variabldes on ot y destroy the shortest path structure since these variables are only for the sake of clarity. One may alterna- AMPL Project: Production Plan Generation for the Mills 3 of 18 Constraint Branching tivelye liminate -variables using its definition and express the subproblem purely in -variablesA. n y x advantage of explicitly using -variables is associated with constraint branching described in Section 3. y Another advantage is that the production plan solution is naturally expressed using the -variables. y The subproblem is formulated as an integer binary problem and solved by the CPLEX integer solver in every iteration. Although this is probably not the most efficient way of solving the subproblem, it is con- venient. Computational experiments show that the subproblem is solved optimality by CPLEX very rap- idly without applying any branch-and-bound procedure. Hence it is not a bottleneck part of the whole algorithm. 2.3 Column Generation Termination Ina s traightforwardi mplementationo fc olumng eneration,t hep roceduret erminatesw hent hel east reduced cost found in the subproblem is equal to 0, which indicates that there is no column that may improtovhbeej ectivvael uHeo.w evecro,m putationeaxlp erimenrtesv ettahselauar tc m hi naticorni terion is not practical for realistic size of data since column generation shows a strong tailing-off phenomenon. Hence an earlier termination is necessary. In our implementation, column generation is terminated when the objective is sufficiently close to opti- mality. In particular, note that the variable associated with a production plan never exceeds one since no more than one production plan is to be used at each mill. This fact implies that the reduced cost produced by the subproblem provides an upper bound on maximal possible improvement of the objective value. Hesnoclev stiuhnbegp roebiailtcneeh mr atpiroonlv oibwadotoe ephtursteon i dLm Pa-lo bjectviavleu e. Togetherw itht heu pperb oundo btainede acht imet hem asterp roblemi ss olved,t hep rocedurec anb et er- minated when the remaining gap between these two bounds is sufficiently small. Observe however while the upper bound obtained from the master problem is monotonously improving, the lower bound is not. Hbaetevnhsacetie rl tealushpbrosotbeotlwebwe foo nrheesee ruIetet t renne, o dd d . s detntooh tee e LP toglaepr vacanoTlcglhueeuee nm .en r aptrioocne tdeurrmbeie gabntavtewtawpahshhte ieteeeel n sna ble uppearn ldo webro undisls e soser q uatlo S. etting ie0sq u= ivalentttoe rminatincgo lumgne ner- e e LP LP ation when no column with negative reduced cost exists. .3 g ntin hicanratrsBnoC Column generation only solves the LP-relaxation of the original integer problem. The final solution is usuallyf ractional,i .e.m oret hano nep roductionp lana rep resenti nt hes olution( althought hes umo fa ll productionp lanu sagev ariablesa reo ne).T oo btainaf easiblei ntegers olutiont ot heo riginali ntegerp rob- lem,w en eedm orec omponentsi nt hea lgorithm.I no urc ase,t hisi sa chievedb yi ncorporatingah euristic that relies on so called constraint branching. Recall that during the column generation procedure, several production plans are generated for each mill. Consider a certain mill with a number of production plans 1 . Let further u = 1 if production plan i su sed,0 o therwise. i i Variable scteamhrta uote cpwashr i ond uctuLtpisPihlIoe-seanndr n .e laxation, linvaea airrsi ab le u u i i whichs atisfies . 0 ££ u 1 i 1. Since the discussion and results in this section applies to any mill, the mill index is omitted throughout the text. 4 o f 1 8 AMPL Project: Production Plan Generation for the Mills Constraint Branching We also have the following convexification constraint in the master problem. (cid:229) N u = 1 ( 1) i i = 1 In the LP-solution, it is expected, which is also confirmed by our computational experiments, that more thano ne -variable are greater than zero for each mill. One step of approaching an integer solution is to u chooseo ne -variable and force this variable to one for a mill. The variable can be chosen by inspecting u variables values in the LP-solution. Howevers,uf caih x inigm plietsh atthr ee sottfhp er oductiopnl auns agvea riableasrf eo rcetbzdoee raot the same mill, which gives a huge impact to the overall solution. Hence a bad choice of such a variable will lead to an integer solution that is far away from the integer optimum. In our algorithm, another strat- egy for approaching an integer solution is adopted. In this strategy, the fixing choice is not made upon a certainp roductionp lan,b utr atherh owa p roductionp lans houldl ookl ike.S incei ti sp erformedo na c on- straint rather than a variable in the master problem, such a strategy is usually referred to as constraint branching 1 . More specifically, we choose a certain mill, and force all production plans to run a specific recipe at a specific day. For this purpose, we introduce the following help variable to the master problem. v t = how much recipe is used at day . r t r Variable is defined as v t r v t = (cid:229) {u such that production plan i runs recipe r at day t }(2) r i i Byc onstruction,v ariable can be interpreted as the probability of using recipe o nd ay i nt hes olu- v t r t r tion. Tpoe rfocraom n strainbtr anchingt,hp er inciplitcesoh oostehm eo sptr obablceo mbinatioornfe cipaen d day for a mill. Hence we seek the -variable with the greatest value in the LP-solution and set this vari- v able to one. However, we need to avoid a variable that attains value one in the current solution, since fix- ing such a variable to one has no impact to the LP-solution. Therefore for each mill, we seek the greatest v -variable within the interval 2 (0,1), and then pick the greatest one of all mills. Assume that such a vari- able is found for recipe and day (the mill index is omitted), we then set r * t* 3 v t* = 1 r* Byr estrictings ucha -variablte oo ne,an ewL Pi sc reateda ndt hec urrentL P-solutioni sn ol ongerf easi- v ble. The algorithm then proceeds to solve the new LP by column generation, starting from all currently available columns in the master problem. The constraint branching procedure is repeated when the new LP is solved sufficiently accurately, until solving the LP yields an integer solution. Compared to fixing 1. Such a strategy is very common in the context of column generation with branch-and-bound. In our case, the whole algorithm can be embedded into a branch-and-bound framework using this strategy as the branching rule, although we simply use it to achieve an integer solution. 2. In the implementation, a tolerance parameter is introduced in order to avoid numerical difficulties. 3. Although in the actual implementation, this is done by setting the lower bound of the variable to one. AMPL Project: Production Plan Generation for the Mills 5 of 18 AlgorithmS ummary one production plan, a constraint branching has much less impact to the final solution and permits more potential plans to be generated. Observteh abstye ttinvga riable toon et,hdf eea cteof fecittsh aatl l -variabltehs adntoor tur ne cipe v t* u r* r * a td ay will attain 0 in any feasible solution. Another detail that is worth a comment is the subprob- t* lemI.tn h ceu rrenitm plementationca,o nstrainbtr anchinagl sloe adtsso e tting i1t=n h seu bproblem, y t* r* which ensures that all subsequent columns in the column generation procedure will follow the constraint branching 1 . Sinceo ne -variable is fixed to one in each constraint branching, the maximal number of constraint v branchingb eforer eachinga ni ntegers olutione qualst hen umbero fm illst imest hen umbero fd aysi na productionp lan. We further have the following result concerning constraint branching. Proposition 1 .I fa ll -variables are integer, then all -variables are integer as well; in particular, there v u will be exactly one -variable that attains one for each mill, while others are zero. u Proof .F irstn otet hatt herea ren op roductionp lanst hata rei denticali nt hem asterp roblem,s inceo ther- wisieit m plietsh atth ceo lumgne neratioanl gorithgme neratecaso lumtnh aitas l readpyr esenittn h mea s- ter problem, which contradicts LP-theory. Now assume that all -variables are integral, but there exist v moret hano ne -variable that are greater than one for a mill. Without losing generality we may assume u thatt hese -variableas re , , . . . u . Consider an arbitrary day , since there is only one -variable u u u t v 1 2 p toihinimasetpt , l itehavsala tlr iables , . .. , rtushna er m eec icbpoyem binienqgu atio(na1sn) d u u u 1 2 p (2)S.i nce airsb i trairimytp, l itehsa t , . . ., riudn e ntitcraelc ipaaedltsal ay hnsed n rceep resent u u u 1 2 p identical production plans, which is a contradiction. o Iont hewro rdsi,tf h erieas n fyr actional -variablteh, etnh erwei lballet e asotnf er actional -variablto e u v branch on. This result guarantees that the column generation combined with constraint branching will never stack before an integer solution is found. .4 Algorithm Summary We summarize the algorithm using a flow chat. Following new notations are used to describe the algo- rithm. • k : iteration counter. Value is initialized to zero and increased by one after each constraint branch- k ing. • z * : optimal objective value to the original integer problem. • z k : optimal objective value to the LP-relaxation after :th constraint branching. k L P 1. However, it is realized that an alternative to fixing a -variable in the subproblem is to take the dual prices of y equation (2) into consideration when solving the subproblem, which implies that branching is performed by pric- ing rather than fixing. In the current implementation, both mechanisms are present. 6 o f 1 8 AMPL Project: Production Plan Generation for the Mills AlgorithmS ummary • z k : the best available upper bound to . It is updated each time the master problem is solved. z k L P L P • z k : the best available lower bound to . It is obtained by solving the subproblem and storing the z k L P L P most tight lower estimation to . z * L P • z : the master problem objective value when the whole algorithm terminates. Observet hat z k for all ££, z k z k a, nd k . In practice, the value of z 0 i sn ever ££ z 0 z * z * £ z z k L P L P L P L P L P L P reached. However, the quality of the final solution can be validated since . z 0 ££ z * z L P Construct an initial set ofp roductionp lans Set k = 0 Set z k = – ¥ L P Solve the master problem, update z k and the dual prices L P Solve the subproblem. Update z k ifn ecessary L P If new columns are generated, add them to the master problem z k – z k N --------------------- L P L P £ e ? LP z k L P Y Y Solutioni ntegral? N Perform constraint branching, Set zz = k andt erminate L P set kk = + 1 AMPL Project: Production Plan Generation for the Mills 7 of 18 Numerical Results .5 st lluascei RremuN This section summarizes all the computational experiments conducted on a SUN ULTRA station with a 300 MHz CPU. All solution times mentioned are wall clock times. Most of the time are spent on solving the master problem. Due to the fact that the current AMPL version lacks the ability of starting from the last available basic solution when an LP is modified, the master problem is solved from scratch every time. The solution time can therefore be substantially reduced if a new AMPL version is available. The test data are based on a practical instance with 3 mills, where 4 to 5 different recipes are available at eachm ill,a nd3 0d aysa st het otalp lanningp eriod. In the first experiment, an attempt was made to solve the initial LP by column generation. However, due ttoht ea iling-ofpfh enomenotnh aotc cursc,o lumgne nerationne vesru cceedissno lvintghLto ePop timal- ity. The longest run lasted in more than 5 days before it is terminated by a computer system failure, and yields the following results. TABL1E. Best available bounds on the initial LP-relaxation. z 0 z 0 Gap( %) L P L P 813594.63 817852.92 0.52 Thea bover esultp rovidesa v alidb oundt ot heo ptimali ntegero bjectivev alue.H oweveri ta lsoi ndicates thats olvingt heL Pt oo ptimalityb yc olumng enerationi sn otp ractical. In the rest of the computational experiments, we terminate the column generation procedure before it reaches optimality by using different values of P. arameter are set to 5%, 3% and 2% respec- e e LP LP tively.T hes olutiont imei sa pproximatelyo neh ourf or =5a%n, idn creasetsao b outth reheo urwsh en e LP e =2%. LP The table below shows the results for different values of N. otet hatG ap1i sc omputeda s e LP ()zz – 0 ⁄z 0 bo,u nditrnhegel atievrtefroh iofenri a nlt egseorl utifortinohn met egoeprt iimsuG1 ma .p L P L P obtained if a single run is conducted using the corresponding v alue.G ap2 i sa t ightere stimationb y e LP taking the z 0 value from table 1. L P TABL2E. Computational results of different values of e . LP z 0 z Gap1( %) Gap2( %) L P e = 5% 796026.79 833041.91 4.65 2.39 LP e = 3% 804091.22 827284.94 2.88 1.68 LP e = 2% 809231.17 823728.99 1.79 1.25 LP 8 o f 1 8 AMPL Project: Production Plan Generation for the Mills Numerical Results Tchoem putationraels ulsthso Tiwannb a2lsr.eae t isfactorTygh.ee n ercaoln clusitiohsncba oytm bining teearrcmlgoiyeln nuiaemntcrn iowa onitnsti thobr nra aifanniclctgnagth odopohioifairendn bsi g gl t, eh m integer solutions with a gap less than 2%, within an amount of time that is reasonable in practice. In par- ticular,c onstraintb ranchingi ss hownt ob ea ne fficientt oolf ora pproachinga n ear-optimali ntegers olu- tion, and hence acts as a good heuristic. The following figure illustrates the solution process when = 5%. It plots the gap value e LP ()i ne veryi teration.Ad ottedl ines howst heg apt hresholdv alue ()z k E. achl ines egment – z k ⁄z k e L P L P L P LP in the figure displays a number of column generation iterations before the required accuracy is reached, ande acha steriski nt hef igurer epresentsa c onstraintb ranching. Itc anb es eenf romt hef iguret hatw hilei tt akesr elativelym anyi terationsb eforet hef irstL Pi ss olvedt o required accuracy, very few iterations are needed for rest of the LPs. Another observation is that quite a few number of constraint branching are carried out before an integer solution is found (approximately 30% of all possible fixings). The solution processs for other values demonstrate a similar behavior. Let denote the number of constraint branching perfomed before the algorithm terminates. The rela- tionb etween a nd is summarized in the table below. TABL3E. Number of constraint branching for different values of (%) 15 10 5 3 2 8 21 27 56 57 The above table shows that the algorithm performs more constraint branching when more accuracy is requircieondl ugmenn eratioTnrh.ee a stiohsmna o tpr reo ductipolna angrsee n eratbeedf ocroel ugmenn - AMPL Project: Production Plan Generation for the Mills 9 of 18 C B N L P e L P e C B L P N e C B N L P e Conclusions eration terminates at higher accuracy. Since these productions plans are all different, it is more likely that the -variables described in Section 3 attain fractional values. v .6 snoisulcnoC In the project assignment, we have successfully applied a column generation based algorithm to a real world production planning optimization problem. The assignment gives basic understandings of bring relatetdh eoriyn tpor actice.Iand ditioni,m plementintghs eo lutiopnr ocedurues inAgM PaLnC dP LEaXs optimization tools provides valuable practical skills. A number of computational experiments have been conducted, which demonstrates the efficiency of the algorithm. In particular, high quality solution are obtained with an acceptable amount of time. .7 CodesSouArpcpee ndix: 7.1 The Model File Thec ompletem odelf ilei sl istedb elow. #B yM P,A Wa ndD Y # Version 1.0 # _____________ Begin New Statements _______________ #= ====T hem asterp roblemd efinition= ==== problemm aster; # _____________ End New Statements _______________ #----------------------------------------------------------------------- #A MPLm odelf orp roductionp lanningi ntegratedw iths hips cheduling. # Version: October 15, 1999 # Updated by: Mikael R÷nnqvist and Andrew Mason #----------------------------------------------------------------------- #--------------------------------------- # Definition of sets and parameters used in the model #--------------------------------------- set MILLS; # pulp mills set PERIODS ordered; # time periods 1, 2, ..., T set ASSORTS; # assortments (ie different spicies). Used before production. set PRODS; # set of all products. Used after production. set DISTS; # forest districts set SHIPS; # set of ships set OPORTS; # set of overseas ports set PORTS := MILLS union OPORTS; # both domestic harbours and overseas ports set DDEMS; # domestic demand locations set CUSTS; # overseas customers param T integer >= 0; # Number of time periods #---------------------------- # Forest districts and inflow #---------------------------- param C_STORE_DIST {DISTS}; # Cost of storage in forest param C_FLOW_DISTMILL {DISTS, MILLS}; # Cost of inflow from forest districts to mills 10 o f 1 8 AMPL Project: Production Plan Generation for the Mills
Description: