一种求解矩形块装填问题的启发式快速算法

合集下载

一种解决矩形布局问题的启发式快速算法

一种解决矩形布局问题的启发式快速算法

A s e r si g r t m o o v n Fa tH u itc Al o ih f r S l i g
Re t ng e Pa k ng Pr b e c a l c i o l m
W ANG i Sh
( col f ot r n i eig H ahn nvr t o cec n eh o g , h n 30 4 C ia Sh o f eE g er , uzo gU iesy fSi eadT cn l y Wu a 0 7 , h ) o S wa n n i n o 4 n
s swe e e u e n d v r e t a u r p e l o t m wa ey e f ci e e m x td.a e i d h to rp o os a g rh c i f d i sv r f t . e v
Ke r s p c n y wo d : a k g;se l e;h u it lo t m ;r c a g e p c i g p o lm i tpi k e rsi a g rh c i et n l a k n r b e
大规模集成电路 的布局 与布 图规划 等 , 这类 问题在
研究 时 都 可 以形 式 化 为矩 形 P ci 问 题 。矩 形 Pc— ak g n ak
i 是一个 N n g P难 问题 , 寻找 这类 问题 的快速解 法 , 具 有广泛的实 际意义 , 因此吸引 了国内外许 多学者 的研
于正 交 矩形 Pcig 题 , 有 一 般 性 和 全 局 性 , 易 ak 问 n 具 极 扩 展 为 三维 Pcig 三 维 装 箱 ) 多 个 矩 形 容 器 的 全 akn ( 和
第2卷 1

求解矩形Packing问题的基于遗传算法的启发式递归策略

求解矩形Packing问题的基于遗传算法的启发式递归策略

Vol.33,No.9ACTA AUTOMATICA SINICA September,2007 An Improved Heuristic Recursive Strategy Based on Genetic Algorithm for the Strip RectangularPacking ProblemZHANG De-Fu1CHEN Sheng-Da1LIU Yan-Juan1Abstract An improved heuristic recursive strategy combining with genetic algorithm is presented in this paper.Firstly,this method searches some rectangles,which have the same length or width,to form some layers without waste space,then it uses the heuristic recursive strategies to calculate the height of the remaining packing order and uses the evolutionary capability of genetic algorithm to reduce the height.The computational results on several classes of benchmark problems have shown that the presented algorithm can compete with known evolutionary heuristics.It performs better especially for large test problems.Key words Strip packing problems,heuristic,recursive,genetic algorithm1IntroductionMany industrial applications,which belong to cutting and packing problems,have been found.Each application incorporates different constraints and objectives.For ex-ample,in wood or glass industries,rectangular components have to be cut from large sheets of material.In warehousing contexts,goods have to be placed on shelves.In newspapers paging,articles and advertisements have to be arranged in pages.In the shipping industry,a batch of objects of var-ious sizes has to be shipped to the maximum extent in a larger container,and a bunch of opticalfibers has to be accommodated in a pipe with perimeter as small as possi-ble.In very-large scale integration(VLSI)floor planning, VLSI has to be laid out.These applications have a similar logical structure,which can be modeled by a set of pieces that must be arranged on a predefined stock sheet so that the pieces do not overlap with one another,so they can be formalized as the packing problem[1].For more extensive and detailed descriptions of packing problems,the reader can refer to[1∼3].A two-dimensional strip rectangular packing problem is considered in this paper.It has the following characteris-tics:a set of rectangular pieces and a larger rectangle with afixed width and infinite length,designated as the con-tainer.The objective is tofind a feasible layout of all the pieces in the container that minimizes the required con-tainer length and,where necessary,takes additional con-straints into account.This problem belongs to a subset of classical cutting and packing problems and has been shown to be non-deterministic polynomial(NP)hard[4,5].Opti-mal algorithms for orthogonal two-dimension cutting were proposed in[6,7].Gilmore and Gomory[8]solved prob-lem instances to optimality by linear programming tech-niques in1961.Christofides and Whitlock[9]solved the two-dimensional guillotine stock cutting problem to opti-mality by a tree-search method in1977.Cung et al.[10] developed a new version of the algorithm proposed in Hifiand Zissimopolous that used a best-first branch-and-bound approach to solve exactly some variants of two-dimensional stock-cutting problems in2000.However,these algorithms might not be practical for large problems.In order to solve large problems,some heuristic algorithms were developed. Received June20,2006;in revised form October24,2006 Supported by Academician Start-up Fund(X01109),985Informa-tion Technology Fund(0000-X07204)in Xiamen University1.Department of Computer Science,Xiamen University,Xiamen 361005,P.R.ChinaDOI:10.1360/aas-007-0911The most documented heuristics are the bottom-left(BL), bottom-left-fill(BLF)methods,and other heuristics[11∼13]. Although their computational speed is very fast,the so-lution quality is not desirable.Recently,genetic algo-rithms and its improved algorithms for the orthogonal pack-ing problem were proposed because of their powerful op-timization capability[14∼17].Kroger[14]used genetic algo-rithm for the guillotine variant of bin packing in1995. Jakobs[15]used a genetic algorithm for the packing of poly-gons using rectangular enclosures and a Bottom-left heuris-tic in1996.Liu et al.[16]further improved it.Hop-per and Turton[18]evaluated the use of the BLF heuris-tic with genetic algorithms on the nonguillotine rectangle-nesting problem in1999.In addition,an empirical in-vestigation of meta-heuristic and heuristic algorithms of the strip rectangular packing problems was given by[19]. Recently,some new models and algorithms were devel-oped by[20∼26].For example,quasi-human heuristic[20], constructive approach[21,22],a new placement heuristic[23], heuristic recursion(HR)algorithm[24],and hybrid heuristic algorithms[25,26]were developed.These heuristics are fast and effective,especially,the bestfit in[23]not only is very fast,but alsofinds better solutions than some well-known metaheuristics.In this paper,an improved heuristic recursive algorithm that combines with genetic algorithm is presented to solve the orthogonal strip rectangular packing problem.The computational results on a class of benchmark problems show that this algorithm can compete with known evolu-tionary heuristics,especially in large test problems.The rest of this paper is organized as follows.In Section 2,a clear mathematical formulation for the strip rectangu-lar packing problem is given.In Section3,the heuristic recursive algorithm is presented,and an improved heuris-tic recursive algorithm(IHR)is developed in detail.In Section4,the GA+IHR algorithm is puta-tional results are described in Section5.Conclusions are summarized in Section6.2Mathematical formulation of the problemGiven a rectangular board of given width and a set of rectangles with arbitrary sizes,the strip packing problem of rectangles is to pack each rectangle on the board so that no two rectangles overlap and the used board height is min-imized.This problem can also be stated as follows.912ACTA AUTOMATICA SINICA Vol.33Given a rectangular board with given width W,and n rectangles with length l i and width w i,1≤i≤n,let (x li,y li)denote the top-left corner coordinates of rectangle i,and(x ri,y ri)the bottom-right corner coordinates of rect-angle i.Other symbols are similar to[24].For all1≤i≤n, the coordinates of rectangles must satisfy the following con-ditions:1)(x ri−x li=l i and y li−y ri=w i)or(x ri−x li=w i and y li−y ri=l i);2)For all1≤j≤n,j=i,rectangle i and j can not overlap,namely,x ri≤x lj or x li≥x rj or y ri≥y lj or y li≤y rj;3)x L≤x li≤x R,x L≤x ri≤x R and y R≤y li≤h,y R≤y ri≤h.The problem is to pack all the rectangles on the board such that the used board height h is minimized.It is noted that for orthogonal rectangular packing prob-lems the packing process has to ensure the edges of each rectangle are parallel to the x-and y-axes,respectively, namely,all rectangles can not be packed aslant.In addi-tion,all rectangles except the rectangular board are allowed to rotate90degrees.3IHR algorithmThe HR algorithm for the strip rectangular packing prob-lem was presented in[24].It follows a divide-and-conquer approach:break the problem into several subproblems that are similar to the original problem but smaller in size,solve the subproblems recursively,and then combine these solu-tions to create a solution to the original problem.The HR algorithm is very simple and efficient,and can be stated as follows:1)Pack a rectangle into the space to be packed,and divide the unpacked space into two subspaces.2)Pack each subspace by packing it recursively.If the subspace size is small enough to only pack a rectangle,then just pack this rectangle into the subspace in a straightfor-ward manner.3)Combine the solutions to the subproblems for the so-lution of the rectangular packing problem.In order to enhance the performance of the HR algo-rithm,the author in[18]presented some heuristic strate-gies to select a rectangle to be packed,namely,the rect-angle with the maximum area is given priority to pack.In detail,unpacked rectangles should be sorted by nonincreas-ing ordering of area size.The rectangle with maximum area should be selected to packfirst if it can be packed into the unpacked subspace.In addition,the longer side of the rect-angle to be packed should be packed along the bottom side of the subspace.It is the disadvantage of the HR algorithm that may have waste space in each layer(See Fig.1).In order to overcome this disadvantage,some layers without waste space arefirst considered.Some definitions are given to clearly describe the idea of the improved algorithm.Definition1.The reference rectangle is the rectangle that is packedfirstly and can form one layer with other rectangles,and its short edge is the height of that layer.Definition2.The combination layer is the layer that has no waste space,and the rectangles packed into it have the same height as the height of the layer and are spliced together one by one along the direction of W.The sum of the edge length of the rectangles along the W direction is the combination width.From Fig.1to Fig.4,each rectangle at the top of the container is the referee rectangle.Thefirst layer in Fig.1 is not a combination layer because it has waste space.The first layer in Fig.2is a combination layer because it has no waste space and the spliced rectangles have the same width or length as the height of the layer.Although the second layer in Fig.2has no waste space,it is not a com-bination layer because the two middle rectangles are not spliced along the direction of W.By the definition of the combination layer,the combination width is W.If some combination layers are found before further computation, then they may decrease the cost of computation because the rectangles already packed into these combination lay-ers will not be considered in thefuture.From the above discussion,it is very important tofind the combination layer.Given a packing ordering,the pro-cedure offinding the combination layer is given as follows.Find thefirst unpacked and unreferenced rectangle as the reference rectangle,and put this rectangle into a two-dimensional array.Then seek downwards from the refer-ence rectangle orderly.If one canfind a rectangle whose length or width is equal to the width of the reference rect-angle,then put this rectangle into the two-dimensional ar-ray,repeat this until a combination layer or no combination layer is found.Repeat the above process until all rectan-gles are packed otherwise no rectangle can be the reference rectangle.In this process,the number of rectangles,which have been packed in the current layers,must be recorded. Finally,the number of all the combination layers must be recorded.The steps of the combination operator can be stated as follows:Combination()RepeatFind thefirst unpacked and unreferencedrectangle as the reference rectangle,and put thisrectangle into a two-dimensional array;For i=current position to nIf(the width or the length of rectangle i isequal to the width of the reference rectangle)If(combination width<W)Put the rectangle into the two-dimensionalarray;Else if(combination width=W)Pack all the rectangles of theNo.9ZHANG De-Fu et al.:An Improved Heuristic Recursive Strategy Based on Genetic Algorithm for (913)two-dimensional array on the container;Break;Record the number of all packed rectangles;Until all rectangles are packed or no rectangle is thereference rectangle;Record the number(Num)of all the combination layers;So,the IHR algorithm can be stated as follows:Step1.The combination layers are searched.Step2.Pack the remaining rectangles to the container by HR algorithm.By intuition,the more the number of the combination layers is,the faster the computational speed is.However, it is not always true that more combination layers can ob-tain a better solution.From Fig.1to Fig.4,we know that the best combination layer number is1.Fig.1has no com-bination layer,but layer1,layer3,and layer4waste a little space.Fig.2has one combination layer and is the optimal solution.Fig.3has two combination layers but layer3and layer4waste a little space.Fig.4has three combination layers,but layer4and layer5waste a little space.4GA+IHR4.1Genetic algorithm(GA)GA is a heuristic method used tofind approximate solu-tions to hard optimization problems through application of the principles of evolutionary biology to computer science. It is modeled loosely on the principles of the evolution via natural selection,which use a population of individuals that undergo selection in the presence of variation inducing op-erators such as recombination(crossover)and mutation.In order to run GA,we must be able to create an initial pop-ulation of feasible solutions.The initial population is very important for achieving a good solution.There are many ways to do this based on the form of the problems.The evolution starts from a population of completely random in-dividuals and happens in generations.In each generation, thefitness of the whole population is evaluated.Multiple individuals are stochastically selected from the current pop-ulation and are modified to form a new population,which becomes current population in the next iteration of the algorithm.Further detailed theoretical and practical de-scriptions of genetic algorithm,the interested reader can refer to[27].Combining GA with IHR,the GA+IHR algorithm to solve the strip rectangular packing problem can be stated as follows:GA+IHR()Sort all rectangles by non-increasing ordering of area size;Combination();For i=0to NumInitialization();For j=1to NumberFor k=1to N/2Select two individuals in the parentsrandomly,then crossover with probabilityP c or copy with probability(1−P c)tocreate two middle offspring;Mutate the middle offspring withprobability P m;Compare the parent and the middle offspring,if thefitness of the middle offspring is less thanthe parent s,we accept it as new offspring,otherwise we accept it with probability P b oraccept the parent with probability(1−P b);Select the best solution from the parents;Select the worse solution from the newgeneration;Replace the worse solution with the bestsolution;Save the best solution acquired from combinationlayer i to array A;Select the best solution from array A;where Num is the number of all the combination layers; Number is the iteration number of genetic algorithm;N is the number of population;P c=0.8,P m=0.2,but P m will increase as the parent chromosomes become more alike,P b=0.33.Thefitness value of genetic algorithm is calculated by HR algorithm.The required container length is the sum of combination height and currentfitness value.4.2InitializationThe GA is used to optimize the solution for unpacked rectangles.Thefitness value of GA is calculated by HR algorithm.In this paper,a string of integers,which forms an index into the set of rectangles,is used,and then the HR strategy is used to create the sequence of thefirst indi-viduals,and the sequence is divided into two equal parts, the two parts of thefirst individuals are then permuted to obtain N−1individuals(N is the size of population).The method of the permutation is to produce a point in each range randomly and exchange the position of the point for its neighbor.This initialization method can keep the diver-sification of each individual in the population.At the same time,it can keep the individual,which has betterfitness. From the experiment results,we know that the method has better effect.4.3CrossoverThe role of the crossover operator is to allow the advanta-geous traits to spread throughout the population such that the population as a whole may benefit from this chance dis-covery.The steps of the crossover operator are as follows:1)Choose two individuals Parent1and Parent2from the parents randomly.2)Get the items of individual Child1from Parent1and ly,if the sequence number of the Child1is odd,find an item orderly in Parent1until the item is different from all the items in Child1,otherwise find an item orderly in Parent2until the item is different from all the items in Child1.When the number of Child1 is n,a new individual is created successfully.3)Similarly,get the items of individual Child2from Parent2and ly,if the sequence number of the Child2is odd,find an item orderly in Par-ent2until the item is different from all the items in Child2, otherwisefind an item orderly in Parent1until the item is different from all the items in Child2.When the number of Child2is n,a new individual is created successfully.As an example of crossover,suppose two individuals are already selected:Parent1:53267841Parent2:86517324 According to the steps of the crossover operator,the sequences of the children can be obtained:Child1:58362174Child2:856312744.4MutationIn each individual A,two different points are chosen ran-domly,and the sequence within two points is inversed,then914ACTA AUTOMATICA SINICA Vol.33in the appointed iteration step,judge thefitness of the new individual B,if thefitness of B is less than that of A,B is accepted.As an example of mutation,suppose two mutation points (3and6)are already selected:A:24587136After mutation,we can get the new individualB:24178536Mutation is adaptive,that is,the mutation rate increases as the parent chromosomes become more alike.4.5ReplacementAfter the operations of crossover and mutation,a set of solutions are produced.For keeping the bestfitness and quickening the speed of convergence,a best solution is se-lected from the set of solutions,and it is saved to the next generation in each iteration step.5Computational resultsIn order to compare the relative performance of the pre-sented GA+IHR with other published heuristic and meta-heuristic algorithms,several test problems taken from the literature are used.Perhaps the most extensive instances given for this problem are found in[19],where21prob-lem instances are presented in seven different sized cate-gories ranging from16to197items.The optimal solu-tions of these21instances are all known.Table1(see next page)presents an overview of the test problem Class1from [19].As we wanted to extensively test our algorithm,other test problems were generated at random.Table2shows an overview of the test problem Class2generated randomly with known optimal solution.The problem Class2can be accessed in[23].In order to verify the performance of GA+IHR,two best meta-heuristic GA+BLF and SA+BLF[23],Bestfit[13],and HR[19]are selected.The computational results are listed in Tables3and4.20iterative times are chosen for GA and 80iterative times are chosen in the mutation operation.On this test problem Class1,as listed in Table3,Gap of GA+IHR ranges from0.83to4.44with the average Gap 2.06.The average Gaps of GA+BLF,SA+BLF,Bestfit, and HR are4.57,4,5.69,and3.97,respectively.The av-erage Gap of GA+IHR is lower than those of GA+BLF, SA+BLF,Bestfit,and HR.And as listed in Table4,the average running time of GA+IHR is also lower than those of GA+BLF and SA+BLF,but is larger than that of Best fit and HR.The packing results can be seen in Fig.5and Fig.6,where L denotes the optimal height.The heights of C11,C12,C13,and C72using GA+IHR are20,21,21,and 241,respectively.GA+IHR canfind the optimal heights for C11,C23,and C32.In order to extensively test the performance of our al-gorithm for randomly generated instances,especially for larger instances,12problem instances ranging from10to 500were generated at random.The computational results are listed in Table5.For such problem,100iterative times are chosen for the GA and10iterative times are chosen in the mutation operation.Although our algorithm can ob-tain a better solution,it needs much time,especially for large problems.So for N12,40iterative times are chosen for the GA and10iterative times are chosen in the muta-tion operation.From Table5,we observe that the running time is acceptable.What is more,the Gap is better thanothers.Fig.5Packed results of C1forGA+IHRFig.6Packed results of C72for GA+IHR6ConclusionsIn this paper,the GA+IHR algorithm for the orthogo-nal stock-cutting problem has been presented.IHR is very simple and intuitive,and can solve the orthogonal stock-cutting problem efficiently.GA is an adaptive heuristic search algorithm.It has the capability of global search within the solution space.The idea of combination layers to reduce the number of unpacked rectangles has been used. During the process of iteration search,HR is called repeat-edly to calculate the height of an individual.As we know,finding the optimal solution is more difficult for the packing problem as increasing the size of problem.But it can be overcome by using the characteristic of GA.The computa-tional results have shown that we can obtain the desirable solutions within acceptable computing time by combining GA with IHR.So GA+IHR can compete with other evolu-tion heuristic algorithms,especially for large test problems, it performs better.So GA+IHR may be of considerable practical value to the rational layout of the rectangular objects in the engineeringfields,such as the wood,glass, and paper industry,the ship building industry,and textile and leather industry.Future work is to further improve the performance of GA+IHR and minimize the influence of the parameters selection,and extend this algorithm for three-dimensional rectangular packing problems.No.9ZHANG De-Fu et al.:An Improved Heuristic Recursive Strategy Based on Genetic Algorithm for (915)Table1Test problem Class1Problem category Number of items:n Optimal height Object dimensionC1(C11,C12,C13)16(C11,C13),17(C12)2020×20C2(C21,C22,C23)25(C21,C22,C23)1515×40C3(C31,C32,C33)28(C31,C33),29(C32)3030×60C4(C41,C42,C43)49(C41,C42,C43)6060×60C5(C51,C52,C53)73(C51,C52,C53)9090×60C6(C61,C62,C63)97(C61,C62,C63)120120×80C7(C71,C72,C73)196(C71,C73),197(C72)240240×160Table2Test problem Class2Problem category Number of items:n Optimal height Object dimension N1104040×40N2205030×50N3305030×50N4408080×80N550100100×100N66010050×100N77010080×100N88080100×80N910015050×150N1020015070×150N1130015070×150N12500300100×300Table3Gaps of GA+BLF,SA+BLF,Bestfit,HR,and GA+IHR for the test problem Class1C1C2C3C4C5C6C7Average GA+BLF4753445 4.57 SA+BLF46533344Bestfit11.67 6.79.9 3.87 2.93 2.5 2.23 5.69HR8.33 4.45 6.67 2.22 1.85 2.5 1.8 3.97 GA+IHR 3.33 4.44 2.22 1.67 1.110.830.83 2.06Table4Average running time of GA+BLF,SA+BLF,and GA+HRC1C2C3C4C5C6C7Average GA+BLF 4.619.2213.8359.93165.96396.463581.97604.57 SA+BLF 3.22711.06418.4452.13530.151761.0219274.413107.2 Bestfit0.00.00.00.000.0030.0050.0070.005 HR000.030.140.69 2.2136.07 5.59 GA+IHR0.88 1.52 2.249.5630.0465.56426.0476.55Table5Gaps of GA+BLF,SA+BLF,Bestfit,HR,and GA+IHR for the test problem Class2n Optimal heightGA+BLF SA+BLF BF Heuristic GA+IHRh Time(s)h Time(s)h Time(s)h Time(s)N1104040 1.02400.2445<0.01450.68 N22050519.2528.1453<0.0154 3.32 N3305052 2.65239.552<0.0151 6.18 N440808312.6838483<0.018313.09 N55010010652.31062281050.0110333.01 N6601001032611033101030.0110250.12 N7701001066711065541070.0110457.04 N8808085114285810840.018231.36 N9100150155443115517151520.01152185.94 N102001501542×10415460661520.021511154.18 N113001501558×1041553×1041520.031513763.17 N125003003134×1053126×1043060.063045864.27 Average Gap(%)-- 3.72- 3.85- 4.35- 3.46-916ACTA AUTOMATICA SINICA Vol.33References1Lodi A,Martello S,Monaci M.Two-dimensional packing problems:a survey.European Journal of Operational Re-search,2002,141(2):241∼2522Dowsland K A,Dowsland W B.Packing problems.European Journal of Operational Research,1992,56(1):2∼143Pisinger D.Heuristics for the container loading problem.European Journal of Operational Research,2002,141(2): 382∼3924Hochbaum D S,Wolfgang M.Approximation schemes for covering and packing problems in image processing and VLSI.Journal of the Association for Computing Machinery, 1985,32(1):130∼1365Leung J Y,Tam T W,Wong C S,Young G H,Chin F Y L.Packing squares into a square.Journal of Parallel and Distributed Computing,1990,10(3):271∼2756Beasley J E.An exact two-dimensional non-guillotine cutting tree search procedure.Operations Research,1985,33(1): 49∼647Hadjiconstantinou E,Christofides N.An exact algorithm for the orthogonal2D cutting problems using guillotine cuts.European Journal of Operational Research,1995,83(1): 21∼388Gilmore P C,Gomory R E.A linear programming approach to the cutting stock problem(part I).Operational Research, 1961,9:849∼8599Christofides N,Whitlock C.An algorithm for two-dimensional cutting problems.Operational Research,1977, 25(1):30∼4410Cung V D,HifiM,Cun B C.Constrained two-dimensional cutting stock problems a best-first branch-and-bound algo-rithm.International Transactions in Operational Research, 2000,7(3):185∼21011Zhang De-Fu,Li Xin.A personified annealing algorithm for circles packing problem.Acta Automatica Sinica,2005, 31(4):590∼595(in Chinese)12Chazelle B.The bottom-left bin packing heuristic:an ef-ficient implementation.IEEE Transactions on Computers, 1983,32(8):697∼70713Berkey J,Wang P.Two-dimensionalfinite bin packing algo-rithms.Journal of the Operational Research Society,1987, 38:423∼42914Kroger B.Guillotineable bin packing:a genetic approach.European Journal of Operational Research,1995,84(3): 645∼66115Jakobs S.On genetic algorithms for the packing of polygons.European Journal of Operational Research,1996,88(1): 165∼18116Liu D,Teng H.An improved BL-algorithm for genetic al-gorithm of the orthogonal packing of rectangles.European Journal of Operational Research,1999,112(2):413∼419 17Dagli C,Poshyanonda P.New approaches to nesting rectan-gular patterns.Journal of Intelligent Manufacturing,1997, 8(3):177∼19018Hopper E,Turton B.A genetic algorithm for a2D indus-trial packing puters and Industrial Engineer-ing,1999,37(1):375∼37819Hopper E,Turton B.An empirical investigation of meta-heuristic and heuristic algorithms for a2D packing problem.European Journal of Operational Research,2001,128(1): 34∼5720Wu Y L,Huang W Q,Lau S C,Wong C K,Young G H.An effective quasi-human based heuristic for solving the rectan-gle packing problem.European Journal of Operational Re-search,2002,141(2):341∼35821HifiM,Hallah R.A best-local position procedure-based heuristic for the two-dimensional layout problem.Studia In-formatica Universalis,International Journal on Informatics–Special Issue on Cutting,Packing and Knapsacking Prob-lems,2002,2(1):33∼5622HifiM,Hallah R.A hybrid algorithm for the two-dimensional layout problem:the cases of regular and irregular shapes.International Transactions in Operational Research,2003, 10(3):195∼21623Burke E,Kendall G,Whitwell G.A new placement heuristic for the orthogonal stock-cutting problem.Operations Re-search,2004,52(4):655∼67124Zhang D F,Kang Y,Deng S.A new heuristic recursive algo-rithm for the strip rectangular packing puters &Operations Research,2006,33(8):2209∼221725Zhang D F,Deng A S,Kang Y.A hybrid heuristic algo-rithm for the rectangular packing problem.Lecture Notes in Computer Science,2005,3514:783∼79126Zhang D F,Liu Y J,Chen S D,Xie X G.A meta-heuristic algorithm for the strip rectangular packing problem.Lecture Notes in Computer Science,2005,3612:1235∼124127Davis L.Handbook of Genetic Algorithms.New York:Van Nostrand Reinhold,1991ZHANG De-Fu Associate professor atSchool of Information Science and Technol-ogy,Xiamen University.He received hisbachelor and master degrees in computa-tional mathematics from Xiangtan Univer-sity in1996and1999,respectively,and hisPh.D.degree in computer software and itstheory from Huazhong University of Sci-ence and Technology in2002.His researchinterest covers computational intelligence andfinancial data mining.Corresponding author of this paper. E-mail:dfzhangl@CHEN Sheng-Da Master student atXiamen University.He received his bach-elor degree from Jimei University in2004.His research interest is computational in-telligence.E-mail:cshengda@LIU Yan-Juan Master student in Xia-men University.She received her bache-lor degree from Shijiazhuang University ofEconomics in2004.Her research interest iscomputational intelligence.E-mail:jjj514@。

