A kind of heuristic one-dimensional stock-cutting method based on stratified random searching algorithm
Technical field
The invention belongs to Integral nonlinear program-ming field, be specifically related to a kind of heuristic one-dimensional stock-cutting method based on stratified random searching algorithm.
Technical background
In modern industry is produced, comprise the industries such as iron and steel, building materials, paper roll, film, all also exist and how to arrange single cutting stock problems, wherein One-dimensional Cutting Stock Problem is the most general problem faced in producing.So-called One-dimensional Cutting Stock Problem, when referring to that starting material and material requested dimension be all one dimension, how optimizing incision blanking under known order requirements and raw material data, starting material are fully used as far as possible, and cost obtains the planning problem of saving as far as possible.
Blanking is arranged single problem and is belonged to np problem, it has been generally acknowledged that the optimum solution not having a kind of method necessarily can find np problem.In general solve this problem and have two kinds of methods: a kind of is method based on solving Integral nonlinear program-ming, and another kind is heuritic approach.
In the method for existing solution One-dimensional Cutting Stock Problem, be such as the linear programming method of representative with column generation method, there is following problem:
(1) solution generated is not generally integer solution, must carry out rounding optimization, but the blank number easily causing again blanking to produce after rounding optimization exceedes former demand;
(2) contained by the solution generated, pattern type number is more, and making needs in actual production repeatedly to adjust cutting machine;
(3) when the blank kind of demand in order is more, the computing time of algorithm increases severely, and is difficult to adapt to actual needs.
And heuritic approach is if the intelligent algorithms such as order heuritic approach, genetic algorithm, ant group algorithm are by dynamically setting up respective rule or value assessment formula, these rules or value assessment formula mean object and the direction of last solution, can bootstrap algorithm dynamically to these objects and direction close, thus find the nearly optimum solution for this problem.
Searching keyword " baiting method ", finds following patented claim: application number is the Chinese patent application " the raw-material one-dimensional stock-cutting method of a kind of saving " of 200810227039.1; Application number is the Chinese patent application " Intelligent steel bar screening blanking optimization method " of 201110139183.1.Above patented claim is all used to the practical problems solving one-dimensional cutting-stock problem.
Application number is the Chinese patent application " Intelligent steel bar screening blanking optimization method " of 201110139183.1, traversal is taken when the combination of acquisition Steel Reinforcing Bar Material, can also be applicable to when sample blank kind is also fewer, but when sample blank kind increases, its blanking number of combinations exponentially function state rises, and obvious the method is not suitable for solving extensive cutting stock problems.And for traditional heuristic random searching algorithm, with reference to " the one dimension Optimization Cutting based on genes population " Shanghai Communications University's journal the 6th phase in 2006, when random fashion produces blanking initial solution, general all can occur that whole part on same raw material or charge length sum exceed the restriction of its length, namely be easy to the rough sledding occurring infeasible solution; When blanking dividers mould increases, because random search territory is much more much bigger than Feasible Solution Region, the blindness of traditional random search algorithm will spend a large amount of computing times by making initialization set of feasible solution, is unfavorable for being applied in actual production and goes.
One-dimensional stock-cutting method also should consider the requirement to pattern type number in application, when blanking cutting being carried out to starting material in commercial production reality, because adjustment cutting machine etc. need spend extra manpower and materials, therefore enterprise can tend to the few layout project of pattern type number.
Summary of the invention
For the deficiency in prior art, fundamental purpose of the present invention is to provide a kind of one-dimensional stock-cutting method solving extensive multi-blank kind, can automatically calculate excellent layout project in the short period of time according to the length of raw-material length and demand blank, quantity required.In order to overcome the blindness of traditional random search algorithm, present invention employs hierarchical search strategy, being guaranteed the validity of ground floor random search by the deep search of the second layer, make each pattern type obtained be all a feasible solution.And in order to meet the requirement of commercial Application to pattern type number, the present invention have employed prioritizing selection in heuristic rule can by the reusable pattern type of more times number.
For achieving the above object, the technical solution used in the present invention is as follows:
Based on a heuristic one-dimensional stock-cutting method for stratified random searching algorithm, said method comprising the steps of:
A, One-dimensional Cutting Stock Problem to be represented with parameterized model:
Raw-material length is L, and the blank of total m kind different length specification in blanking task, length is respectively l
1, l
2l
m, corresponding demand number is respectively d
1, d
2d
m; The solution of cutting stock problems is the layout project that can be repeatedly combined into by multiple pattern type, wherein pattern type is be combined into all size blank a kind of cutting mode that total length is less than starting material length L, and the clout length of often kind of pattern type is the difference that starting material length L deducts in this pattern type after blank pattern length; If total n kind pattern type in layout project, the number of times of reusing of each pattern type is respectively x
1, x
2x
n, in i-th kind of pattern type, the quantity of each blank is respectively a
il, a
i2a
im, wherein i represents i-th kind of pattern type; If Z is the total radical of starting material that blanking will use, minimum for objective function with the total radical of consumption of raw material, then the target of One-dimensional Cutting Stock Problem with constraint relation is not:
j=1,2......m
i=1,2......n
Wherein, x
iand a
ijbe integer and x
i> 0, a
ij>=0;
B, blank combination pre-service, initialization blanking task by being needed stock layout blank collection, and makes current layout project for empty;
C, obtain multiple pattern type by stratified random searching algorithm, composition pattern type sample;
D, to the often kind of pattern type obtained, be no more than according to it number of times and corresponding clout length that most multipotency of blank current demand is reused, heuristically rule optimizes the highest pattern type of evaluation of estimate;
E, pattern type the highest for evaluation of estimate is no more than with it number of times repeated combination that most multipotency of blank current demand is reused after join in current layout project; From blanking task, treat stock layout blank by described pattern type and number of times deduction again, upgrade stock layout demand of the treating number of all specification blanks, obtain new blanking task;
The process of F, repetition C, D, E, until upgrade after blanking task in treat that the total length of stock layout blank is less than starting material length L, now residue is treated that the combination of stock layout blank joins in current layout project as last a kind of pattern type, obtain a complete current layout project and record this layout project;
G, repeatedly repeat the process of B, C, D, E, F, then screening is compared, using filtered out optimum layout project as the solution of One-dimensional Cutting Stock Problem to all layout project of record.
Wherein, the blank combination pre-service described in step B is carried out in such a way:
First arranged from small to large by length by m kind blank, the corresponding length of each blank is respectively C
1, C
2c
m;
Then can repeatedly carry out selecting and combining in m kind blank, the blank set being 1 to N number be a degree of depth combination, total M of described depth groups unification, and the value of M is:
M=m
1+m
2+…+m
N,
Finally, by M combination by blank in each combination length and sequence sequence from small to large.
Wherein, the stratified random searching algorithm described in step C comprises the search of two levels, and ground floor is roulette random search, and the second layer is deep search; Transfer to when the accumulation charge length of random combine with when entering in interval [inf, sup] in ground floor search procedure and carry out second layer search; Second layer search is carried out in such a way:
From by using binary search to search a degree of depth combination length and sort from small to large M combination, the described degree of depth is combined in time forming a kind of pattern type together with the random combine obtained in ground floor search procedure, and the clout length Y of described pattern type is minimum.
Wherein, the end points value of described interval [inf, sup] is as follows:
inf=L-N*C
m,
sup=L-C
1,
Wherein, due to when random search, N crosses conference and makes that the value of inf is too small is even less than 0, inf < 0 has run counter to actual conditions, and inf too small meeting when causing obtaining a kind of pattern type roulette random search procedure too short, by the hunting zone of limit algorithm, be unfavorable for obtaining good pattern type, therefore the value of N is made to meet inf > 1/3L, that is:
inf=L-N*C
m>L/3;
Otherwise, if N is too small, by reducing the number of combinations M in deep search, making the sample number of deep search process insufficient, being unfavorable for obtaining the as far as possible little pattern type of clout length Y.Comprehensive above analysis, the value of setting N is:
Wherein, be no more than the number of times that the most multipotency of blank current demand is reused described in step D to calculate in the following manner:
Respectively by the current actual blank demand of each blank in current pattern type divided by the quantity arranged in current pattern type, and get the smallest positive integral in above-mentioned set, the value being no more than the number of times U that the most multipotency of blank current demand is reused is:
a
ij>0,j=1,2…m,
Wherein suppose that the sequence number of current pattern type is i, d
jrepresent the current actual blank demand after upgrading, a
ijrepresent the quantity of the jth kind specification blank arranged in current pattern type.
Wherein, heuristic rule described in step D is according to following formula, often kind of pattern type is carried out to the calculating of evaluation of estimate:
V=g
1*U-g
2*Y,
Wherein, g
1, g
2be two positive integers, g
1it is larger that just to represent the weight of U value in V value larger, on the contrary g
2larger, represent the weight of Y value in V value larger.
Wherein, compare screening described in step G to be undertaken by following three priority target from high to low:
Total radical of G1, raw materials consumption is minimum;
G2, pattern type are minimum;
Clout length in G3, last a kind of pattern type is maximum.
Technique scheme has following beneficial effect:
1, random search algorithm is improved, make algorithm to avoid blind search, considerably improve the search speed of feasible pattern type;
2, by setting up didactic value assessment formula, bootstrap algorithm search by how reusable pattern type of trying one's best, thus can contribute to the number reducing pattern type in final layout project;
3, by three priority target, automatic screening is carried out to all layout project, the solution of the One-dimensional Cutting Stock Problem obtained can save material resource, reduce cutting tool changing cost and make the remaining clout of last a kind of pattern type more;
4, one-dimensional stock-cutting method computing velocity of the present invention is fast, and layout project meets produces actual needs.
Accompanying drawing explanation
Fig. 1 is the method flow schematic diagram obtaining a kind of pattern type and evaluation of estimate thereof in one-dimensional stock-cutting method of the present invention;
Fig. 2 is the schematic flow sheet producing a complete layout project in one-dimensional stock-cutting method of the present invention;
Fig. 3 carries out by one-dimensional stock-cutting method of the present invention the result schematic diagram that an One-dimensional Cutting Stock Problem solves.
Embodiment
Below in conjunction with embodiment and accompanying drawing, the invention will be further described.
As shown in Figure 1, for obtaining the method flow schematic diagram of a kind of pattern type and evaluation of estimate thereof in one-dimensional stock-cutting method of the present invention, the method comprises the following steps:
Step S11: initialization pattern type, is about to represent that the chained list of pattern type is set to sky.
Step S12: choose blank with roulette algorithm is random from the blank set treating stock layout, join in pattern type chained list, judge length and whether enter [inf, sup] interval.
Roulette algorithm refers to that the selected probability of a certain length specification blank and its number are at the identical random search algorithm of the ratio treating to account in the set of stock layout blank.As supposed, an order has Count=d
1+ d
2++ d
mindividual blank, produces the random number in 1 to Count scope with randomizer, and it is interval which block is random number fall, and just chooses this kind of blank.
If T be accumulation charge length and, judge the value of T whether enter [inf, sup] interval; If then go to step S13, otherwise it is cumulative to go to step S12 continuation.
Step S13: find from M blank combination and the degree of depth combination length and closest to but be less than the combination of clout length Y, the described degree of depth combine with existing by roulette algorithm search to random combine together with form a kind of pattern type.
Due to the execution along with algorithm, treat that the blank set of stock layout can diminish, part combination certain blank number interior in M degree of depth combination may be caused to have exceeded it and treat stock layout quantity, then when search depth combines, this combination can not be used.Therefore in the scenario above, suppose that have found the closest combination sequence number being still less than clout length Y is K, because this combination K can not be used, so make K=K-1, namely searches forward.This search procedure lasts till that find can till adopted combination.
Step S14: judge whether the length of accumulation and T are greater than sup; If so, then turn S15, otherwise turn S13.If after searching forward because the combination of certain degree of depth can not be used in step S13 and adopting the shorter combination of length, whole pattern type also may also need to add short treats stock layout blank, and this step then ensure that the continuation combination of pattern type in this case.
Step S15: the most multipotency calculating this pattern type is reused number of times U and clout length Y, and calculates the value of this pattern type according to U and Y.
Wherein, the number of times U that most multipotency is reused refers to that it is no more than blank current demand and namely treats the number of times that the most multipotency of stock layout quantity is reused, and pattern type is worth desirable g in the value formula of V
1/ g
2=10.
As shown in Figure 2, the flow process producing a complete layout project in one-dimensional stock-cutting method of the present invention comprises the following steps:
S21: initialization layout project, is about to represent that the chained list of layout project is set to sky.
S22: judgement is treated the charge length of stock layout and whether is less than starting material length L, if then go to step S25, otherwise goes to step S23.
S23: obtain multiple pattern type, therefrom finds out the maximum pattern type of evaluation of estimate and this pattern type and most multipotency thereof is reused number of times U and join in layout project chained list.Wherein, each step of S11 to S15 that adopts obtains a sample loading mode and evaluation of estimate thereof, repeatedly, obtains multiple pattern type.
S24: upgrade and treat stock layout blank collection and go to step S22.Upgrade and treat stock layout blank collection namely from treating that the blank removed and used this pattern type concentrated by stock layout blank, described removal process repeats U time, and the result after having removed treats stock layout blank collection as new.
S25: export complete layout project.
The access times U of the various pattern type recorded in step S23 before and correspondence, treat that the single pattern type of one that stock layout blank collection formed is together as a kind of layout project with current.
In the inventive method, repeatedly repeated execution of steps S21 is to step S25, thus obtain multiple layout project, last comparison according to set three priority target from high to low filters out that layout project optimized, namely first choose raw materials consumption radical in each layout project minimum as final layout project; If there is multiple layout project raw materials consumption radical identical, then choose wherein pattern type number few as final layout project; If still there is the pattern type number of multiple layout project also identical, then choose clout length Y in wherein last a kind of pattern type maximum as final layout project.
In order to the validity of proved method, the actual blanking task of a BOPP film is adopted to test.
In this blanking task, starting material are for roll up film greatly, and its physical length is 8280, treat that stock layout blank and rouleau film length and demand volume number thereof are as follows respectively: 390*4,450*4,480*4,520*3,540*4,590*4,630*4,640*4,680*4,720*4,780*4,860*4,890*4,1500*10,1700*10, above-mentioned long measure is mm.
Figure 3 shows that by one-dimensional stock-cutting method of the present invention the result after above-mentioned blanking task solving, wherein, layout project comprises 4 kinds of pattern type, first three clout of planting pattern type is 0,4th kind of pattern type clout is 2080, use 8 starting material altogether, the layout project of generation is the optimum solution of this blanking task.
The above is only embodiments of the present invention; it should be pointed out that for those skilled in the art, under the prerequisite not departing from the technology of the present invention principle; can also make some improvement and modification, these improvement and modification also should be considered as the protection domain of the inventive method.