A method, device, equipment and readable storage medium for packing articles
By constructing a two-dimensional vector packing model with time window constraints and designing a hybrid branch pricing and cutting algorithm, the problem of the failure to effectively consider time windows in existing packing strategies is solved, achieving an efficient and optimal packing scheme, reducing transportation costs and improving customer satisfaction.
Patent Information
- Application Number
- CN202111326883.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-10
- Publication Date
- 2024-11-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing packing strategies fail to effectively consider the time window constraints of items, leading to increased delivery costs and reduced customer satisfaction. Existing algorithms are inefficient in solving large-scale packing problems and struggle to provide feasible solutions within an acceptable timeframe.
A two-dimensional vector bin packing integer programming model with time window constraints was constructed. The model was decomposed into a first model and a second model using the Dantzig-Wolfe decomposition method. An adaptive large-scale neighborhood search algorithm and a label expansion method were designed through a collaborative framework of hybrid branch pricing algorithm combined with exact algorithm and heuristic algorithm to optimize the column generation and solution process.
It significantly improves algorithm efficiency, enabling rapid solutions to large-scale packing problems while ensuring optimality. It provides packing schemes with the minimum number of boxes, satisfying constraints on item weight, volume, and time window.
Smart Images

Figure CN114169573B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of logistics technology, and in particular to a two-dimensional packing method, device, equipment and readable storage medium for a time window. Background Art
[0002] With the rapid development of the e-commerce industry, the business volume of logistics companies has exploded, and optimizing each link in logistics distribution has become an urgent issue in the logistics industry. In logistics transportation, packing, as an important technology in logistics distribution, is the key to improving transportation efficiency, reducing transportation costs, and improving transportation automation. Therefore, adopting a reasonable and efficient packing strategy can save costs and improve transportation efficiency for many manufacturing companies and logistics and transportation companies.
[0003] For logistics and distribution companies, the two dimensions of package weight and volume are the primary considerations for packing. However, with the rapid development of the logistics industry, customers have higher and higher requirements for delivery time. If the delivery time limit is not considered when packing, it will inevitably increase transportation costs and reduce customer satisfaction. In this context, logistics and distribution companies cannot load items according to traditional packing solutions, and must consider delivery time as an important consideration in packing strategies. However, most existing packing strategies only consider the weight and volume constraints of items, and rarely consider the constraints of item time windows. Therefore, the present invention aims to solve the packing problem that comprehensively considers the constraints of item weight, volume and time window, in order to load the most items with the least number of boxes. Summary of the invention
[0004] The purpose of the present invention is to provide a method, device, equipment and readable storage medium for packing articles to improve the above problems. In order to achieve the above objectives, the technical solutions adopted by the present invention are as follows:
[0005] In the prior art, the model does not include the item time window into the packing strategy, and most of them only consider the item weight and volume constraints. Therefore, the obtained packing solution fails to meet the customer's time requirements, increases the company's distribution costs, and reduces customer satisfaction. Second, in terms of algorithm design, there are almost no methods for solving the two-dimensional vector packing problem with time window constraints. Although the precise methods designed for the one-dimensional packing problem and the two-dimensional vector packing problem can obtain the optimal solution, the solution efficiency is slow, especially for large-scale packing problems. It is even impossible to give a feasible packing solution within an acceptable time range, which affects the instant delivery of logistics companies. It can be simply explained that the time window in the logistics distribution span refers to a time span, a time interval, and its upper and lower limits are the latest arrival time and the earliest arrival time that the customer can accept, because early arrival and late arrival will affect customer satisfaction, and too early and too late arrival may lead to customer dissatisfaction. In the logistics distribution system, the time window should be a conditional restriction.
[0006] The present invention is a method for solving the two-dimensional vector packing problem that simultaneously considers the weight, volume and time window constraints of the items. In order to improve the above defects, a two-dimensional vector packing integer programming model is constructed; the integer programming model is reconstructed into a first model and a second model using a decomposition method, and the first model and the second model are solved to obtain a packing solution with the least number of boxes.
[0007] In a first aspect, the present invention provides a method for packing items, wherein first information is obtained, the first information including weight information, volume information, and time window information of each item in an item set, the items being items to be packed into a box;
[0008] Acquire second information, where the second information includes volume information and maximum load-bearing weight information of a box, where the box is a box for items to be loaded;
[0009] A calculation model for two-dimensional vector packing with a time window constraint is established, the first information and the second information are used as input information of the calculation model, and the calculation model is solved to obtain a minimum value of the number of boxes used.
[0010] Preferably, the method of establishing a calculation model for two-dimensional vector packing with a time window constraint, taking the first information and the second information as input information of the calculation model, and solving the calculation model includes: establishing a calculation model for two-dimensional vector packing with a time window constraint, taking the first information and the second information as input information of the calculation model, and solving the calculation model to obtain the minimum value of the number of boxes used.
[0011] Preferably, the establishment of a calculation model for two-dimensional vector packing with a time window constraint, taking the first information and the second information as input information of the calculation model, solving the calculation model, and obtaining the minimum number of boxes used, includes: decomposing the calculation model by Dantzig-Wolfe decomposition method to obtain the decomposition result, the decomposition result including the first model and the second model; inputting the first information and the second information into the first model, solving the first model to obtain dual variables; inputting the first information, the second information and the dual variables into the second model, solving the second model to obtain test number information, and extracting a packing method with a negative test number in the set information, the packing method being any method in which the items can be packed into the box and satisfying preset constraints;
[0012] The first information, the second information and the check number information are input into the first model, and an iterative calculation is performed to obtain an iterative calculation result. If the check number of the iterative calculation result is positive, the minimum value of the number of boxes used is obtained. The result of the box in which each of the items is packed is obtained.
[0013] Preferably, the method of establishing a calculation model for two-dimensional vector packing with a time window constraint, taking the first information and the second information as input information of the calculation model, solving the calculation model, and obtaining the minimum number of boxes used, includes: solving the first model and the second model through a hybrid branch pricing and cutting algorithm to obtain the minimum number of boxes used.
[0014] Preferably, solving the calculation model to obtain the minimum number of boxes used includes: solving the second model through a cooperative framework of an exact algorithm and a heuristic algorithm to obtain collection information of data in the second model, the collection information including information of all test numbers; extracting packing methods with negative test numbers from the collection information, the packing method being any method in which the items can be packed into the box and satisfy preset constraints; extracting the packing methods with negative test numbers into the first model for iterative calculation to obtain an iterative calculation result, the iterative calculation result including whether the test number is negative or positive; judging the iterative calculation result, if the test number of the iterative calculation result is negative, re-executing the iterative calculation; if the test number of the iterative calculation result is positive, passing and obtaining the minimum number of boxes used.
[0015] Preferably, the method of establishing a computational model for two-dimensional vector packing with a time window constraint, taking the first information and the second information as input information of the computational model, solving the computational model, and obtaining the minimum number of boxes used, includes: initializing the first model to obtain a restricted first model; inputting a preset valid inequality into the restricted first model, solving the restricted first model, and obtaining the dual variable; taking the dual variable as input information of the second model, and solving the second model; solving the second model through the cooperation framework of the exact algorithm and the heuristic algorithm, and obtaining the minimum number of boxes used.
[0016] Preferably, the second model is solved by the precise algorithm and the heuristic algorithm cooperation framework to obtain the collection information of the data in the second model, and the collection information includes the information of all the test numbers, including: the second model is solved by the heuristic algorithm to obtain the first calculation result, and the first calculation result includes whether the test number is negative or positive;
[0017] Determine the first calculation result of the test number, if the first calculation result of the test number is negative, extract all the information of the test number into the first model, and re-execute the iterative calculation.
[0018] If the first calculation result of the test number is positive, the precise algorithm is called to recalculate the second model to obtain a second calculation result, and the second calculation result includes whether the test number is negative or positive; the second calculation result of the test number is judged, and if the second calculation result of the test number is negative, the command of the heuristic algorithm to recalculate the second model is re-executed; all the information of the test number is extracted into the first model for calculation, and if the result of the test number is positive, the minimum value of the number of boxes used is obtained.
[0019] In a second aspect, the present invention further provides a device for packing articles, comprising a first acquisition module, a second acquisition module and a calculation and solution module, wherein:
[0020] A first acquisition module: used to acquire first information, wherein the first information includes weight information, volume information and time window information of each item in the item set, and the items are items to be loaded into the box;
[0021] A second acquisition module is used to acquire second information, where the second information includes volume information and maximum load-bearing weight information of a box, where the box is a box to be loaded with items;
[0022] Computational solution module: used to establish a computational model for two-dimensional vector packing with time window constraints, use the first information and the second information as input information of the computational model, solve the computational model, and obtain the minimum number of boxes used.
[0023] In a third aspect, the present invention further provides a device for packing articles, comprising:
[0024] Memory for storing computer programs;
[0025] A processor is configured to implement the steps of the time window-based binning method when executing the computer program.
[0026] In a fourth aspect, the present invention further provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned method of packing articles are implemented.
[0027] The beneficial effects of the present invention are:
[0028] The present invention constructs a two-dimensional vector packing model that takes into account the weight, volume and time window constraints of the items, designs a hybrid branch-price-cut algorithm, incorporates the heuristic method into the algorithm framework of branch-price-cut, and improves the efficiency of the algorithm while ensuring the optimality of the algorithm. Specifically, a heuristic algorithm is designed to solve the second model of the problem, which can significantly accelerate the generation of new columns and significantly reduce the solution time associated with the second model; and it extends the solution technology of the second model of the one-dimensional packing and vector packing problems after Dantzig-Wolfe decomposition; a hybrid branch-price-cut algorithm framework is designed, which integrates the collaborative framework of the exact algorithm and the heuristic algorithm, two effective inequalities and incompatible preprocessing algorithms, and can ensure the optimality of the algorithm at a relatively low computational cost.
[0029] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or be understood by practicing the embodiments of the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0031] Figure 1 This is a schematic flow chart of a method for packing articles according to an embodiment of the present invention;
[0032] Figure 2 It is a schematic structural diagram of a packing device for articles described in an embodiment of the present invention;
[0033] Figure 3 It is a schematic diagram of the structure of the packing equipment for articles described in an embodiment of the present invention.
[0034] 1. First acquisition module; 2. Second acquisition module; 3. Calculation and solution module; 300. First processing unit; 301. First decomposition unit; 302. First solution unit; 303. Second solution unit; 304. Third solution unit; 305. Fourth solution unit; 306. First acquisition unit; 307. First extraction unit; 309. First judgment unit; 310. Second acquisition unit; 311. Fifth solution unit; 312. Sixth solution unit; 313. Seventh solution unit; 314. Eighth solution unit; 315. Second extraction unit; 316. Second judgment unit; 317. First calling unit; 318. Third judgment unit; 801. Processor; 802. Memory; 803. Multimedia component; 804. Input / output (I / O) interface; 805. Communication component. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0036] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0037] Embodiment 1:
[0038] The two-dimensional vector packing problem with time window constraints is a complex combinatorial optimization problem that takes into account the weight, volume, and time window constraints of the items. Therefore, it is more challenging than the traditional one-dimensional packing problem that only considers the weight constraints of the items, and the vector packing problem that considers the weight and volume constraints of the items. Currently, there are almost no methods for solving the two-dimensional vector packing problem with time window constraints. The main methods for solving other packing problems are:
[0039] Heuristic algorithms include constructive heuristic algorithms, approximate algorithms, and meta-heuristic algorithms. Meta-heuristic algorithms include tabu search algorithms, neighborhood search algorithms, simulated annealing algorithms, etc.; and exact algorithms include enumeration algorithms, branch-and-bound algorithms, branch-and-price algorithms, and branch-and-price-cut algorithms, etc.
[0040] However, although the above methods can obtain the optimal solution, the solution efficiency is slow, especially for large-scale packing problems, and even cannot provide a feasible packing solution within an acceptable time range, which affects the instant delivery of logistics companies and is difficult to solve the two-dimensional vector packing problem with time constraints. The present invention constructs a two-dimensional vector packing model that takes into account the weight, volume and time window constraints of the items at the same time, and designs a hybrid branch pricing cutting algorithm to incorporate the heuristic method into the algorithm framework of branch pricing cutting. The algorithm can significantly accelerate the generation of new columns and significantly reduce the solution time associated with the second model. It expands the solution technology of the second model of the one-dimensional packing and vector packing problems after Dantzig-Wolfe decomposition, while ensuring the optimality of the algorithm and improving the efficiency of the algorithm.
[0041] This embodiment provides a method for packing articles.
[0042] See also Figure 1 , the figure shows that the method includes step S100, step S200 and step S300.
[0043] S100, obtaining first information, where the first information includes weight information, volume information, and time window information of each item in the item set, where the items are items to be packed into a box;
[0044] It can be understood that in this step, given a set of items I, each item i∈I has three attributes: weight w i 、Volume i and time window [e i ,l i ].
[0045] S200, obtaining second information, where the second information includes volume information and maximum load-bearing weight information of a box, where the box is a box for items to be loaded;
[0046] It is understandable that in this step, for the convenience of transportation and placement, logistics companies often choose the same type of boxes k∈K. Therefore, it is assumed that the boxes are of the same type and there is no quantity limit. The weight and volume of each item do not exceed the weight limit W and volume limit V of the box. As long as the time windows of any items have an intersection and the sum of their weights and volumes does not exceed the weight limit and volume limit of the box, they can be packed into the same box. For example, suppose there are three items, the weight, volume and time window of the items are as follows: w1=20,v1=10,t1=[2,4],w2=30,v2=20,t2=[1,6],w3=40,v3=30,t3=[7,9], and the weight and volume limits of the box are W=100,V=100. For the two-dimensional vector packing problem considering only weight and volume constraints, the best solution is to put the three items in one box. However, for the two-dimensional vector packing problem with time windows, this solution is not feasible because the time windows of the three items do not intersect. Therefore, the optimal solution is to pack items 1 and 2 into one box and item 3 into another box. It can be seen that the time window of the item has a significant impact on the solution.
[0047] S300, establishing a calculation model for two-dimensional vector packing with a time window constraint, using the first information and the second information as input information of the calculation model, solving the calculation model, and obtaining a minimum value of the number of boxes used.
[0048] It can be understood that in this step, an integer programming model for the two-dimensional vector packing problem that considers the weight, volume, and time window constraints of items is constructed as follows:
[0049] min z=∑ k∈K y k (1)
[0050]
[0051] In the formula, I represents a set of items, and each item i∈I has three attributes, w i Indicates the weight of the item, v i Indicates the volume of the item, [e i ,l i ] represents the item time window. K represents the box set, each box k∈K has the same type, t k represents the usage time of box k. W represents the weight limit of the box, and V represents the volume limit of the box. ik y is a 0-1 variable, indicating whether item i is loaded into box k. k A 0-1 variable indicating whether box k is used.
[0052] In the above model, objective function (1) represents minimizing the number of boxes used. Constraint (2) ensures that each item can only be packed into one box. Constraints (3) and (4) require that the total weight and volume of the items do not exceed the weight and volume limits of the box. Constraint (5) represents the time window limit. Constraints (6)-(7) define the decision variables.
[0053] The integer programming model contains a large number of variables and parameters, and the solution is very complicated. Therefore, the present invention uses the Dantzig-Wolfe decomposition method to reconstruct the integer programming model into a first model and a second model to reduce the amount of calculation. The first model contains formulas (1)-(2), and the second model contains formulas (3)-(7). The packing method is defined as a group of items that can be packed into a box without violating weight, volume and time window constraints.
[0054] The first model (Master Problem, MP) is described as follows:
[0055] min z=∑ p∈Ω λ p (8)
[0056]
[0057] In the formula, λ p is a 0-1 variable, indicating whether the packing method p, p∈Ω is used in the final solution. If so, it is 1, otherwise it is 0; Ω represents the set of packing methods; a ip is a 0-1 variable, indicating whether item i appears in the packing method p. If it appears, it is 1, otherwise it is 0. The objective function (8) represents minimizing the number of boxes used. Constraint (9) ensures that each item can only be packed into one box. Constraint (10) defines the decision variables. Since there are many feasible packing methods contained in Ω, it is still very difficult to solve the above first model. Therefore, we first construct the linear relaxation problem of the first model, obtain a partial feasible column set through the initial solution, and construct the restricted first model (Restricted Master Problem RMP), as follows:
[0058] min z=∑ p∈P λ p (11)
[0059]
[0060] In the formula, λ p is a 0-1 variable, indicating whether the packing method p, p∈P is used in the final solution. If so, it is 1, otherwise it is 0. P represents the set of partial packing methods. ipIt is a 0-1 variable, indicating whether item i appears in packing method p. If so, it is 1, otherwise it is 0.
[0061] Solving the restricted first model can obtain the dual variable. Bringing the dual variable value into the second model can re-price the second model. Then solve the second model, find the columns with negative test numbers, and add these columns to the restricted first model, and iterate continuously until no columns with negative test numbers are found. The second model is as follows:
[0062]
[0063] ∑ i∈I w i ε i ≤W, (15)
[0064] ∑ i∈I v i ε i ≤V, (16)
[0065]
[0066] Among them, I represents the set of items, and each item i∈I has three attributes, w i Indicates the weight of the item, v i Indicates the volume of the item, [e i ,l i ] represents the item time window. W represents the weight limit of the box, and V represents the volume limit of the box. π i represents the dual variable of constraint (12). i It is a 0-1 variable, indicating whether item i appears in the final solution. If it appears, it is 1, otherwise it is 0. M represents an infinite positive number.
[0067] Preferably, a calculation model for two-dimensional vector packing with a time window constraint is established, the first information and the second information are used as input information of the calculation model, and the calculation model is solved to obtain the minimum number of boxes used.
[0068] Preferably, the computational model is decomposed by the Dantzig-Wolfe decomposition method to obtain a decomposition result, which includes a first model and a second model; the first information and the second information are input into the first model, and the first model is solved to obtain a dual variable; the first information, the second information and the dual variable are input into the second model, and the second model is solved to obtain the minimum value of the number of boxes used.
[0069] It can be understood that the first model and the second model are solved by the hybrid branch pricing and cutting algorithm to obtain the minimum value of the number of boxes used. The hybrid branch pricing and cutting algorithm designed in the present invention follows the algorithm framework of traditional branch pricing, that is, the outer layer is branch and bound, and the inner layer is column generation. The specific process is described as follows:
[0070] Step 1: Initialize the search tree, set the global upper bound to positive infinity and the global lower bound to negative infinity;
[0071] Step 2: Select a node according to the node selection strategy and delete the node from the active node set;
[0072] Step 3: Node solution, if the current node is the root node, the global lower bound needs to be updated. If not, the linear relaxation solution of the node is recorded as the local lower bound;
[0073] Step 4: If the local lower bound is greater than the global upper bound, prune and go to step 6. Otherwise, further determine whether the solution is an integer solution. If it is an integer solution, update the global upper bound and prune the search tree according to the new upper bound. Otherwise, go to step 5;
[0074] Step 5: If the solution of the restricted first model is a fractional solution, it is necessary to branch through the branching strategy to obtain child nodes;
[0075] Step 6: If the search tree is not empty, go to step 2. If it is empty, or the global upper bound is equal to the global lower bound, the search process ends, and the optimal integer solution obtained is the optimal solution to the original problem.
[0076] It should be noted that Step 3 is solved according to the column generation algorithm, and the steps are as follows:
[0077] Step 3.1: Reconstruct it into the first model and the second model according to the Dantzig-Wolfe decomposition principle. The first model handles more complex constraints, and the second model handles simpler and independent constraints.
[0078] Step 3.2: Preprocessing of incompatible items. If the sum of the weights of two items is greater than the total weight of the box, or the sum of their volumes is greater than the total volume of the box, or the time windows do not intersect, then the two items are defined as incompatible items.
[0079] Step 3.3: Construct an initial solution, initialize the first model, and build a restricted first model.
[0080] Step 3.4: After adding valid inequalities to the restricted first model, the dual variable is obtained. Reprice the second model according to the value of the dual variable.
[0081] Step 3.5: Solve the second model using a collaborative framework of exact algorithm and heuristic algorithm.
[0082] In summary, the core of the hybrid branch pricing method lies in the solution strategy of the second model, namely Step 3.5.
[0083] The present invention designs an adaptive large-scale neighborhood search algorithm (ALNS) to solve the second model, quickly generate columns with negative test numbers, and then add the columns with negative test numbers to the restricted first model. When ALNS does not find a column with a negative test number, it calls the label-setting method for solving it. If a packing method with a negative test number is obtained, it is added to the restricted first model, otherwise, the iteration of column generation is terminated.
[0084] As mentioned above, the adaptive large-scale neighborhood search algorithm speeds up the solution of the second model, while the label expansion method ensures the optimality of the algorithm.
[0085] Specifically, the adaptive large-scale neighborhood search algorithm (ALNS) uses a combination of destruction operators and repair operators to continuously change the current solution. If the new solution is better than the current solution and the historical optimal solution, they are updated separately. At the same time, in each iteration, it is determined whether to accept the new solution according to the acceptance criteria. At the same time, after a certain number of iterations, the operator weights are updated.
[0086] In ALNS, the initial solution introduces a simple box packing strategy. Assuming there are enough boxes, each item is packed into a box, so the constraints can be easily satisfied.
[0087] There are three destruction operators:
[0088] (1) Random item removal operator: First, a box is randomly selected, and then an item is randomly removed from the box.
[0089] (2) Random box removal operator: First, a box is randomly selected, and then the box and all items in it are removed.
[0090] (3) Removal of the worst items with perturbation. The goal is to remove the items that increase the visual inspection value the most. The inspection number is negatively correlated with the dual variable value, so the dual variable value is multiplied by a random number in [0.8, 1] to perturb it, and then the item with the smallest dual variable value is selected and removed.
[0091] There are two repair operators:
[0092] (1) Greedy insertion operator. Randomly select a deleted item and insert it into the box if the test number after inserting it into the box is the smallest and negative without violating the constraints.
[0093] (2) Greedy insertion operator with perturbation. Similar to the greedy insertion operator, after the test number is increased by a perturbation factor [0.8, 1], if the test number of the selected item after being inserted into a box is the smallest and negative, then the item is inserted into the box.
[0094] The selection of operators depends on their previous performance, and a roulette wheel selection is performed based on the weights. The weights are used to measure the performance of operators and are updated after v iterations using the following formula (19).
[0095]
[0096] where ω′ i and ω i Respectively represent the weight of operator i before and after ν iterations. ξ i represents the score of operator i, ρ i represents the number of times operator i is used in v iterations. θ is a weight parameter with a value range of [0,1]. The initial score of all operators is 0. If an operator is selected and the global optimal solution is obtained, the score of the operator will increase by 20, if the operator is selected and the current optimal solution is obtained, the score of the operator will increase by 12, and if the operator is selected and leads to a deteriorated solution, the score of the operator will increase by 8. The probability of accepting a deteriorated solution is 0.2, and the coefficient θ is set to 0.95.
[0097] If ALNS cannot find a column with a negative test number, the exact label expansion method is used to solve it, and the column with a negative test number is added to the restricted first model for iteration. If the label expansion method cannot find a column with a negative test number, the column generation iteration is terminated.
[0098] Preferably, the second model is solved by a cooperative framework of an exact algorithm and a heuristic algorithm to obtain the collection information of the data in the second model, where the collection information includes information of all test numbers;
[0099] Extract the packing methods with negative test numbers from the set information. The packing methods are any way that any item can be packed into the box and meet the preset constraints.
[0100] Extracting the packing methods with negative test numbers into the first model for calculation until the second model cannot find the packing methods with negative test numbers;
[0101] The iterative calculation result is judged. If the check number of the iterative calculation result is negative, the iterative calculation is re-executed; if the check number of the iterative calculation result is positive, the minimum value of the number of boxes used is obtained.
[0102] It can be simply understood as follows: the precise algorithm uses the label expansion method, while the heuristic algorithm uses the adaptive large-scale neighborhood search algorithm (ALNS). In solving the packing problem, the prior art has not yet combined the two to solve it, but the present invention uses a combination of the two to solve it.
[0103] Preferably, the first model is initialized to obtain a restricted first model; a preset valid inequality is input into the restricted first model, the restricted first model is solved, and a dual variable is obtained;
[0104] The dual variable is used as the input information of the second model, and the second model is solved through the cooperation framework of the exact algorithm and the heuristic algorithm to obtain the collection information of the data in the second model, which includes the information of all the test numbers;
[0105] Extract the packing methods with negative test numbers from the set information. The packing methods are any way that any item can be packed into the box and meet the preset constraints.
[0106] Extracting the packing method with a negative test number into the first model for iterative calculation to obtain an iterative calculation result, wherein the iterative calculation result includes whether the test number is negative or positive;
[0107] The iterative calculation result is judged. If the iterative calculation result check number is negative, the iterative calculation is re-executed; if the iterative calculation result check number is positive, the minimum value of the number of boxes used is obtained.
[0108] Specifically, the second model is solved by a heuristic algorithm to obtain a first calculation result, wherein the first calculation result includes whether the test number is negative or positive;
[0109] Determine the first calculation result of the test number, if the first calculation result of the test number is negative, extract all the information of the test number into the first model, and re-execute the iterative calculation. If the first calculation result of the test number is positive, call the precise algorithm to recalculate the second model to obtain a second calculation result, the second calculation result includes whether the test number is negative or positive;
[0110] Determine the second calculation result of the check number. If the second calculation result of the check number is negative, re-execute the command of the heuristic algorithm to recalculate the second model; extract all the information of the check number into the first model for calculation. If the result of the check number is positive, obtain the minimum value of the number of boxes used.
[0111] In addition, it should be noted that the present invention uses preprocessing and two effective inequality acceleration strategies in Step 3.2 and Step 3.4 in the above steps respectively to improve the lower bound of the algorithm, reduce the search space, and improve the solution efficiency. The details are as follows:
[0112] Incompatible preprocessing strategy: The label expansion method is time-consuming because it will explore all possible nodes. In order to narrow the search space of label expansion, this paper proposes an incompatible preprocessing strategy, which aims to find incompatible items under the constraints of time window, weight and volume. For the sake of clarity, the following definitions are made:
[0113] Definition 1: If equation (20) is satisfied, then items i and j are incompatible in terms of weight.
[0114] w i +w j >W,i,j∈I. (20)
[0115] Definition 2: If equation (21) is satisfied, then items i and j are incompatible in terms of volume.
[0116] v i +v j >V,i,j∈I. (21)
[0117] Definition 3: If equation (22) is satisfied, then items i and j are incompatible in terms of time windows.
[0118] (e i -e j )(l i -e j )(l j -e i )>0,i,j∈I. (22)
[0119] In the formula, I represents a set of items, and each item i∈I has three attributes, w i Indicates the weight of the item, v i Indicates the volume of the item, [e i ,l i ] represents the item time window, W represents the weight limit of the box, and V represents the volume limit of the box.
[0120] The incompatible preprocessing strategy makes the label expand only in the feasible direction, reducing the exploration space of label expansion. Experimental tests show that the use of the incompatible preprocessing strategy before label expansion will effectively improve the computational efficiency of the label expansion method.
[0121] The subset-row inequalities can improve the performance of the algorithm by more pruning. The SR inequality is defined as follows:
[0122]
[0123] Where I is the set of items, S is the subset of items, and p∈P is the packing method.ip It is a 0-1 variable, indicating whether item i appears in the packing method p. If so, it is 1, otherwise it is 0. p is a 0-1 variable, indicating whether the packing method p, p∈Ω is used in the final solution. If so, it is 1, otherwise it is 0. In order to reduce the calculation time, only the valid inequalities of the three item subsets are concerned. Therefore, the SR inequality is rewritten as follows:
[0124]
[0125] in represents the subset of packing methods that contain at least two items in S. The SR inequality represented by equation (24) will be added to the restricted first model. Therefore, the second model is reconstructed as:
[0126]
[0127] Constraints (15)-(18)
[0128] In the formula, I represents the set of items, and S is a subset of items. s is the dual variable corresponding to equation (24). s is a 0-1 variable, if η s It is subtracted from the test number of the optimal solution, then it is 1, otherwise it is 0. ε i is a 0-1 variable, indicating whether item i appears in the final solution, 1 if it appears, otherwise 0; π i represents the dual variable of constraint (12).
[0129] In the label expansion method, if a label contains at least two items in the set S, then the test count of the label will be reduced by the value of the dual variable corresponding to the corresponding SR inequality. Since the value of the dual variable is negative, the test count of the label will increase, and the label can be easily ruled and deleted, thereby reducing the number of labels to be expanded. Therefore, adding the SR inequality can significantly reduce the search space of the label expansion method and improve the efficiency of column generation.
[0130] However, if too many SR inequalities are added to the restricted first model, the computation time will increase significantly. Therefore, a maximum of 50 inequalities are selected to be added to the restricted first model at the same time.
[0131] The rounded capacity inequality (RCI) can improve the performance of the algorithm by improving the lower bound. The goal of this problem is to minimize the number of boxes, which is an integer value. When the optimal solution of the restricted first model is a fraction, the smallest integer greater than the fraction is the lower bound of the problem. Therefore, RCI is described as follows:
[0132]
[0133] where γ is set at the root node At other nodes, it is set to the lower bound of its parent node. The second model is restructured as:
[0134]
[0135] Constraints (15)-(18)
[0136] Where τ is the dual variable corresponding to equation (27). i is a 0-1 variable, indicating whether item i appears in the final solution, 1 if it appears, otherwise 0; π i represents the dual variable of constraint (12). The rounding inequality can improve the lower bound of each node without significantly increasing the computational burden. In addition, the rounding inequality is updated in each iteration and can be improved dynamically. Therefore, it helps to speed up the generation of columns.
[0137] Embodiment 2:
[0138] like Figure 2 As shown, this embodiment provides a packaging device for articles, see Figure 2 The device comprises a first acquisition module 1, a second acquisition module 2 and a calculation and solution module 3, wherein the first acquisition module 1 is used to acquire first information, the first information comprising weight information, volume information and time window information of items in an item set, and the items are items to be loaded into a box;
[0139] The second acquisition module 2 is used to acquire second information, where the second information includes volume information and maximum load-bearing weight information of a box, where the box is a box to be loaded with items;
[0140] Computational solution module 3: used to establish a computational model for two-dimensional vector packing with a time window constraint, use the first information and the second information as input information of the computational model, solve the computational model, and obtain the minimum number of boxes used.
[0141] The calculation and solution module 3 further includes:
[0142] The first processing unit 300: establishes a calculation model for two-dimensional vector packing with a time window constraint, uses the first information and the second information as input information of the calculation model, and solves the calculation model to obtain a minimum value of the number of boxes used.
[0143] First decomposition unit 301: decomposes the calculation model by Dantzig-Wolfe decomposition method to obtain a decomposition result, where the decomposition result includes a first model and a second model;
[0144] The first solving unit 302: inputs the first information and the second information into the first model, and solves the first model to obtain dual variables;
[0145] The second solving unit 303: inputs the first information, the second information and the dual variable into the second model, solves the second model, and finally obtains the minimum value of the number of boxes used.
[0146] The third solving unit 304 solves the first model and the second model by using a hybrid branch pricing and cutting algorithm to obtain the minimum value of the number of boxes used.
[0147] Fourth solving unit 305: solving the second model by using an exact algorithm and a heuristic algorithm;
[0148] The first acquisition unit 306: obtains the set information of the data in the second model, the set information includes the information of all the test numbers;
[0149] The first extraction unit 307 extracts a packing method with a negative check number from the set information, where the packing method is any method in which an article can be packed into a box and satisfies a preset constraint.
[0150] The first judgment unit 309: judges the result of the iterative calculation. If the check number of the iterative calculation result is negative, extracts all the information of the check number into the first model and re-executes the iterative calculation; if the check number of the iterative calculation result is positive, solves the first model to obtain the minimum value of the number of boxes used.
[0151] The second acquisition unit 310: initializes the first model to obtain a restricted first model;
[0152] The fifth solving unit 311: inputs a preset valid inequality into the restricted first model, solves the restricted first model, and obtains a dual variable;
[0153] The sixth solving unit 312: uses the dual variable as input information of the second model to solve the second model;
[0154] The seventh solving unit 313 solves the second model by using an exact algorithm and a heuristic algorithm, and finally obtains the minimum value of the number of boxes used.
[0155] The eighth solving unit 314 solves the second model by using a heuristic algorithm to obtain the set information of the data in the second model, where the set information includes the information of all the test numbers;
[0156] The second judgment unit 316 judges the first calculation result of the test number, and if the first calculation result of the test number is negative, extracts all the information of the test number into the first model, and re-executes the iterative calculation;
[0157] First calling unit 317: if the first calculation result of the test number is positive, calling the precise algorithm to recalculate the second model to obtain a second calculation result, the second calculation result includes whether the test number is negative or positive;
[0158] The third judgment unit 318 judges the second calculation result of the test number. If the second calculation result of the test number is negative, the command of the heuristic algorithm to recalculate the second model is re-executed; if the result of the test number is positive, the minimum value of the number of boxes used is obtained.
[0159] The present invention adds the restriction of item time window, and proposes an integer programming model of two-dimensional vector packing with time window constraint (2DVPPTW) under the condition of comprehensive consideration of factors close to real logistics such as item weight, volume and time window constraint; and designs a heuristic algorithm to solve the second model, which can significantly accelerate the generation of new columns and significantly reduce the solution time associated with the second model, and expands the solution technology of the second model of one-dimensional packing and vector packing problems after Dantzig-Wolfe decomposition; at the same time, a hybrid branch pricing and cutting algorithm framework is designed, which integrates the collaborative framework of exact algorithm and heuristic algorithm, two valid inequalities and incompatible preprocessing strategies, etc., and can ensure the optimality of the algorithm at a relatively low computational cost.
[0160] In summary, the original problem model is decomposed into the first model and the second model through Dantzig-Wolfe decomposition. The restricted first model can be obtained by initializing the first model. The dual variables are obtained by solving the restricted first model. The dual variables are substituted into the second model. The second model is solved by the collaboration of the exact algorithm and the heuristic algorithm to obtain the column with negative test number. Then the column with negative test number is added to the restricted first model. The solution is iterated until no column with negative test number can be found, and the optimal solution is obtained.
[0161] It should be noted that, regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.
[0162] Embodiment 3:
[0163] Corresponding to the above method embodiment, this embodiment further provides a device for packing articles. The device for packing articles described below and the method for packing articles described above can refer to each other.
[0164] Figure 3 FIG. 8 is a block diagram of an article packing device 800 according to an exemplary embodiment. Figure 3As shown, the time window-based packaging device 800 may include: a processor 801 and a memory 802. The time window-based packaging device 800 may also include one or more of a multimedia component 803, an I / O interface 804, and a communication component 805.
[0165] The processor 801 is used to control the overall operation of the time window-based packaging device 800 to complete all or part of the steps in the time window-based packaging method. The memory 802 is used to store various types of data to support the operation of the time window-based packaging device 800, and these data may include, for example, instructions for any application or method operating on the time window-based packaging device 800, and application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk. The multimedia component 803 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 802 or sent via the communication component 805. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 804 provides an interface between the processor 801 and other interface modules, and the above-mentioned other interface modules can be keyboards, mice, buttons, etc. These buttons can be virtual buttons or physical buttons. The communication component 805 is used for wired or wireless communication between the time window-based packing device 800 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 805 can include: Wi-Fi module, Bluetooth module, NFC module.
[0166] In an exemplary embodiment, the time window-based packing device 800 can be implemented by one or more application specific integrated circuits (Application Specific Integrated Circuit, referred to as ASIC), digital signal processors (Digital Signal Processor, referred to as DSP), digital signal processing devices (Digital Signal Processing Device, referred to as DSPD), programmable logic devices (Programmable Logic Device, referred to as PLD), field programmable gate arrays (Field Programmable Gate Array, referred to as FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned time window-based packing method.
[0167] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned time-window-based packing method are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 802 including program instructions, and the above-mentioned program instructions can be executed by the processor 801 of the time-window-based packing device 800 to complete the above-mentioned time-window-based packing method.
[0168] Embodiment 4:
[0169] Corresponding to the above method embodiment, a readable storage medium is also provided in this embodiment. The readable storage medium described below and the article packing method described above can refer to each other.
[0170] A readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the time window-based box packing method of the above method embodiment are implemented.
[0171] The readable storage medium may specifically be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or other readable storage medium that can store program codes.
[0172] In summary, the present invention takes actual logistics applications as the background, studies the two-dimensional vector packing problem that simultaneously considers the weight, volume and time window constraints of items. First, an integer programming model of the two-dimensional vector packing problem with time window constraints is constructed, and then a hybrid branch-and-price-and-cut algorithm (H-BPC) is designed for the model. The algorithm uses the collaborative framework of adaptive large neighborhood search (ALNS) and label expansion method to solve the pricing sub-problem. In addition, SR inequality, rounding inequality and incompatible preprocessing strategy are integrated into the algorithm framework, which helps to improve the lower bound of the algorithm and significantly reduce the amount of calculation. At the same time, due to the properties of branch and bound and precise label expansion to fully search the solution space, the present invention can solve the optimal packing solution for the two-dimensional vector packing problem that simultaneously considers the weight, volume and time window constraints of items.
[0173] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for packing items. It is characterized in that include: Acquire first information, where the first information includes weight information, volume information, and time window information of each item in the item set, where the items are items to be packed into a box; Acquire second information, where the second information includes volume information and maximum load-bearing weight information of a box, where the box is a box for items to be loaded; Establishing a two-dimensional vector packing calculation model with a time window constraint, using the first information and the second information as input information of the calculation model, solving the calculation model, and obtaining a minimum value of the number of boxes used; The step of establishing a two-dimensional vector packing calculation model with a time window constraint, using the first information and the second information as input information of the calculation model, and solving the calculation model includes: Decomposing the calculation model by Dantzig-Wolfe decomposition method to obtain the decomposition result, wherein the decomposition result includes a first model and a second model; Among them, the first model is as follows: In the formula, λ p is a 0-1 variable, indicating whether the packing method p, p∈P is used. If so, it is 1, otherwise it is 0; P represents the set of partial packing methods; a ip is a 0-1 variable, indicating whether item i appears in packing method p, if yes, it is 1, otherwise, it is 0; Among them, the second model is as follows: In the formula, I represents the set of items, and each item i∈I has three attributes, w i Indicates the weight of the item, v i Indicates the volume of the item, [e i , l i ] represents the item time window; W represents the weight limit of the box, V represents the volume limit of the box; π i represents the dual variable of constraint (12); ε i is a 0-1 variable, indicating whether item i appears in the final solution. If it appears, it is 1, otherwise it is 0; M represents an infinite positive number; Inputting the first information and the second information into the first model, solving the first model to obtain dual variables; The first information, the second information and the dual variable are input into the second model, and the second model is solved to finally obtain the minimum value of the number of boxes used.
2. The method for packing articles according to claim 1, Features The step of establishing a two-dimensional vector packing computing model with a time window constraint, using the first information and the second information as input information of the computing model, and solving the computing model includes: A calculation model for two-dimensional vector packing with a time window constraint is established, the first information and the second information are used as input information of the calculation model, and the calculation model is solved to obtain a minimum value of the number of boxes used.
3. The method for packing articles according to claim 1, Features The step of establishing a two-dimensional vector packing calculation model with a time window constraint, using the first information and the second information as input information of the calculation model, solving the calculation model, and obtaining the minimum value of the number of boxes used includes: The first model and the second model are solved by a branch pricing and cutting algorithm to obtain a minimum value of the number of boxes used.
4. The method for packing articles according to claim 3, It is characterized in that Solving the calculation model to obtain the minimum value of the number of boxes used includes: Solving the second model through an algorithm cooperation framework of an exact algorithm and a heuristic algorithm to obtain set information of data in the second model, wherein the set information includes information of all test numbers; Extracting a packing method with a negative check number from the set information, wherein the packing method is any method in which the article can be packed into the box and satisfies a preset constraint; Extracting the packing mode in which the test number is negative into the first model for iterative calculation to obtain an iterative calculation result, wherein the iterative calculation result includes whether the test number is negative or positive; Determine the iterative calculation result, and if the iterative calculation result check number is negative, re-execute the iterative calculation; If the test number of the iterative calculation result is positive, the minimum value of the number of boxes used is obtained.
5. The method for packing articles according to claim 4, Features The calculation model for two-dimensional vector packing with time window constraints is established, the first information and the second information are used as input information of the calculation model, and the calculation model is solved to obtain the result of the box into which each of the items is packed, including: Initializing the first model to obtain a restricted first model; Inputting a preset valid inequality into the restricted first model, solving the restricted first model, and obtaining the dual variable; Using the dual variable as input information of the second model to solve the second model; Solving the second model by using the exact algorithm and the heuristic algorithm to obtain set information of data in the second model, wherein the set information includes information of all test numbers; The information of all the inspection numbers is extracted and put into the first model for calculation to obtain the minimum value of the number of boxes used.
6. The method for packing articles according to claim 4, Features , the second model is solved by the precise algorithm and the heuristic algorithm to obtain the set information of the data in the second model, the set information includes the information of all the test numbers, including: Solving the second model by the heuristic algorithm to obtain a first calculation result, wherein the first calculation result includes whether the test number is negative or positive; Determine the first calculation result of the test number, if the first calculation result of the test number is negative, extract all the information of the test number into the first model, and re-execute the iterative calculation; if the first calculation result of the test number is positive, call the precise algorithm to recalculate the second model to obtain a second calculation result, the second calculation result includes whether the test number is negative or positive; Determine the second calculation result of the check number. If the second calculation result of the check number is negative, re-execute the command of the heuristic algorithm to recalculate the second model; extract all the information of the check number into the first model for calculation. If the result of the check number is positive, obtain the minimum value of the number of boxes used.
7. A device for packing articles, It is characterized in that include: A first acquisition module: used to acquire first information, wherein the first information includes weight information, volume information and time window information of each item in the item set, and the items are items to be loaded into the box; A second acquisition module is used to acquire second information, where the second information includes volume information and maximum load-bearing weight information of a box, where the box is a box to be loaded with items; A calculation and solution module: used to establish a calculation model for two-dimensional vector packing with a time window constraint, use the first information and the second information as input information of the calculation model, solve the calculation model, and obtain the minimum value of the number of boxes used; The calculation and solution module also includes: The first decomposition unit: decomposes the computational model by using the Dantzig-Wolfe decomposition method to obtain a decomposition result, wherein the decomposition result includes a first model and a second model; A first solving unit: inputting the first information and the second information into the first model, solving the first model to obtain a dual variable; Among them, the first model is as follows: In the formula, λ p is a 0-1 variable, indicating whether the packing method p, p∈P is used. If so, it is 1, otherwise it is 0; P represents the set of partial packing methods; a ip is a 0-1 variable, indicating whether item i appears in packing method p, if yes, it is 1, otherwise, it is 0; Among them, the second model is as follows: In the formula, I represents the set of items, and each item i∈I has three attributes, w i Indicates the weight of the item, v i Indicates the volume of the item, [e i , l i ] represents the item time window; W represents the weight limit of the box, V represents the volume limit of the box; π i represents the dual variable of constraint (12); ε i is a 0-1 variable, indicating whether item i appears in the final solution. If it appears, it is 1, otherwise it is 0; M represents an infinite positive number; The second solving unit: inputs the first information, the second information and the dual variable into the second model, solves the second model, and finally obtains the minimum value of the number of boxes used.
8. A packing device for articles, It is characterized in that include: Memory for storing computer programs; A processor, configured to implement the steps of the method for packing articles as claimed in any one of claims 1 to 6 when executing the computer program.
9. A readable storage medium, Features: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for packing articles according to any one of claims 1 to 6 are implemented.