启发式算法介绍

启发式算法介绍

启发式算法介绍
启发式算法(Heuristic Algorithm)是一种基于直观或经验构造的算法,主要用于解决复杂的优化问题。

其基本思想是模拟人类或自然界中蕴含的智慧和经验来寻找问题的最优解。

相对于传统的数学方法,启发式算法更加注重在近似解空间中进行搜索,从而能够快速找到较好的结果。

启发式算法有许多类型,包括但不限于遗传算法、鱼群算法、蚁群算法、粒子群算法等。

这些算法都提供了不同的机制来解决不同的问题,并且通常具有良好的适应性和可扩展性。

启发式算法常被应用于组合优化、约束优化、排队论、路径规划、生产调度等领域,并被证明在某些情况下能够为问题提供更好的解决方案。

然而,启发式算法也存在一些局限性。

例如,它在某些特殊情况下可能会得到很坏的答案或效率极差,但造成这些特殊情况的数据组合可能永远不会在现实世界出现。

因此,在使用启发式算法时,需要综合考虑其效果和实际问题的需求,选择合适的算法。

总之,启发式算法是一种基于经验和直观的算法,通过模拟自然界或人类的智慧来寻找问题的最优解。

它能够快速地找到较好的结果,但也需要考虑其局限性和适用范围。

