CN111932009A - Rectangular optimized layout method and device - Google Patents

Rectangular optimized layout method and device Download PDF

Info

Publication number
CN111932009A
CN111932009A CN202010795445.9A CN202010795445A CN111932009A CN 111932009 A CN111932009 A CN 111932009A CN 202010795445 A CN202010795445 A CN 202010795445A CN 111932009 A CN111932009 A CN 111932009A
Authority
CN
China
Prior art keywords
rectangular
binary
node
height
chunk
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010795445.9A
Other languages
Chinese (zh)
Other versions
CN111932009B (en
Inventor
陆宇升
廖淑珍
黄晴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanning Eternal Image Co ltd
Original Assignee
Nanning Eternal Image Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanning Eternal Image Co ltd filed Critical Nanning Eternal Image Co ltd
Priority to CN202010795445.9A priority Critical patent/CN111932009B/en
Publication of CN111932009A publication Critical patent/CN111932009A/en
Application granted granted Critical
Publication of CN111932009B publication Critical patent/CN111932009B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • G06Q10/043Optimisation of two dimensional placement, e.g. cutting of clothes or wood

Landscapes

  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Engineering & Computer Science (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Game Theory and Decision Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Development Economics (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Document Processing Apparatus (AREA)
  • Design And Manufacture Of Integrated Circuits (AREA)

Abstract

The invention relates to a rectangle optimization layout method and a device, belonging to the technical field of rectangle optimization arrangement, wherein the method or the device constructs a binary block tree based on a rectangle assembly set and a preset combination rule; the method has the advantages that the example of the root node of the binary block tree is obtained, the layout result of the rectangular piece set is determined, the scheme which does not belong to a heuristic algorithm and is high in plate utilization rate is rapidly searched, and the layout result with the higher plate utilization rate is obtained in a shorter time.

Description

Rectangular optimized layout method and device
Technical Field
The invention belongs to the technical field of rectangular optimal arrangement, and particularly relates to a rectangular optimal layout method and device.
Background
The problem of rectangular piece stock layout optimization means that a series of rectangular piece raw materials with different specifications are arranged in a rectangular area according to an optimal mode, so that parts are arranged in the rectangular area, the parts are not overlapped with each other, and corresponding process requirements are met, so that the required rectangular pieces are arranged as much as possible, and the utilization rate of materials is the highest. Such problems widely exist in practical production, such as sheet metal blanking, paper industry, glass cutting, furniture production, printing, photo development and the like. The current social development has increased resource consumption, and especially, the demand for industrial raw materials such as steel and paper is increased. The improvement of the utilization rate of raw materials has great significance for protecting the ecological environment, improving the productivity of enterprises and further obtaining greater economic benefits.
Generally, the rectangular piece layout optimization problem belongs to NP (Non-deterministic Polynomial complexity) Complete problem, and the optimal solution cannot be obtained in a short time. The existing layout method usually adopts a heuristic algorithm, such as a genetic algorithm, a simulated annealing algorithm, an ant colony algorithm, a particle swarm algorithm and the like, and then combines a certain arrangement rule, such as a BL algorithm, a lowest horizontal line algorithm, a hierarchical arrangement algorithm and the like.
However, in many existing rectangular piece layout application scenarios, there are rectangular pieces with large size, and the number and the size specification of the rectangular pieces are large, so that the heuristic algorithm search space is too large, and a layout scheme with an ideal board utilization rate cannot be found within a limited time. Therefore, how to quickly find a high-utilization scheme of rectangular layout becomes an urgent problem to be solved in the prior art.
Disclosure of Invention
In order to solve at least the above problems in the prior art, the present invention provides a rectangular optimal layout method and apparatus, so as to realize fast determination of a high utilization rate scheme for rectangular layout.
The technical scheme provided by the invention is as follows:
in one aspect, a rectangular optimized layout method includes:
constructing a binary chunk tree based on the rectangular piece set and a preset combination rule;
and acquiring an example of a root node of the binary chunk tree, and determining a layout result of the rectangular piece set.
Optionally, the method further includes:
and processing the residual rectangular piece based on a preset processing method.
Optionally, the constructing a binary chunk tree based on the rectangular component set and the preset combination rule includes:
determining a rectangular node Ri=(wi,hi,PSi,GSi) Wherein w isiIs the width of a rectangular piece, hiIs the height of the rectangular piece; PS (polystyrene) with high sensitivityiIs a subset of a set of rectangular elements, including all width and height values of (w)i,hi) All the rectangular pieces of (1); GSiIs a subset of binary blocks, containing all width and height equal to (w)i,hi) All binary chunk sets of (1);
for rectangular pieces P in the set PiTraversing whether the rectangular node R exists in the rectangular node set RiSatisfy RiIs equal to P in width and height, respectivelyiIf not, creating a width and height, respectively, equal to PiWidth and height of (1)iAnd R isiAdding the set R; will PiAdding RiPS ofiA subset;
traversing whether the rectangular node R exists in the rectangular node set RiSatisfy RiIs equal to P in width and height, respectivelyiIf not, creating a width and height, respectively, equal to PiHeight and width ofiAnd R isiAdding the set R; will PiAdding RiPS ofiA subset;
calculating a Cartesian product of the rectangular node set R and the rectangular node set R, and acquiring a binary chunk set GCR (equal to R) R {0,1 };
calculating the subset GC of the binary group set GCR, traversing the binary group set GCR in each GCRiIf the predetermined condition is satisfied, and GCRiIs less than wmax and hmax, respectively, the GCR is adjustediAdding a subset GC;
for binary chunks GC in each GCjFinding out whether the rectangular node R exists in the rectangular node set RiSatisfy RiIs equal to GC in width and height, respectivelyiIf not, creating a width and height equal to the GC, respectivelyiIs wideRectangular node R of degree and heightiAdding the set R; GC is arrangedjAdding RiGS ofiA subset;
searching whether a rectangular node R exists in the rectangular node set R or notiSatisfy RiWidth and height equal to GCiIf not, creating a width and height equal to the GC, respectivelyiWidth and height of (1)iAdding the set R; GC is arrangedjAdding RiGS ofiA subset;
calculating the binary block forest root node subset RR of the R set if the R is a rectangular nodeiHeight hiEqual to hmax or hmax-hiIs less than a preset threshold value and does not exist in any other rectangular node RjGS ofjIn the subset, then RiAdding an RR subset;
adding a virtual root node Rvr ═ (wmax, hmax, { }, RR) in the R set, wherein the rectangular piece subset of the virtual root node is an empty set, and the width and the height are set as limit values; the GS subset is an RR set; obtaining binary tree blocks
Optionally, the preset conditions include:
fg(GCRi)>tfg, wherein fg (GCR)i) Is a binary group block GCRiUtilization, Tfg, is a chunk utilization threshold, GC is a subset of GCR whose chunk utilization is greater than threshold Tfg; and/or the presence of a gas in the gas,
lg(GCRi)<tlg, wherein lg (GCR)i) Is a binary group block GCRiLoss, Tlg, is the chunk loss rate threshold.
Optionally, the obtaining an instance of a root node of the binary chunk tree and determining a layout result of the rectangular component set include:
acquiring an instance ivrk ═ createinstance (Rvr,0,0, selector) of a root node of the binary chunk tree according to the binary chunk tree, wherein createinstance is a recursive function, and the selector is used for selecting a rectangular piece or a binary chunk as a layout scheme;
call ivrk ═ createinstance (Rvr,0,0, selector);
if ivrk is equal to the null value, indicating that the stock layout is completed;
if ivrk is not equal to null, call L-getlayout (ik) function, L being a layout result, output L, and set all rectangles in L as unavailable, preventing them from being re-queued by the next createinstance call.
Optionally, the method for calling the createinstance recursive function includes:
selecting a rectangular piece or a binary chunk based on a selector function;
if a rectangular piece P is selected by the selector functionk=PSi[indexP]The createinstance recursive function constructs and returns an instance node (R) directlyi,offsetX,offsetY,indexP-1, wp, hp, null, null), wherein wp and hp are the width and height of the rectangular piece respectively;
if the selector function selects the binary block Gj=GSi[indexG]Then ig1 and ig2 are recursively calculated if GjTwo rectangular nodes of Rj1And Rj2
If G isjAnd horizontally splicing, namely:
ig1=createinstance(Rj1,offsetX,offsetY,selector);
ig2=createinstance(Rj2offset x + wj1, offset y, selector), where wj1 isiA width of g 1;
if G isjAnd (3) vertically splicing, namely:
ig1=createinstance(Rj1,offsetX,offsetY,selector);
ig2=createinstance(Rj2offsetX, offsetY + hj1, selector), where hj1 is the height of ig 1;
construct and return instance node (R)i,offsetX,offsetY,wi,hi-1, indexP, ig1, ig 2); wherein, wi,hiIs RiWidth and height of (d);
if the calculated result of ig1 or ig2 is null, G is representedjThe desired rectangular member has been exhausted, at which point GjMarked as unavailable, and recalledselection of new G by selector functionjCalculating ig1 and ig 2; if the node R isiGS ofiAll binary chunks in the subset are marked as unavailable, and a null value is returned to represent the node RiThe generation of the instance fails.
Optionally, the function getlayout (ik) is used to traverse leaf nodes of the binary tree and return a set of positions of the rectangular element; the calling method of the function getLayout (iiik) comprises the following steps:
judging iik whether the leaf node is, if indexPk is less than 0, iik not the leaf node;
if iik is a leaf node, then return the set { (Pk, offsetXk, offsetYk) }, where Pk ═ PSi[indexP],PSiIs RiThe subset of rectangular elements of (1);
if iik is not a leaf node, then getLayout is recursively called, returning getLayout: (igk1)UgetLayout(igk2)。
Optionally, the implementation method for selecting the rectangular component or the binary chunk by the selector function includes:
selecting a rectangular piece or a binary block in a mode of highest plate utilization rate; or the like, or, alternatively,
the largest sized rectangular piece, or a binary block containing the largest rectangular piece, is selected.
Optionally, the selecting the rectangular piece or the binary block in a manner of highest utilization rate of the plate includes:
if node RiOf rectangular elements PSiIf available rectangular pieces are included, any one of the available rectangular pieces is selected; if node RiOf rectangular elements PSiIs empty or has no any available rectangular pieces, then returns to GSiThe available chunk with the highest chunk utilization in the set, or, return GSiPreprocessing the available chunk with the highest actual stock layout utilization rate in the set, and calculating the actual maximum possible stock layout utilization rate of all chunks, wherein the time complexity is less than O (n × m), n is the number of all chunks in the chunk set, and m is the number of available rectangular pieces;
the selecting of the largest-sized rectangular piece, or the binary block containing the largest rectangular piece, includes:
if node RiOf rectangular elements PSiIf available rectangular pieces are included, any one of the available rectangular pieces is selected; if node RiOf rectangular elements PSiIs empty or has no any available rectangular pieces, then returns to GSiThe available chunks Gk in the set, Gk, directly or indirectly contain the largest rectangular piece.
In yet another aspect, a rectangular optimized layout apparatus includes: a construction module and a layout module;
the building module is used for building a binary chunk tree based on the rectangular piece set and a preset combination rule;
and the layout module is used for acquiring an example of a root node of the binary block tree and determining a layout result of the rectangular piece set.
The invention has the beneficial effects that:
according to the rectangle optimization layout method and device provided by the embodiment of the invention, a binary block tree is constructed based on a rectangle component set and a preset combination rule; the method comprises the steps of obtaining an example of a root node of a binary block tree, determining a layout result of a rectangular piece set, and achieving the purpose that the layout does not belong to a heuristic algorithm.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a rectangular optimized layout method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a binary chunk construction provided by an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a rectangular optimized layout device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a rectangular optimized layout device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the examples given herein without any inventive step, are within the scope of the present invention.
In order to at least solve the technical problem provided by the invention, the embodiment of the invention provides a rectangular optimized layout method.
Fig. 1 is a schematic flow chart of a rectangular optimized layout method according to an embodiment of the present invention, and referring to fig. 1, the method according to the embodiment of the present invention may include the following steps:
and S11, constructing a binary chunk tree based on the rectangular piece set and a preset combination rule.
In this embodiment, a combination of two rectangles is defined as binary chunks 2-groups, and the two rectangles to be combined may have the same size or different sizes. The combined rectangle can be a rectangle to be arranged, and can also be another binary block. For example, fig. 2 is a schematic diagram of a binary chunk construction provided in an embodiment of the present invention, referring to fig. 2, a binary chunk G may be composed of a rectangle a and a rectangle B, and a combining process of the rectangle a and the rectangle B may be horizontal or vertical. Any two rectangles can be combined into a binary chunk, but unconditional combination can lead to explosion of the combination, and some restrictions must be placed on the combination in order to reduce the number of chunks. The rectangle a and the rectangle B are spliced into a binary chunk G (a, B,0), and a binary chunk utilization fg (G) is defined (area (a) + area (B))/area (G), where area is an area function and area (a) represents the area of the rectangle a. If the utilization fg of a binary chunk is too low, this binary chunk is not valuable and should be discarded. The quality of a chunk may also be represented by chunk loss lg (g) -area (a) -area (b). Referring to fig. 2, the two rectangles B and a are spliced in a horizontal and vertical manner, a triple (a, B,0) is used to represent the structure of a chunk, the last element takes values of 0 and 1, 0 represents the horizontally arranged splicing manner, and 1 represents the vertically arranged splicing manner.
Any binary chunk can be recombined with the rectangular piece or another binary chunk to obtain a new larger binary chunk, and the combination process can continue until the width or height of the obtained binary chunk exceeds the maximum layout limit. This process may result in a binary chunk forest.
The nodes of the binary block tree/forest are rectangular nodes, each rectangular node has a width and a height, and a rectangular member set and a binary block set are arranged; the width and height of all the rectangular pieces in the rectangular piece set are equal to the width and height of the rectangular nodes, and likewise, the width and height of each binary chunk in the binary chunk set are equal to the width and height of the rectangular nodes.
First, theiA rectangular node Ri=(wi,hi,PSi,GSi) Wherein w isiIs the width of a rectangle, hiIs a rectangular height, PSiIs a subset of a rectangular member, including all widths and heights of (w)i,hi) All the rectangular pieces of (1); GSiIs a subset of a binary block containing all width and height values equal to (w)i,hi) All binary chunks of (1).
Defining that a binary block G ═ (Rl, Rr, d) is a triple, and a binary block includes two rectangular nodes, where Rl and Rr are respectively set, d takes values of 0 and 1, 0 represents a horizontally arranged splicing manner, and 1 represents a vertically arranged splicing manner.
Optionally, constructing a binary chunk tree based on the rectangular component set and a preset combination rule, including:
the first step is as follows: determining a rectangular node Ri=(wi,hi,PSi,GSi) Wherein w isiIs the width of a rectangular part,hiIs the height of the rectangular piece; PS (polystyrene) with high sensitivityiIs a subset of a set of rectangular elements, including all width and height values of (w)i,hi) All the rectangular pieces of (1); GSiIs a subset of binary blocks, containing all width and height equal to (w)i,hi) All binary chunks of (1).
The second step is that: for rectangular pieces P in the set PiTraversing whether the rectangular node R exists in the rectangular node set RiSatisfy RiIs equal to P in width and height, respectivelyiIf not, creating a width and height, respectively, equal to PiWidth and height of (1)iAnd R isiAdding the set R; will PiAdding RiPS ofiA subset; traversing whether the rectangular node R exists in the rectangular node set RiSatisfy RiIs equal to P in width and height, respectivelyiHeight and width (i.e., R)iWidth and height equal to PiHeight and width (rotated 90 degrees)), if not present, creating a width and height equal to P, respectivelyiHeight and width ofiAnd R isiAdding the set R; will PiAdding RiPS ofiA subset.
The third step: calculating a Cartesian product of the rectangular node set R and the rectangular node set R, and acquiring a binary chunk set GCR (equal to R) R {0,1 }; the cartesian product is well known to those skilled in the art in the prior art, and the calculation process is not described herein.
The fourth step: calculating the subset GC of the binary group set GCR, traversing the binary group set GCR in each GCRiIf the predetermined condition is satisfied, and GCRiIs less than wmax and hmax, respectively, the GCR is adjustediThe subset GC is added.
For example, preset conditions include: fg (GCR)i)>Tfg, wherein fg (GCR)i) Is a binary group block GCRiUtilization, Tfg, is a chunk utilization threshold, GC is a subset of GCR whose chunk utilization is greater than threshold Tfg; and/or lg (GCR)i)<Tlg, wherein lg (GCR)i) Is twoMeta-block GCRiLoss, Tlg, is the chunk loss rate threshold. The user may control the quality of the chunks according to a chunk loss threshold Tlg or a chunk utilization threshold Tfg. For example, lg (GCR) is requiredi)<Tlg may be used in combination with Tlg and Tfg, or for small area chunks, Tlg control may be used, and for large area chunks, Tfg control may be used. The method is not particularly limited, and the user may limit the method according to actual situations.
The fifth step: for binary chunks GC in each GCjFinding out whether the rectangular node R exists in the rectangular node set RiSatisfy RiIs equal to GC in width and height, respectivelyiIf not, creating a width and height equal to the GC, respectivelyiWidth and height of (1)iAdding the set R; GC is arrangedjAdding RiGS ofiA subset. Searching whether a rectangular node R exists in the rectangular node set R or notiSatisfy RiWidth and height equal to GCiIf not, creating a width and height equal to the GC, respectivelyiWidth and height of (1)iAdding the set R; GC is arrangedjAdding RiGS ofiA subset. And returning to the third step if the R set is changed in the process, otherwise, completing the construction of the R set.
And a sixth step: calculating the binary block forest root node subset RR of the R set if the R is a rectangular nodeiHeight hiEqual to hmax or hmax-hiIs less than a preset threshold value and does not exist in any other rectangular node RjGS ofjIn the subset, then RiAdding the RR subset. The preset threshold may be set according to a requirement, and is not specifically limited herein. The obtained RR subset is a binary chunk forest and is a calculation result of the algorithm.
The seventh step: adding a virtual root node Rvr ═ (wmax, hmax, { }, RR) in the R set, wherein the rectangular piece subset of the virtual root node is an empty set, and the width and the height are set as limit values; the GS subset is an RR set; a binary set of tree blocks is obtained. In this embodiment, in order to facilitate processing, a binary chunk tree is constructed, a virtual root is added, if the virtual root is not constructed, a binary chunk forest is generated, and the tree becomes after the virtual root is constructed.
And S12, acquiring an example of the root node of the binary chunk tree, and determining the layout result of the rectangular piece set.
In the present embodiment, the PS mentioned belowiAnd GSiThe sets are ordered sets, each element of which cannot be repeated corresponds to a certain sequence number (subscript), and the corresponding element can be obtained through the sequence number. In the programming phase, ordered sets should be implemented with arrays.
For any one rectangular node Ri=(wi,hi,PSi,GSi) For multiple patterns, the rectangular instance node iik ═ (R)i,offsetX,offsetY,wi,hi,indexP, indexG, ig1, ig2) represents a certain rectangular node RiThe coordinates of the left upper corner of the plate are (offset X, offset Y), the width and the height are equal to wi,hiA particular layout scheme on the rectangular area of (a). Wherein indexP indicates that the selected rectangular piece is at RiPS ofiSubscripts in the subset set to-1 if no rectangle is selected, indexG indicates that the selected binary chunk is at RiGS ofiSubscript in subset set to-1 if binary chunk is not selected; because a rectangular piece or binary chunk must be selected for a rectangular node, indexP and indexG must have one equal to-1 and the other equal to or greater than 0; if a binary chunk G is selectedj=GSi[indexG]Then ig1 and ig2 must not be null, G respectivelyjA rectangular instance node of the two rectangular nodes.
Optionally, obtaining an instance of a root node of the binary chunk tree, and determining a layout result of the rectangular piece set includes:
the method comprises the following steps: obtaining an instance ivrk ═ createinstance (Rvr,0,0, selector) of a root node of the binary chunk tree according to the binary chunk tree, wherein createinstance is a recursive function, and the selector is used for selecting a rectangular piece or a binary chunk as a stock layout; call ivrk ═ createinstance (Rvr,0,0, selector).
In this embodiment, since any instance ivrk of the virtual root node Rvr is a final layout result, only the node R generating any rectangle is foundiThe method of example (1) can solve the problem of stock layout of rectangular pieces. Rectangular node R can be solved through a recursive function createinstanceiExamples of (2): recursive function createinstance (R)iOffset x, offset y, selector) parameter RiFor rectangular nodes, offsetX and offsetY are coordinates of the upper left corner of the stock layout area on the plate, and the selector is a function for RiA rectangular piece or a binary block is selected as its layout.
Step two: if ivrk is equal to the null value, indicating that the stock layout is completed;
step three: if ivrk is not equal to null, call L-getlayout (ik) function, L being a layout result, output L, and set all rectangles in L as unavailable, preventing them from being re-queued by the next createinstance call.
Optionally, the method for calling the createinstance recursive function includes:
the method comprises the following steps: selecting a rectangular piece or a binary chunk based on a selector function;
step two: if a rectangular part P is selected by the selector functionk=PSi[indexP]The createinstance recursive function constructs and returns an instance node (R) directlyi,offsetX,offsetY,indexP, -1, wp, hp, null, null), wp and hp are the width and height of the rectangular piece respectively;
step three: if the selector function selects the binary block Gj=GSi[indexG]Then ig1 and ig2 are recursively calculated if GjThe two rectangular nodes of (a) are Rj1 and Rj2, which are calculated in two cases:
(1) if G isjAnd horizontally splicing, namely:
ig1=createinstance(Rj1,offsetX,offsetY,selector);
ig2=createinstance(Rj2,offsetX+wj1, offset, selector), where wj1 is the width of ig 1;
(2) if G isjAnd (3) vertically splicing, namely:
ig1=createinstance(Rj1,offsetX,offsetY,selector);
ig2=createinstance(Rj2,offsetX,offsetY+hj1, selector), where hj1 is the height of ig 1;
step four: construct and return instance node (R)i,offsetX,offsetY,wi,hi,-1,indexP, ig1, ig 2); wherein, wi,hiIs RiWidth and height of (a).
If the calculated result of ig1 or ig2 is null, G is representedjThe desired rectangular member has been exhausted, at which point GjMarked as unavailable, the selector function is called again to select a new GjCalculating ig1 and ig 2; if the node R isiGS ofiAll binary chunks in the subset are marked as unavailable, and a null value is returned to represent the node RiThe generation of the instance fails.
Optionally, the implementation method for selecting the rectangular component or the binary chunk by the selector function includes:
selecting a rectangular piece or a binary block in a mode of highest plate utilization rate; or the like, or, alternatively,
the largest sized rectangular piece, or a binary block containing the largest rectangular piece, is selected.
Optionally, selecting the rectangular piece or the binary block in a manner of highest utilization rate of the plate includes:
if node RiOf rectangular elements PSiIf available rectangular pieces are included, any one of the available rectangular pieces is selected; if node RiOf rectangular elements PSiIs empty or has no any available rectangular pieces, then returns to GSiThe available chunk with the highest chunk utilization in the set, or, return GSiThe available chunk with the highest actual stock layout utilization rate in the set is preprocessed, the actual maximum possible stock layout utilization rate of all chunks is calculated, and the time complexity is smaller than O (n m), wherein nIs the number of all chunks in the set of chunks, and m is the number of available tiles.
In the embodiment, the optimal layout result in the current state can be obtained by calling the createinstance function each time by using the selector function. However, it is generally impossible to arrange all rectangles by calling the createinstance function once, and it is necessary to call the createinstance function many times, each time the invocation obtains the optimal result, and the final result is not necessarily the optimal result.
Selecting a largest sized rectangular piece, or a binary block containing the largest rectangular piece, comprising:
if node RiOf rectangular elements PSiIf available rectangular pieces are included, any one of the available rectangular pieces is selected; if node RiOf rectangular elements PSiIs empty or has no any available rectangular pieces, then returns to GSiMaximum rectangle contained directly or indirectly by available chunks Gk in the set
In this embodiment, this form of selector prefers the solution containing large rectangular elements, which performs best in the photo layout problem, because the large rectangular elements are particularly numerous and not easy to arrange, and the small rectangular elements, no matter arranged first or later, are arranged with high utilization rate together with any other rectangular elements, so the best overall utilization rate is easily obtained for the first arranged large elements and the second arranged small elements.
Generic, rectangular instance nodesiik=(Ri,offsetX,offsetY,wi,hiindexP, indexG, ig1, ig2) are nodes of a tree, where ig1, ig2 are children of iik nodes.
The final drainage can be implemented by simply calling ivrk ═ createinstance (Rvr,0,0, selector), where Rvr is the virtual root node. The rectangular instance ivrk is a binary tree with its leaf node iik ═ R (R)ioffsetXk, offsetYk, indexPk, indexGk, igk1, igk2) indicate that a rectangular piece Pk is arranged at a coordinate point on a panel (offsetXk, offsetYk), where Pk is PSi[indexP],PSiIs RiA subset of the rectangular elements of (1). Only a simple binary tree traversal method is needed to obtainAll the rectangular pieces inside the ivrk and the positions of the rectangular pieces on the plate are obtained. A recursive function getlayout (ik) traverses leaf nodes of the binary tree and returns a set of positions of the rectangular element, and the calling method of the function getlayout (ik) comprises:
judging iik whether the leaf node is, if indexPk is less than 0, iik not the leaf node;
if iik is a leaf node, then return the set { (Pk, offsetXk, offsetYk) }, where Pk ═ PSi[indexP],PSiIs RiThe subset of rectangular elements of (1);
if iik is not a leaf node, then getLayout is recursively called, returning getLayout (igk1) UgetLayout (igk 2).
Optionally, the method further includes: and processing the residual rectangular piece based on a preset processing method.
For example, in the above-mentioned technical solution, all the rectangular pieces cannot be arranged and the remaining small number of rectangular pieces are not arranged, and at this time, the remaining rectangular pieces may be processed by manual layout or by conventional layout, such as a combination of the remaining rectangular method and a simulated annealing algorithm.
The rectangle optimization layout method provided by the embodiment of the invention constructs a binary block tree based on a rectangle set and a preset combination rule; the method comprises the steps of obtaining an example of a root node of a binary block tree, determining a layout result of a rectangular piece set, and achieving the purpose that the layout does not belong to a heuristic algorithm.
Based on a general inventive concept, the embodiment of the invention also provides a rectangular optimized layout device.
Fig. 3 is a schematic structural diagram of a rectangular optimized layout device according to an embodiment of the present invention, referring to fig. 3, the device according to the embodiment of the present invention may include the following structures: a build module 31 and a layout module 32;
the building module 31 is used for building a binary chunk tree based on the rectangular piece set and a preset combination rule;
and the layout module 32 is configured to obtain an instance of a root node of the binary chunk tree and determine a layout result of the rectangular component set.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The rectangular optimization layout device provided by the embodiment of the invention constructs a binary block tree based on a rectangular piece set and a preset combination rule; the method comprises the steps of obtaining an example of a root node of a binary block tree, determining a layout result of a rectangular piece set, and achieving the purpose that the layout does not belong to a heuristic algorithm.
Based on a general inventive concept, the embodiment of the present invention also provides a rectangular optimized layout apparatus.
Fig. 4 is a schematic structural diagram of a rectangular optimized layout device according to an embodiment of the present invention, and referring to fig. 4, a bidding device for multiple main bodies in a virtual power plant according to an embodiment of the present invention includes: a processor 41, and a memory 42 coupled to the processor.
The memory 42 is used for storing a computer program, and the computer program is at least used for the rectangular optimization layout method described in any one of the above embodiments;
the processor 41 is used to invoke and execute computer programs in memory.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.
It is understood that the same or similar parts in the above embodiments may be mutually referred to, and the same or similar parts in other embodiments may be referred to for the content which is not described in detail in some embodiments.
It should be noted that the terms "first," "second," and the like in the description of the present invention are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Further, in the description of the present invention, the meaning of "a plurality" means at least two unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (10)