启发式算法详细讲解

启发式算法详细讲解

启发式算法详细讲解
启发式算法(Heuristic Algorithm)也被称为启发算法或者近似算法,是一种通过启发式搜索的方式来解决问题的算法。

启发式算法与精确算法不同,它不保证最优解,但通常能够在合理的时间内找到较好的解。

启发式算法的基本思想是根据问题的特性和经验,使用一些启发式的规则或策略来指导搜索过程,以此来引导算法在搜索空间中找到可能更接近最优解的解。

具体来说,启发式算法通常包含以下步骤:
1. 初始解生成:通过某种方法生成一个初始解,可以是随机生成、基于经验的启发式规则生成等。

2. 邻域搜索:在当前解的周围搜索邻域解,通过一系列的局部搜索操作,如交换、插入、删除等,来生成新的解。

3. 评估函数:对新生成的解进行评估,评估函数用来衡量解的好坏程度,可以是目标函数值、代价函数值、质量评估值等。

4. 更新解:根据评估函数的结果,更新当前解为评估值更好的解。

5. 终止条件:根据预设的终止条件,判断是否终止搜索过程。

终止条件可以是找到满足要求的解或达到最大迭代次数等。

启发式算法的性能依赖于初始解的生成和邻域搜索操作的设计,以及评估函数的准确性。

在实际应用中,针对不同的问题,可以使用不同的启发式算法。

常见的启发式算法有贪婪算法、模拟退火算法、遗传算法、禁忌搜索等。

需要注意的是,启发式算法不能保证找到全局最优解,但可以在合理的时间内找到接近最优解的解。

启发式算法常常应用于那些NP难问题或解空间很大的问题中,可以在较短的时间内找到近似最优解,是一种非常实用的算法设计思想。

rectpack 算法

rectpack 算法

rectpack 算法
Rectpack是一种用于解决2D背包问题(也称为垃圾箱打包问题)的启发式算法的集合。

2D背包问题是一种组合优化问题,通常用于解决在二维空间中如何有效地填充背包的问题。

在Rectpack算法中,将一组矩形打包到最少数量的箱中。

Rectpack算法的基本思想是:首先将待打包的矩形按照面积从小到大排序,然后从面积最小的矩形开始尝试将其放入当前的背包中。

如果当前的背包能够容纳这个矩形,则将其放入背包中;否则,就需要扩展背包的尺寸,直到能够容纳这个矩形为止。

Rectpack算法的优点在于它能够快速地找到一个近似最优的解,因此在很多实际应用中得到了广泛的应用。

一种求解矩形块装填问题的拟人算法

一种求解矩形块装填问题的拟人算法
关键 词 矩形块装填 与切割 , 拟人 , 占角动作
A Qus h ma u i i A g rtm rR ca ge akn rbe ai u nHers c lo i - t h f etn l P c igP o l o m
C N a - ig HUANG r Q HE Du n Bn Wer i
A src R c n l pc ig ctigpo l i otn ri di ai ,t e ut ,VeyL reS a ne rt n bt t et ge akn / ut rbe s f as l dn i rcti a a n m e e no g mb g n r ag cl Itg ai e o
Ky ̄h ew Re tn l p c i n u t rbe c ag e a kn a dc t n p o l g i g m,Qu s h ma e r t ,C me- c p i cin a i u n h u i i o r u yn a t - sc o g o
( o l eo o u e ce c ,Hu z o g Unv ri f d n ea dTe h oo y C l g f mp t r i e e C S n a h n ie s y o e e n c n lg ,Wu a 3 0 4 t S hn4 0 7 )
( 5 Id sg Ⅵ ) e in,a d S n n Oo .Fo o vn h sp o lm ,ma yag rtm ss c ssmua e n e l ,g n tcag rt , rs li t i r be g n lo ih u h a i ltd a n ai g n e ei lo ih m a d o h rh uitcag rt sh v e np o o e . I hsp p r n efce tq a i u n h u it e tn l a kn n t e e rsi lo i m h a eb e r p s d n t i a e ,a fiin u s- ma e rsi r c g ep c i h c a g ag rt r p sd a c ri o tnt o sn - e re p r n ea d wid m fh m n b i . Th lo i tie lo i m s h i p o e co dn t e -h u a d y a x ei c n s o o u o g e a en g e ag rt m h u izs l t o i o tn ta e is . .,h w os lc h et n l a e nisv lea d h W Op c co dn Ot ec me w mp ra tsr tge ,ie o t ee tt er ca eb sdo au n o t ak i a c r i t h o r g t t g o c p i lc. 2 e tn l a kn e tisa c saetse yt ep o u e lo ih ,1 n tn e f h m c iv c u yn pa e 1rc g ep c igts tn e r e tdb h r d c dag rt g a n m 6i sa c so e a he e t