1. A rectangular optimized layout method is characterized by comprising the following steps:
constructing a binary chunk tree based on the rectangular piece set and a preset combination rule;
and acquiring an example of a root node of the binary chunk tree, and determining a layout result of the rectangular piece set.
2. The method of claim 1, further comprising:
and processing the residual rectangular piece based on a preset processing method.
3. The method of claim 1, wherein constructing a binary chunk tree based on a set of rectangles and a preset composition rule comprises:
determining a rectangular node Ri=(wi,hi,PSi,GSi) Wherein w isiIs the width of a rectangular piece, hiIs the height of the rectangular piece; PS (polystyrene) with high sensitivityiIs a subset of a set of rectangular elements, including all width and height values of (w)i,hi) All the rectangular pieces of (1); GSiIs a subset of binary blocks, containing all width and height equal to (w)i,hi) All binary chunk sets of (1);
for rectangular pieces P in the set PiTraversing whether the rectangular node R exists in the rectangular node set RiSatisfy RiIs equal to P in width and height, respectivelyiIf not, creating a width and height, respectively, equal to PiWidth and height of (1)iAnd R isiAdding the set R; will PiAdding RiPS ofiA subset;
traversing whether the rectangular node R exists in the rectangular node set RiSatisfy RiIs equal to P in width and height, respectivelyiIf not, creating a width and height, respectively, equal to PiHeight and width ofiAnd R isiAdding the set R; will PiAdding RiPS ofiA subset;
calculating a Cartesian product of the rectangular node set R and the rectangular node set R, and acquiring a binary chunk set GCR (equal to R) R {0,1 };
calculating the subset GC of the binary group set GCR, traversing the binary group set GCR in each GCRiIf the predetermined condition is satisfied, and GCRiIs less than wmax and hmax, respectively, the GCR is adjustediAdding a subset GC;
for binary chunks GC in each GCjFinding out whether the rectangular node R exists in the rectangular node set RiSatisfy RiIs equal to GC in width and height, respectivelyiIf not, creating a widthAnd height is equal to GC respectivelyiWidth and height of (1)iAdding the set R; GC is arrangedjAdding RiGS ofiA subset;
searching whether a rectangular node R exists in the rectangular node set R or notiSatisfy RiWidth and height equal to GCiIf not, creating a width and height equal to the GC, respectivelyiWidth and height of (1)iAdding the set R; GC is arrangedjAdding RiGS ofiA subset;
calculating the binary block forest root node subset RR of the R set if the R is a rectangular nodeiHeight hiEqual to hmax or hmax-hiIs less than a preset threshold value and does not exist in any other rectangular node RjGS ofjIn the subset, then RiAdding an RR subset;
adding a virtual root node Rvr ═ (wmax, hmax, { }, RR) in the R set, wherein the rectangular piece subset of the virtual root node is an empty set, and the width and the height are set as limit values; the GS subset is an RR set; a binary set of tree blocks is obtained.
4. The method according to claim 3, wherein the preset condition comprises:
fg(GCRi)>tfg, wherein fg (GCR)i) Is a binary group block GCRiUtilization, Tfg, is a chunk utilization threshold, GC is a subset of GCR whose chunk utilization is greater than threshold Tfg; and/or the presence of a gas in the gas,
lg(GCRi)<tlg, wherein lg (GCR)i) Is a binary group block GCRiLoss, Tlg, is the chunk loss rate threshold.
5. The method of claim 3, wherein obtaining an instance of a root node of the binary chunk tree, determining a layout result for the set of rectangles, comprises:
acquiring an instance ivrk ═ createinstance (Rvr,0,0, selector) of a root node of the binary chunk tree according to the binary chunk tree, wherein createinstance is a recursive function, and the selector is used for selecting a rectangular piece or a binary chunk as a layout scheme;
call ivrk ═ createinstance (Rvr,0,0, selector);
if ivrk is equal to the null value, indicating that the stock layout is completed;
if ivrk is not equal to null, call L-getlayout (ik) function, L being a layout result, output L, and set all rectangles in L as unavailable, preventing them from being re-queued by the next createinstance call.
6. The method of claim 5, wherein the calling method of the createinstance recursive function comprises:
selecting a rectangular piece or a binary chunk based on a selector function;
if a rectangular piece P is selected by the selector functionk=PSi[indexP]The createinstance recursive function constructs and returns an instance node (R) directlyi,offsetX,offsetY,indexP-1, wp, hp, null, null), wherein wp and hp are the width and height of the rectangular piece respectively;
if the selector function selects the binary block Gj=GSi[indexG]Then ig1 and ig2 are recursively calculated if GjTwo rectangular nodes of Rj1And Rj2
If G isjAnd horizontally splicing, namely:
ig1=createinstance(Rj1,offsetX,offsetY,selector);
ig2=createinstance(Rj2offset x + wj1, offset y, selector), where wj1 is
The width of ig 1;
if G isjAnd (3) vertically splicing, namely:
ig1=createinstance(Rj1,offsetX,offsetY,selector);
ig2=createinstance(Rj2offsetX, offsetY + hj1, selector), where hj1 is
Height of ig 1;
construct and return instance node (R)i,offsetX,offsetY,wi,hi-1, indexP, ig1, ig 2); wherein, wi,hiIs RiWidth and height of (d);
if the calculated result of ig1 or ig2 is null, G is representedjThe desired rectangular member has been exhausted, at which point GjMarked as unavailable, the selector function is called again to select a new GjCalculating ig1 and ig 2; if the node R isiGS ofiAll binary chunks in the subset are marked as unavailable, and a null value is returned to represent the node RiThe generation of the instance fails.
7. The method of claim 5, wherein the function getlayout (ik) is used to traverse leaf nodes of a binary tree and return a set of positions of a rectangular piece; the calling method of the function getLayout (iiik) comprises the following steps:
judging iik whether the leaf node is, if indexPk is less than 0, iik not the leaf node;
if iik is a leaf node, then return the set { (Pk, offsetXk, offsetYk) }, where Pk ═ PSi[indexP],PSiIs RiThe subset of rectangular elements of (1);
if iik is not a leaf node, then getLayout is recursively called, returning getLayout: (igk1)U getLayout(igk2)。
8. The method of claim 6, wherein the selector function selects a rectangular or binary chunk implementation, comprising:
selecting a rectangular piece or a binary block in a mode of highest plate utilization rate; or the like, or, alternatively,
the largest sized rectangular piece, or a binary block containing the largest rectangular piece, is selected.
9. The method of claim 8, wherein selecting the rectangular piece or the binary block in a manner that maximizes board utilization comprises:
if node RiOf rectangular elements PSiIf available rectangular pieces are included, any one of the available rectangular pieces is selected; if node RiOf rectangular elements PSiIs empty or has no any available rectangular pieces, then returns to GSiThe available chunk with the highest chunk utilization in the set, or, return GSiPreprocessing the available chunk with the highest actual stock layout utilization rate in the set, and calculating the actual maximum possible stock layout utilization rate of all chunks, wherein the time complexity is less than O (n × m), n is the number of all chunks in the chunk set, and m is the number of available rectangular pieces;
the selecting of the largest-sized rectangular piece, or the binary block containing the largest rectangular piece, includes:
if node RiOf rectangular elements PSiIf available rectangular pieces are included, any one of the available rectangular pieces is selected; if node RiOf rectangular elements PSiIs empty or has no any available rectangular pieces, then returns to GSiThe available chunks Gk in the set, Gk, directly or indirectly contain the largest rectangular piece.
10. A rectangular optimized stock layout device, comprising: a construction module and a layout module;
the building module is used for building a binary chunk tree based on the rectangular piece set and a preset combination rule;
and the layout module is used for acquiring an example of a root node of the binary block tree and determining a layout result of the rectangular piece set.
CN202010795445.9A 2020-08-10 2020-08-10 Rectangular optimized layout method and device Active CN111932009B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010795445.9A CN111932009B (en) 2020-08-10 2020-08-10 Rectangular optimized layout method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010795445.9A CN111932009B (en) 2020-08-10 2020-08-10 Rectangular optimized layout method and device

Publications (2)

Publication Number Publication Date
CN111932009A true CN111932009A (en) 2020-11-13
CN111932009B CN111932009B (en) 2024-05-21

Family

ID=73308231

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010795445.9A Active CN111932009B (en) 2020-08-10 2020-08-10 Rectangular optimized layout method and device

Country Status (1)

Country Link
CN (1) CN111932009B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112418528A (en) * 2020-11-24 2021-02-26 哈尔滨理工大学 Amphibious vehicle layout area utilization maximization method based on multi-strategy dynamic adjustment
CN113688453A (en) * 2021-08-23 2021-11-23 杭州群核信息技术有限公司 Relative texture paving commodity layout calculation method and device, electronic equipment and medium
CN114417444A (en) * 2022-03-29 2022-04-29 北京百度网讯科技有限公司 Determination method and device for layout scheme and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0540803A (en) * 1991-02-14 1993-02-19 Fujitsu Ltd Arrangement method utilizing rectangular dual graph
US5953722A (en) * 1996-10-25 1999-09-14 Navigation Technologies Corporation Method and system for forming and using geographic data
CN103500255A (en) * 2013-10-16 2014-01-08 南通大学 Intelligent layout method used for rectangular part
CN104150759A (en) * 2014-01-15 2014-11-19 南京比藤信息科技有限公司 Layout cutting method for two-dimensional irregular glass parts
CN109710542A (en) * 2018-12-28 2019-05-03 北京像素软件科技股份有限公司 A kind of completely N-ary tree construction method and device
CN110570038A (en) * 2019-09-06 2019-12-13 福州大学 Method and device for rectangular layout of irregular sheet with defects

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0540803A (en) * 1991-02-14 1993-02-19 Fujitsu Ltd Arrangement method utilizing rectangular dual graph
US5953722A (en) * 1996-10-25 1999-09-14 Navigation Technologies Corporation Method and system for forming and using geographic data
CN103500255A (en) * 2013-10-16 2014-01-08 南通大学 Intelligent layout method used for rectangular part
CN104150759A (en) * 2014-01-15 2014-11-19 南京比藤信息科技有限公司 Layout cutting method for two-dimensional irregular glass parts
CN109710542A (en) * 2018-12-28 2019-05-03 北京像素软件科技股份有限公司 A kind of completely N-ary tree construction method and device
CN110570038A (en) * 2019-09-06 2019-12-13 福州大学 Method and device for rectangular layout of irregular sheet with defects

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112418528A (en) * 2020-11-24 2021-02-26 哈尔滨理工大学 Amphibious vehicle layout area utilization maximization method based on multi-strategy dynamic adjustment
CN112418528B (en) * 2020-11-24 2021-09-14 哈尔滨理工大学 Amphibious vehicle layout area utilization maximization method based on multi-strategy dynamic adjustment
CN113688453A (en) * 2021-08-23 2021-11-23 杭州群核信息技术有限公司 Relative texture paving commodity layout calculation method and device, electronic equipment and medium
CN114417444A (en) * 2022-03-29 2022-04-29 北京百度网讯科技有限公司 Determination method and device for layout scheme and electronic equipment