求解装箱问题的启发式算法研究

求解装箱问题的启发式算法研究

personification heuristics,which is inspired by the daily
strategy
of
building wall in the 2D・packing
life.Similar
to
the personification heuristics for the

algorithm,we
based
transform
the 2D strip packing
problem into
problem.Then,for the 2D
on
knapsack
packing problem,we present
to pack
least
wasted
first strategy
等制造行业都有广泛应用。
与切割相对应的是填充(排样、布局)问题,随着超大规模集成电路的出现, 一块电路板中的元器件有成千上万个。怎么样合理地安排每个元器件在电路板上 的位置,最大化利用电路板的空间,即电路板的布局问题,成为集成电路版图设 计中的一个重要步骤。该问题也同样出现在报纸的排版中。 在数学的王国中,有一个问题一直困扰着人们,即“完美正方形”【2l的寻找。 所谓“完美正方形"是指可以用一些大小各不相同,并且边长为整数的小正方形 铺满的正方形,有趣的是,该问题也跟装箱问题有密切联系,事实上,21阶的 “完美正方形’’正是用大型电子计算机算出来的。 由此可见,装箱问题的应用非常广泛,研究该问题有着重要的实际意义。随 着应用领域的不同,装箱问题的目标和约束条件也不同,因此人们抽象出了一些 通用的数学模型并把该问题分成了很多类型来分别研究。装箱问题一般可描述如
and the newspaper

启发式算法

启发式算法
该可行解与最优解的偏离程度一般不能被预计,但在实际情况下,启发式算法通常 能够在合理时间内得到非常不错的解。
启发式算法的特点是能够在搜索过程中利用问题自身的特性信息,从而指导搜索朝 着更有希望的方向前进。
发展历程及现状
启发式算法的发展历程可以追溯到20世纪50年代,当时人 们开始尝试使用启发式方法来求解一些复杂的优化问题。
随着计算机技术的快速发展,启发式算法得到了广泛的应 用和研究,出现了许多不同类型的启发式算法,如模拟退 火算法、遗传算法、蚁群算法等。
目前,启发式算法已经成为解决复杂优化问题的重要工具 之一,在各个领域都得到了广泛的应用。
应用领域与前景
• 启发式算法的应用领域非常广泛,包括生产调度、交通运输、网络通信 、数据挖掘、生物信息学等。
01
模拟生物进化过程,通过选择、交叉、变异等操作寻找全局最
优解。
粒子群优化算法
02
模拟鸟群觅食行为,通过个体和群体的历史最优位置来更新粒
子的速度和位置。
蚁群算法
03
模拟蚂蚁觅食过程,通过信息素的积累和更新来寻找最优路径

混合启发式算法
遗传模拟退火算法
结合遗传算法和模拟退火算法的特点,既保持种群多样性又避免 陷入局部最优。
启发式算法
汇报人: 2024-02-06
目录
• 启发式算法概述 • 启发式算法分类 • 经典启发式算法介绍 • 启发式算法设计原则与技巧 • 实际应用案例分析 • 挑战、发展趋势及未来方向
01
启发式算法概述
定义与特点
启发式算法是一种基于直观或经验构造的算法,它能够在可接受的花费(指计算时 间、占用空间等)下给出待解决组合优化问题的一个可行解。
实际应用效果
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
第2 9 卷 第9 期
2 0 1 3 年9 月
科 技 通 报
B UL L E TI N 0F S CI E NC E AND T E CHN0L OGY
Vo 1 . 2 9 No . 9 S e p .2 01 3

种 求解 矩形块 装填 问题 的启发式快速算 法
陈战胜 , 钮文良 , 王 辉 , 胡 正坤
( 1 . 北京联合大学 应用科技学院 , 北京 1 0 2 2 0 0 ; 2 . 北京交通大学 计算机与信息技术学院 , 北京 1 0 0 0 4 4 )
摘 要: 在最 低水平线算法基 础上 , 结合工 匠砌墙策 略 , 引入 矩形块聚类思想 , 提 出 了一种矩形块装填 问题的改进算法 。该算法能使得矩形块装 填紧凑 , 有效提升容器的利用率和提高算 法执行 速度 。实验
仿真结果表 明 , 与B L 、 S A + B L F 及P H相 比, 本文提 出的改进算 法对于求解矩形块装填 问题十分有效。 关键词 : 矩形 装填; 最低水平线; 砌墙 策略; 聚类; B L算法
中图分 类号 : T P 3 9 1 文献标识码 : A 文章编号 : 1 0 0 1 — 7 1 1 9 ( 2 0 1 3 ) 0 9 — 0 0 6 8 — 0 4
An Fa s t He u r i s t i c Al g o r i t h m f o r Re c t a n g l e Pa c k i n g P r o b l e m
C h e t r Z h a n s h e n f ' 2 , N i u W e n L i a n g , W a n g H u i I , H u Z h e n g k u n
0 引 言
矩形 P a c k i n g 问题 在 工程 设 计领 域 应用 广
效 多项式 时间算 法 。对于这一 问题 可 分 为两 类: 随机优化算法 和确 定性构造算法 。随机优化
算 法是设计 一种表示矩形装 填结果 的布局 编码 ,
( 1 . S c h o o l o f Ap p l i e d a n d Te c h n o l o g y , Be r i n g Un i o n Un i v e r s i t y , B e i j i n g 1 0 2 2 0 0 , C h i n a ; 2 . S c h o o l o f Co mp u t e r a n d
泛, 如货 物装 载 、 板 材切 割 、 服装 剪裁 下料 、 木材 下料 、 网站 报 刊排版 、 超大 规模集 成 电路 的布局 与布 图规划 等 , 因此 , 研究矩 形 P a c k i n g 问题并 寻
I n f o r ma t i o n T e c h n o l o g y , Be i j i n g J i a o t o n g Un i v e r s i t y , B e i j i n g 1 0 0 0 4 4 , C h i n a )
Ab s t r a c t : An I mpr o v e d a l g o r i t hm i s p r o p o s e d f o r r e c t a ng l e p a c k i ng p r o bl e m, wh i c h i s b a s e d o n t he l o we s t ho r i z o nt a l a l g o r i t hm, c r a f t s ma n b r i c kl a y i n g po l i c y a nd t h e r e c t a n g u l a r b l o c k c l u s t e r i n g i d e a . Th i s a l g o r i t h m c a l l ma k e a l l t he r e c t a ng ul a r bl o c k s n e x t t o e a c h o t h e r v e r y c o mp a c t ,e f f e c t i v e l y i mp r o v e t he ut i l i z a t i o n r a t e o f c o n t a i n e r a n d s p e e d up t h e lg a o r i t h m e x e c u t i o n .Th e e x p e r i me n t l a s i mul a t i o n r e s u l t s s h o w t h a t ,c o mpa r e d wi t h BL, S A 十 BLF a nd PH,t h i s a l g o r i t h m p r o p o s e d i n t h i s p a p e r f o r s o l v i ng r e c t a n g l e p a c k i n g p r o b l e m i s v e r y e f f e c t i v e . Ke y wo r d s : r e c t a n ul g a r p a c k i n g ; l o we s t ho r i z o nt a l l i n e ; s t r i c k l a y i n g po l i c y ;c l u s t e r ; BL a l g o r i t h m
相关文档
最新文档