Also Published As

Publication number Publication date
CN111932009B (en) 2024-05-21

Similar Documents

Publication Publication Date Title
CN111932009A (en) Rectangular optimized layout method and device
WO2022057303A1 (en) Image processing method, system and apparatus
CN105809389A (en) Method and apparatus for generating BOM trees
CN111932011B (en) Rectangular optimization layout method and device based on binary block tree
JP2014055037A (en) Loading operation method, system and computer program
US8060540B2 (en) Data relationship visualizer
CN115685875B (en) A cutting path optimization method and system for special-shaped plates
CN109727184A (en) A kind of graphics processor three-dimensional cuts out circuit
CN111161424A (en) Three-dimensional map determination method and determination device
CN114417444A (en) Determination method and device for layout scheme and electronic equipment
US9665668B2 (en) Configuring a dispatching rule for execution in a simulation
CN114818044A (en) Node modeling method, device and storage medium
CN111241644B (en) Reinforcing bar information generation method and device based on board drawing and computer storage medium
CN113895728A (en) Greedy palletizing method and device and computer readable storage medium
CN111985740A (en) Task processing method and device
CN117008534A (en) Round hole milling realization method and realization system
CN104570759B (en) The quick Binomial Trees of control system midpoint orientation problem
CN112764749B (en) Method and system for generating software function interface group
CN115346005A (en) Data structure construction method for object plane grid based on nested bounding box concept
CN113359530A (en) Sequence control method and device
CN112711627A (en) Data import method, device and equipment for greenplus database
CN111709593B (en) Space resource optimal allocation method based on weak space constraint
CN117034465A (en) Ship structure node generation method and device, electronic equipment and storage medium
JP2020155044A (en) Program compiling device, program compiling method, and program compiling program
CN114169572B (en) A rectangular intelligent layout method and system based on biased genetic algorithm

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant