Set cover problem accelerated solving method and device, electronic equipment and storage medium

By decomposing the set covering problem into a restricted master problem and simplified subproblems, and by using a deep learning prediction model to optimize edge selection, the problem of slow solution speed for large-scale set covering problems is solved, achieving an efficient solution process and high-quality solution generation.

CN114817848BActive Publication Date: 2026-01-30TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210501951.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-10
Publication Date
2026-01-30
Estimated Expiration
2042-05-10

AI Technical Summary

Technical Problem

Existing technologies are limited in speed when solving large-scale set covering problems. Integer programming methods consume a lot of computational resources, heuristic search solutions are of unstable quality, and column generation algorithms cannot guarantee the superiority of solutions while controlling the problem size.

Method used

The set covering problem is decomposed into a constrained main problem and complete subproblems. Edges with probabilities less than a preset threshold are removed by a column generation algorithm to construct a simplified underlying graph. A deep learning prediction model is used to predict the selection probability of edges, and the simplified subproblems are iteratively solved to generate high-quality feasible columns.

Benefits of technology

It significantly accelerates the computation speed of large-scale set covering problems, generates high-quality feasible sequences, shortens the solution time, and guarantees the optimality of the solution in some cases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114817848B_ABST
    Figure CN114817848B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, electronic device, and storage medium for accelerating the solution of set covering problems, belonging to the technical field of data processing. The method includes: decomposing the main problem of a graph-based set covering problem into a restricted main problem and complete subproblems according to a column generation algorithm; determining the probability of all edges in the underlying graph corresponding to the complete subproblems being selected in the final solution; removing edges with probabilities less than a preset threshold to obtain a simplified underlying graph and simplified subproblems corresponding to the simplified underlying graph; iteratively solving the restricted main problem and simplified subproblems; until there are no feasible columns in the simplified subproblems that can be added to the restricted main problem, taking the solution of the restricted main problem as the final relaxed solution of the main problem; and obtaining the final solution of the main problem based on the final relaxed solution. This application aims to accelerate the computational speed when solving large-scale set covering problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and more specifically, to a method, apparatus, electronic device, and storage medium for accelerating the solution of set coverage problems. Background Technology

[0002] The Set Covering Problem (SCP) is a classic combinatorial mathematics problem. Many important decision-making problems in industrial production can be reduced to and modeled as set covering problems, such as production equipment allocation, production planning, staff scheduling, and vehicle routing. Whether these important production decision-making problems can be solved quickly and efficiently has a significant impact on production efficiency.

[0003] The set covering problem can be described mathematically as follows: Given the complete set... and a set gather It contains n subsets, set any subset s j j = 1, 2, ..., n, all of which are the universal set. The set of n subsets, and the union of these n subsets equals the universal set. The goal of the set covering problem is to find sets... A subset Under the guarantee The union of the smaller sets contained within the set is equal to the universal set. Under the premise that The cost is the lowest.

[0004] For example, consider the set coverage problem in the context of logistics and distribution. The logistics company's decision objective is to establish a series of feasible delivery stations such that all target settlements are covered, and the total cost of configuring the delivery stations is minimized. Here, all target settlements constitute the complete set. The residential areas covered by each feasible delivery station j constitute a small set s. j The delivery station configuration with the lowest cost, while ensuring that it covers all target residential areas, is selected.

[0005] Currently, methods for solving set covering problems include integer programming, heuristic search, and column generation algorithms. Integer programming, as a naive and complete algorithm, often consumes a significant amount of time and computational resources, making it only suitable for small-scale set covering problems. Heuristic search typically involves a trade-off between computation time and solution quality; shorter solution time means a smaller solution space, often leading to lower solution quality. Furthermore, the design and debugging of heuristic algorithms are very complex. Column generation algorithms, on the other hand, consider only a subset of candidate sets, treating the complete integer programming problem as the main problem and decomposing it into a constrained main problem and iterative solutions to subproblems. Column generation algorithms can control the problem size while ensuring the superiority of the solution.

[0006] However, the above methods still have limitations in solving large-scale set covering problems. Therefore, how to further accelerate the solution speed of set covering problems is an urgent problem to be solved. Summary of the Invention

[0007] This application provides a method, apparatus, electronic device, and storage medium for accelerating the solution of set covering problems, aiming to speed up the computation when solving large-scale set covering problems.

[0008] In a first aspect, embodiments of this application provide a graph-based method for accelerating the solution of set covering problems, the method comprising:

[0009] Based on the column generation algorithm, the main problem of the graph-based set covering problem is decomposed into a restricted main problem and complete subproblems;

[0010] Determine the probability that all edges in the underlying graph corresponding to the complete subproblem are selected in the final solution;

[0011] Edges with probabilities less than a preset threshold are removed to obtain a simplified bottom-level graph and the corresponding simplified sub-problems.

[0012] The constrained main problem and the simplified subproblems are solved iteratively.

[0013] The solution to the restricted main problem is taken as the final relaxed solution of the main problem when there are no more feasible columns that can be added to the restricted main problem from the simplified subproblems.

[0014] The final solution to the main problem is obtained from the final relaxed solution of the main problem.

[0015] Optionally, the method further includes: until no feasible columns can be added to the restricted main problem from the simplified subproblems.

[0016] Replace the simplified subproblem with the complete subproblem, and continue to iteratively solve the constrained main problem and the complete subproblem;

[0017] The solution to the restricted main problem is taken as the optimal final relaxed solution of the main problem when there are no more feasible columns that can be added to the restricted main problem from the complete subproblem.

[0018] The optimal final solution to the main problem is obtained based on the optimal final relaxed solution to the main problem.

[0019] Optionally, during the iterative solution of the constrained main problem and the complete subproblems:

[0020] The complete subproblem no longer generates feasible columns that have been added from the simplified subproblem to the restricted main problem.

[0021] Optionally, determining the probability that all edges in the underlying graph corresponding to the complete subproblem are selected in the final solution includes:

[0022] Input the underlying graph corresponding to the complete sub-problem into the pre-trained deep learning prediction model;

[0023] The deep learning prediction model outputs the probability of each edge in the underlying graph corresponding to the complete subproblem being selected in the final solution.

[0024] The deep learning prediction model is trained using the underlying graph samples of complete sub-problem samples and the final solution of the main problem corresponding to the complete sub-problem samples as training labels.

[0025] Optionally, the deep learning prediction model is trained according to the following steps:

[0026] Obtain the underlying graph samples of the complete sub-problem samples and the final solution of the main problem corresponding to the complete sub-problem samples as training labels;

[0027] Construct a pre-defined model based on a graph neural network;

[0028] The bottom graph sample of the complete sub-problem sample is input into the preset model, and the preset model outputs the probability prediction value corresponding to each edge in the bottom graph sample of the complete sub-problem sample.

[0029] The cross-entropy loss function value is calculated based on the probability prediction values ​​corresponding to all edges in the underlying graph sample and the training labels of the final solution of the main problem corresponding to the complete sub-problem sample.

[0030] The preset model is trained by gradient descent, and the model parameters of the preset model are updated. The preset model corresponding to the minimum loss function value is taken as the trained deep learning prediction model.

[0031] Optionally, the preset model based on graph neural networks includes:

[0032] The input module preprocesses the nodes and edges in the underlying graph sample to obtain node codes and edge codes;

[0033] The graph convolution module, based on the preprocessed node and edge codes, obtains a deep representation of the connection structure and information in the underlying graph samples. The graph convolution module uses a residual layer with additional edge features as a message passing layer and adopts a skip connection-aggregation structure for edge encoding.

[0034] The prediction module determines the predicted probability value of each edge in the underlying graph sample being selected in the final solution.

[0035] Secondly, embodiments of this application provide an accelerated solution apparatus for graph-based set covering problems, the apparatus comprising:

[0036] The decomposition module is used to decompose the main problem of the graph-based set covering problem into a restricted main problem and complete subproblems based on the column generation algorithm.

[0037] The probability determination module is used to determine the probability that all edges in the underlying graph corresponding to the complete subproblem are selected in the final solution.

[0038] A simplification module is used to remove edges with probabilities less than a preset threshold to obtain a simplified bottom-level graph and a simplified sub-problem corresponding to the simplified bottom-level graph.

[0039] An iterative solution module is used to iteratively solve the constrained main problem and the simplified subproblems; until there are no feasible columns that can be added to the constrained main problem from the simplified subproblems, the solution of the constrained main problem is taken as the final relaxed solution of the main problem;

[0040] The final solution determination module is used to obtain the final solution of the main problem based on the final relaxed solution of the main problem.

[0041] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the graph-based accelerated solution method for set coverage problems described in the first aspect of the embodiments.

[0042] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the graph-based accelerated solution method for set covering problems described in the first aspect of the embodiments.

[0043] Beneficial effects:

[0044] According to the column generation algorithm, the main problem of the graph-based set covering problem is decomposed into a restricted main problem and complete subproblems; the probability of all edges in the underlying graph corresponding to the complete subproblems being selected in the final solution is determined; edges with probabilities less than a preset threshold are removed to obtain a simplified underlying graph and simplified subproblems corresponding to the simplified underlying graph; the restricted main problem and the simplified subproblems are iteratively solved; when there are no feasible columns in the simplified subproblems that can be added to the restricted main problem, the solution of the restricted main problem is taken as the final relaxed solution of the main problem; the final solution of the main problem is obtained based on the final relaxed solution of the main problem.

[0045] When using the column generation algorithm to solve the graph-based set covering problem, the main problem is decomposed into a restricted main problem and complete subproblems. Then, based on the probability that all edges in the underlying graph of the complete subproblems are selected in the final solution, edges with a probability less than a preset threshold are removed. The resulting simplified underlying graph contains only high-quality edges, meaning that the remaining edges have a higher probability of being selected in the final solution.

[0046] Simplified subproblems are constructed based on a simplified underlying graph. The simplified subproblems are much smaller in size than the full subproblems. Solving the simplified subproblems is much faster than solving the full subproblems. Furthermore, since the simplified subproblems still contain edges that are more likely to be selected by the final solution, they can still generate high-quality feasible sequences for the constrained main problem while improving speed.

[0047] Therefore, reducing the size of the complete subproblem to a simplified subproblem, and then iteratively solving the simplified subproblem and the constrained main problem, can speed up the computation when solving large-scale set covering problems. Attached Figure Description

[0048] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0049] Figure 1This is a flowchart illustrating the steps of the graph-based method for accelerating the solution of set covering problems proposed in this application.

[0050] Figure 2 This is a flowchart illustrating the steps of the graph-based method for accelerating the solution of set covering problems proposed in this application.

[0051] Figure 3 This is a flowchart of the steps of the deep learning prediction model training method proposed in the embodiments of this application;

[0052] Figure 4 These are schematic diagrams of different underlying diagrams proposed in the embodiments of this application;

[0053] Figure 5 This is a functional block diagram of the graph-based set coverage problem acceleration solution device proposed in the embodiments of this application. Detailed Implementation

[0054] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0055] Reference Figure 1 The diagram illustrates a flowchart of a graph-based method for accelerating the solution of a set covering problem according to an embodiment of the present invention. The method specifically includes the following steps:

[0056] S101: Based on the column generation algorithm, the main problem of the graph-based set covering problem is decomposed into a restricted main problem and complete subproblems.

[0057] Following the steps of the column generation algorithm for solving the set covering problem, the main problem of the graph-based set covering problem is decomposed into a restricted main problem and complete subproblems. The restricted main problem only considers a small portion of the variables in the main problem. Therefore, the restricted main problem is smaller in scale and has fewer variables than the main problem, which can reduce the consumption of computing resources. The subproblems are used to generate potential feasible variables for the restricted main problem. Feasible variables are equivalent to feasible columns.

[0058] When using column generation algorithms to solve the graph-based set cover problem, the subproblems are modeled as shortest path problems with resource constraints. The underlying graph corresponding to the subproblems includes multiple nodes and multiple edges, and the nodes in the underlying graph represent the complete set of the set cover problem. The elements in the graph represent the feasible columns of the subproblems, which are mapped onto the underlying graph of the subproblems. These are the feasible paths in the underlying graph. Any feasible path contains a sequence of nodes and edges connecting the nodes in the sequence.

[0059] S102: Determine the probability that all edges in the underlying graph corresponding to the complete subproblem are selected in the final solution.

[0060] Since only a small portion of the large number of columns in the main problem will be selected as the final solution during the solution process, and these are called the effective columns, in other words, most of the edges in the underlying graph of the subproblem will not be selected in the final solution. Therefore, each edge in the underlying graph corresponding to the complete subproblem has a probability of being included in the effective columns or being selected in the final solution.

[0061] In one feasible implementation, when predicting the probability of each edge being selected in the final solution, the underlying graph corresponding to the complete subproblem can be input into a pre-trained deep learning prediction model; the deep learning prediction model outputs the predicted probability values ​​of each edge in the underlying graph corresponding to the complete subproblem being included in the valid columns of the final solution.

[0062] The deep learning prediction model is trained using the underlying graph samples of complete sub-problem samples and the final solution of the main problem corresponding to the complete sub-problem samples as the training label.

[0063] S103: Remove edges with probabilities less than a preset threshold to obtain a simplified bottom-level graph and a simplified sub-problem corresponding to the simplified bottom-level graph.

[0064] After obtaining the probability of each edge being selected in the final solution in the underlying graph of the complete subproblem, edges with probabilities less than a preset threshold are removed, and edges with probabilities greater than the preset threshold are retained. The preset threshold can be set according to the actual situation, for example, the preset threshold can be 0.5.

[0065] By removing low-quality edges from the underlying graph of the complete subproblem, the resulting simplified underlying graph contains high-quality edges that are more likely to be selected by the final solution of the main problem. Based on the simplified underlying graph, a simplified subproblem is constructed, and the variables in the simplified subproblem are smaller in scale than those in the complete subproblem.

[0066] S104: Iteratively solve the restricted main problem and the simplified subproblems.

[0067] The constrained principal problem provides dual variables for the simplified subproblems. Based on the information from the dual variables, the simplified subproblems generate feasible sequences for the constrained principal problem and add them to the constrained principal problem. By iteratively solving the constrained principal problem and the simplified subproblems in this way, the solution to the constrained principal problem can be continuously optimized.

[0068] Since the size of the simplified subproblem is reduced, the speed of solving the simplified subproblem is significantly faster than that of solving the complete subproblem when the information of the dual variable is insufficient in the early stage. Iteratively solving the simplified subproblem and the restricted master problem can quickly generate feasible columns to be added to the restricted master problem. Furthermore, the simplified subproblem retains high-quality edges, so high-quality feasible columns can still be generated based on the simplified subproblem.

[0069] Furthermore, iteratively solving simplified subproblems and constrained main problems can quickly generate high-quality feasible columns to be added to the constrained main problem, thereby accelerating the computational speed when solving large-scale set covering problems.

[0070] For example, when iteratively solving a constrained main problem and simplified subproblems, Gurob i can be used as the linear programming solver for the constrained main problem. The simplified subproblems can be modeled as shortest path problems with resource constraints and solved using dynamic programming methods, such as the labeling method, which is the most commonly used dynamic programming method for solving shortest path problems with resource constraints.

[0071] S105: When there are no feasible columns that can be added to the restricted main problem from the simplified subproblems, the solution to the restricted main problem is taken as the final relaxed solution to the main problem.

[0072] In the iterative solution process between the simplified subproblem and the constrained primal problem, the simplified subproblem generates a feasible sequence of possibilities with a test number less than zero for the constrained primal problem, i.e., the test number... When all potential feasible sequences in the simplified subproblem satisfy the test number When the representation can no longer generate feasible sequences from the simplified subproblems to improve the solution of the restricted master problem, the iteration of the restricted master problem and the simplified subproblems is immediately terminated, and the solution of the current restricted master problem is taken as the final relaxed solution of the master problem.

[0073] S106: Based on the final relaxed solution of the main problem, the final solution of the main problem is obtained.

[0074] The final relaxed solution to the main problem may not satisfy the integer constraint. Therefore, an integer constraint processing framework is needed to process the final relaxed solution as the final solution to the main problem.

[0075] By removing edges from the underlying graph of the complete subproblem that have a probability of being selected as the final solution that is less than a preset threshold, a simplified underlying graph containing high-quality edges is obtained. The size of the simplified subproblem constructed based on the simplified underlying graph is much smaller than that of the complete subproblem. Iterative solutions are performed based on the simplified subproblem and the constrained main problem. The simplified subproblem can quickly generate high-quality feasible sequences for the constrained main problem, thereby accelerating the computational speed when solving large-scale set covering problems.

[0076] It is worth noting that the accelerated solution method provided in this embodiment can not only be applied to the solution of graph-based set covering problems, but also to the solution of non-graph-based set covering problems using column generation algorithms, depending on actual needs.

[0077] This process of quickly generating high-quality feasible sequences for a constrained main problem based on simplified subproblems and obtaining the final solution to the main problem is the "fast mode" of the accelerated solution method provided in this embodiment. However, since some edges are removed from the simplified underlying graph, the feasible sequences generated based on the simplified subproblems are not complete enough, which makes it impossible to guarantee the optimality of the final solution to the main problem and cannot meet the requirements of some applications with high accuracy requirements. Therefore, in a feasible implementation, this embodiment also provides an "optimal mode" of the accelerated solution method.

[0078] Reference Figure 2 The diagram illustrates a flowchart of a graph-based method for accelerating the solution of set covering problems, according to an embodiment of this application. The method includes steps S101-S104. Specifically, the method further includes the following steps:

[0079] S107: When there are no feasible columns that can be added to the restricted main problem from the simplified subproblem, replace the simplified subproblem with the complete subproblem, and continue to iteratively solve the restricted main problem and the complete subproblem.

[0080] There are no feasible columns that can be added to the restricted main problem from the simplified subproblem; that is, all potential feasible columns in the simplified subproblem satisfy the test number. In this case, the complete subproblem replaces the simplified subproblem, allowing the constrained main problem to continue iteratively solving with the complete subproblem. The solution to the constrained main problem already contains feasible sequences generated from the simplified subproblems. Therefore, during the process of generating feasible sequences for the constrained main problem with complete subproblems, feasible sequences already added to the constrained main problem from the simplified subproblems are no longer repeatedly added to the constrained main problem from the complete subproblems, or the complete subproblems no longer generate feasible sequences already added to the constrained main problem from the simplified subproblems. This can accelerate the solution process of the complete subproblems, so that in the "optimal mode" of the accelerated solution method provided in this embodiment, the speed of solving the set coverage problem can still be accelerated.

[0081] S108: Until there are no feasible columns that can be added to the restricted main problem from the complete subproblem, the solution to the restricted main problem is taken as the optimal final relaxed solution to the main problem.

[0082] When all potential feasible sequences in the complete subproblem satisfy the test number When the representation can no longer generate feasible sequences from the complete subproblems to improve the completeness of the solution to the restricted master problem, the iteration of the restricted master problem and the complete subproblems is terminated immediately, and the solution of the restricted master problem at this time is taken as the optimal final relaxed solution of the master problem.

[0083] Since the simplified subproblems have already quickly added high-quality feasible columns to the constrained main problem, the complete subproblems no longer need to generate the added feasible columns repeatedly, which greatly shortens the solution speed of the complete subproblems. The complete subproblems only need to supplement the constrained main problem with other feasible columns to improve the completeness of the final solution of the main problem. Therefore, even in the "optimal mode" of the accelerated solution method in this embodiment, where both the simplified and complete subproblems need to be iteratively solved with the constrained main problem, the overall solution speed is still significantly accelerated.

[0084] S109: Based on the optimal final relaxed solution of the main problem, the optimal final solution of the main problem is obtained.

[0085] Referring to step S106, after obtaining the optimal final relaxed solution of the main problem, the optimal final relaxed solution is processed into the optimal final solution of the main problem through an integer constraint processing framework.

[0086] In actual implementation, you can choose "fast mode" or "optimal mode" to solve the problem according to the actual needs. For example, in response to the user's mode selection operation, you can choose to execute steps S105-S106 or steps S107-S109.

[0087] According to the description in S102, the probability prediction value of each edge being selected as the final solution can be predicted by a pre-trained deep learning prediction model. This embodiment also provides a training method for the deep learning prediction model.

[0088] Reference Figure 3 The flowchart illustrates the steps of the deep learning prediction model training method provided in this application embodiment, specifically including the following steps:

[0089] A1: Obtain the underlying graph sample of the complete sub-problem sample and the final solution of the main problem corresponding to the complete sub-problem sample as training labels.

[0090] During training, a large number of different complete sub-problem samples can be obtained, and the final solution of the main problem of each complete sub-problem sample can be used as the training label of the underlying graph sample to construct a training sample set.

[0091] The complete underlying graph sample corresponding to the complete subproblem sample is denoted as G = (V, E), where V is the set of all nodes in the underlying graph sample, which is equivalent to the set covering the entire set of the problem, and E is the set of all edges in the underlying graph sample.

[0092] The columns selected in the final solution to the set-covered problem are called valid columns. Valid columns map to valid paths in the underlying graph. All edges contained in a valid path are considered valid edges. On the underlying graph sample G = (V, E), a set is defined. It is the set of all valid edges. In other words, the set of all edges in the final solution of the main problem corresponding to the training label of each complete bottom graph sample, that is, the complete sub-problem sample, is the set of valid edges E′.

[0093] A2: Construct a pre-defined model based on a graph neural network.

[0094] The default model based on graph neural networks is a deep learning model that operates on graph structures. Graph neural networks capture the dependency information between structures on the graph by passing information between nodes and edges. Graph neural networks can naturally extract features from graph structures.

[0095] In one implementation, the preset model may include an input module, a graph convolution module, and a prediction module.

[0096] In the input module, all nodes and edges in the underlying graph sample G = (V, E) correspond to an input feature vector. The input module preprocesses all node features and edge features. The preprocessing process includes: standardizing the numerical range of all dimensions of node features and edge features to [0, 1], and then mapping the standardized node features and edge features to a high-dimensional coding space through linear mapping and batch normalization operations to obtain node codes and edge codes.

[0097] In the graph convolution module, based on the preprocessed node and edge codes, a deep representation of the connection structure and information in the underlying graph samples is obtained. The graph convolution module includes l conυ The message passing layer can be a residual layer with added edge features, such as a residual gated graph convolutional layer (residual GatedGCN layer) as the message passing layer. The residual GatedGCN layer uses a dense attention mechanism η. ij It can realize anisotropic message passing between graph structures. The forward pass process of the graph convolution module is as follows:

[0098]

[0099]

[0100]

[0101]

[0102]

[0103] in, and The node and edge codes output by the l-th residual GatedGCN layer. as well as Here, x represents the learnable parameters of the l-th residual GatedGCN layer, ReLU represents the linear rectified activation function, ⊙ represents the Hadamard product, and x... i Representing nodes i and e ij This represents an edge pointing from node i to node j.

[0104] As can be seen, in this embodiment, the node encoding and edge encoding of the output of the previous residual GatedGCN layer are used as residual connections. Simultaneously, to enhance the insensitivity of the graph convolution module to different input graph sizes and module depths, a skip connection-aggregation structure is adopted for edge encoding in the graph convolution module. Element-wise max pooling aggregation is used at the output of the graph convolution module to select the most effective intermediate layer encoding for each dimension of the edge feature encoding. The graph convolution module outputs the final edge encoding.

[0105] The jump connection-aggregation structure reduces the difficulty of designing and debugging preset models for different types and scales of tasks, making the preset models more adaptable to different input types.

[0106] In the prediction module, based on the final edge encoding Calculate the predicted probability of each edge in the bottom-level graph sample being selected in the final solution, and the predicted probability p for each edge. ij ∈[0,1], corresponding edge codes After a l mlp The output of a multilayer perceptron with a Sigmoid activation function:

[0107]

[0108] A3: Input the bottom graph sample of the complete sub-problem sample into the preset model, and the preset model outputs the probability prediction value corresponding to each edge in the bottom graph sample of the complete sub-problem sample.

[0109] After the bottom-level graph samples of the complete sub-problem samples are input into the preset model, the graph convolution module outputs the final edge codes after preprocessing by the input module, and the prediction module outputs the probability prediction value of each edge based on the final edge codes.

[0110] A4: Calculate the cross-entropy loss function value based on the probability prediction values ​​corresponding to all edges in the underlying graph sample and the training labels of the final solution of the main problem corresponding to the complete sub-problem sample.

[0111] Predicting the probability that an edge in the bottom graph sample is selected by the final solution, i.e., predicting whether an edge in the edge set E of the bottom graph sample belongs to the valid edge set E′, can be regarded as performing edge classification on the graph structure. The bottom graph sample includes positive samples and negative samples. Positive samples are edges that belong to the valid edge set E′, and negative samples are edges that do not belong to the valid edge set E′. The training label valid edge set E′ can be regarded as the classification label.

[0112] After obtaining the probability prediction value for each edge in the bottom-level graph samples, the cross-entropy loss function value between the probability prediction value output by the preset model and the training labels is determined. Because the size of the bottom-level graph increases in the set covering problem, the number of positive and negative samples in the edge classification task becomes highly imbalanced. Simultaneously, only a small subset of columns are selected in the final solution of the main problem. Therefore, the number of edges not selected by the final solution in the bottom-level graph—i.e., negative samples—will far exceed the number of positive samples, thus increasing the difficulty of the classification task. Therefore, appropriate weights are added to the cross-entropy loss function to balance the imbalance between the number of positive and negative samples. Specifically, the loss function is as follows:

[0113]

[0114] In the formula, w n For the loss weights of negative samples, (1- n ) represents the loss weight for positive samples.

[0115] A5: Train the preset model using gradient descent and update the model parameters of the preset model. The preset model corresponding to the minimum loss function value is taken as the trained deep learning prediction model.

[0116] In the actual training process, the preset model is trained iteratively multiple times on the training sample set, and the model parameters of the prediction model are updated. For example, the batch size of the training process is 10, and the Adam optimizer with a learning rate of 3e-4 is used. The preset model with the smallest loss function value obtained in the preset number of iterations is used as the deep learning prediction model after training.

[0117] Reference Figure 4 This shows schematic diagrams of different underlying maps provided in embodiments of this application. Figure 4 In the diagram, (a) is the complete bottom-level graph sample corresponding to the complete sub-problem sample, (b) is the training label formed by the final solution of the main problem corresponding to the complete sub-problem sample, (c) is the probability prediction result output by the deep learning prediction model, where the change of the lines from dark to light is proportional to the probability of each edge, that is, the color of the line with the higher probability is darker; (d) is the simplified bottom-level graph obtained after simplifying the probability prediction result output by the deep learning prediction model.

[0118] like Figure 4 As shown, based on the probability prediction results obtained from the deep learning prediction model, the generated simplified underlying graph contains most of the edges in the final solution. Compared with the complete underlying graph, the simplified underlying graph has fewer edges, and the edges that are retained are all high-quality edges.

[0119] In one feasible implementation, the accelerated solution method provided in this embodiment is tested against the background of railway personnel scheduling problem, and a deep learning prediction model is used to predict probability values ​​during the test.

[0120] The railway personnel scheduling problem is a typical graph-based set covering problem. In the railway personnel scheduling problem, the complete set... It contains all the shift work tasks that need to be performed, and each feasible shift is a subset of the options. gather Represents the set of all feasible crew routes. A crew route refers to the sequence of shift tasks performed by a crew member within a certain period of time. The optimization objective of the corresponding set covering problem is: from Several crew routes were selected to ensure all crew duties were completed. Under the premise of coverage, the goal is to minimize the total cost of the selected crew routes. In simple terms, the decision is to determine how to schedule crew members to perform their duties at the lowest cost, assuming all crew tasks are executed.

[0121] The underlying diagram corresponding to the railway personnel scheduling problem has four types of nodes: starting node, ending node, empty return node, and duty node. The starting or ending node represents the crew base, which is used to indicate that the crew route starts or ends at the crew base. The empty return node represents the crew route ending at a station other than the crew base. The duty node represents the duty task.

[0122] There are four types of edges in the bottom graph: out-multiplication edges, back-multiplication edges, empty-return edges, and continuation edges. Out-multiplication edges are the edges from the starting node to the value-multiplication node, back-multiplication edges are the edges from the value-multiplication node to the ending node, empty-return edges are the edges from the value-multiplication node to the empty-return node, and continuation edges are the edges between value-multiplication nodes.

[0123] Each edge has two attributes: cost and resource. The cost of the departure edge and the connecting edge is 0, the cost of the return edge is 1, and the cost of the empty return edge is 1.5. The total cost of each service route is the sum of the costs of the edges traversed by the path. Therefore, the cost of different service routes is represented by the cost of the final return edge and the empty return edge.

[0124] The resource attribute of an edge is time. The resource consumption of each edge is the sum of the time consumption of the current edge and the adjacent node. The total resource consumption of each crew route is the sum of the resource consumption of the edges traversed by the path. The maximum working time constraint of a crew route is limited in the form of total resource consumption.

[0125] In the final test results, both the "fast mode" and "optimal mode" of the accelerated solution method provided in this embodiment performed excellently. In the "optimal mode," a solution with optimality guarantee was finally obtained, and the solution time consumed was only 63.12% of that of the baseline column generation algorithm. In the "fast mode," a suboptimal solution with only a 7.62% difference from the optimal solution was finally obtained, but it only consumed 2.91% of the computation time. Obviously, the graph-based accelerated solution method for set covering problems provided in this embodiment can significantly speed up the computation speed when solving large-scale set covering problems, and while speeding up the process, the quality of the obtained solution is close to that of the optimal solution.

[0126] Reference Figure 5 The diagram illustrates a functional block diagram of a graph-based accelerated solution device for set covering problems according to an embodiment of the present invention. The device includes:

[0127] The decomposition module 100 is used to decompose the main problem of the graph-based set covering problem into a restricted main problem and complete subproblems according to the column generation algorithm;

[0128] The probability determination module 200 is used to determine the probability that all edges in the underlying graph corresponding to the complete subproblem are selected in the final solution.

[0129] The simplification module 300 is used to remove edges with a probability less than a preset threshold to obtain a simplified bottom-level graph and a simplified sub-problem corresponding to the simplified bottom-level graph.

[0130] The iterative solution module 400 is used to iteratively solve the restricted main problem and the simplified subproblems; until there are no feasible columns that can be added to the restricted main problem from the simplified subproblems, the solution of the restricted main problem is taken as the final relaxed solution of the main problem;

[0131] The final solution determination module 500 is used to obtain the final solution of the main problem based on the final relaxed solution of the main problem.

[0132] Optionally, the device further includes:

[0133] The complete iterative solution module is used to replace the simplified subproblem with the complete subproblem and continue to iteratively solve the restricted main problem and the complete subproblem; until there are no feasible columns that can be added to the restricted main problem from the complete subproblem, the solution of the restricted main problem is taken as the optimal final relaxed solution of the main problem;

[0134] The optimal final solution determination module is used to obtain the optimal final solution of the main problem based on the optimal final relaxation solution of the main problem.

[0135] Optionally, the probability determination module includes:

[0136] The input unit is used to input the underlying graph corresponding to the complete sub-problem into the pre-trained deep learning prediction model;

[0137] The prediction unit is used by the deep learning prediction model to output the probability of each edge in the underlying graph corresponding to the complete subproblem being selected in the final solution; wherein, the deep learning prediction model is trained based on the underlying graph samples of the complete subproblem samples and the final solution of the main problem corresponding to the complete subproblem samples as training labels.

[0138] Optionally, the device further includes a training module, which specifically includes:

[0139] The sample acquisition unit is used to acquire the underlying graph samples of the complete sub-problem samples and the final solution of the main problem corresponding to the complete sub-problem samples as training labels;

[0140] Construction unit, used to construct a pre-defined model based on graph neural network;

[0141] The training prediction unit is used to input the bottom graph sample of the complete sub-problem sample into the preset model, and the preset model outputs the probability prediction value corresponding to each edge in the bottom graph sample of the complete sub-problem sample.

[0142] The loss calculation unit is used to calculate the cross-entropy loss function value based on the probability prediction values ​​corresponding to each edge in the underlying graph sample and the training labels of the final solution of the main problem corresponding to the complete sub-problem sample.

[0143] The model parameter update unit is used to train the preset model through gradient descent and update the model parameters of the preset model, and take the preset model corresponding to the minimum loss function value as the trained deep learning prediction model.

[0144] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the graph-based accelerated solution method for set coverage problems described in the embodiments.

[0145] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the graph-based accelerated solution method for set covering problems described in the embodiments.

[0146] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0147] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0148] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0149] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0150] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0151] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0152] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0153] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for accelerating the solution of set cover problems based on graphs, characterized in that, The method is used for scheduling of railway staff or establishing distribution sites; in the scenario of establishing distribution sites, the optimization target is to make all target resident sites be covered and the total cost of distribution site configuration be minimum, wherein all target resident sites are a universal set, and the resident sites covered by each feasible distribution site constitute a small set, and the distribution site configuration with minimum cost is selected, and it is ensured that the distribution site configuration can cover all target resident sites; in the scenario of scheduling of railway staff, the method comprises: Construct a graph-based set-covering problem corresponding to the railway personnel scheduling problem, where the complete set of the set-covering problem is... It contains all the value multiplication tasks that need to be performed, the set This represents the set of all feasible crew routes. A crew route refers to the sequence of duties performed by a crew member within a certain period of time. Each feasible crew route is a subset of the alternative routes. The optimization objective of the graph-based set covering problem corresponding to the railway personnel scheduling problem is: from the set Select several crew routes from the set, while ensuring the complete set Under the premise that all the duty tasks that need to be performed are covered, the total cost of the selected duty routes is minimized, so as to achieve the minimum cost of dispatching crew members to perform duty tasks; In the underlying graph corresponding to the scheduling problem of railway staff, four types of nodes and four types of edges are included, the four types of nodes are a start node, a terminal node, an empty return node and a value multiplication node, and the four types of edges include a boarding edge, an alighting edge, an empty return edge and a connection edge, the attributes of each edge include a cost and a resource, the cost of the boarding edge and the connection edge is 0, the cost of the alighting edge is 1, the cost of the empty return edge is 1.5, and the total cost of each crew cycle is the sum of the costs of the edges passed by the path; the resource attribute of the edge means time, the resource consumption of each edge is the sum of the time consumptions of the current edge and the connection node, the total resource consumption of each crew cycle is the sum of the resource consumptions of the edges passed by the path, and the maximum working time constraint of the crew cycle is limited in the form of the total resource consumption; the method has a "fast mode" and an "optimal mode", in the "optimal mode", a solution with optimal guarantee is obtained, and a first calculation time is consumed; in the "fast mode", a suboptimal solution is obtained, and a second calculation time is consumed, the second calculation time is less than the first calculation time; the method can accelerate the calculation speed when solving a large-scale set covering problem, and while the speed is accelerated, the quality of the obtained solution is close to the optimal solution; According to a column generation algorithm, a main problem of a graph-based set covering problem corresponding to the scheduling problem of railway staff is decomposed into a restricted main problem and a complete subproblem; Based on a pre-trained deep learning prediction model, probabilities that all edges in the underlying graph corresponding to the complete subproblem are selected in a final solution are determined, the deep learning prediction model is based on underlying graph samples of complete subproblem samples, and is trained based on final solutions of main problems corresponding to the complete subproblem samples as training labels; Edges with probabilities less than a preset threshold are removed to obtain a simplified underlying graph and a simplified subproblem corresponding to the simplified underlying graph; The restricted main problem and the simplified subproblem are iteratively solved; When there is no feasible column that can be added to the restricted main problem in the simplified subproblem, a solution of the restricted main problem is taken as a final relaxed solution of the main problem; According to the final relaxed solution of the main problem, a final solution of the main problem is obtained.

2. The method of claim 1, wherein, After there is no feasible column that can be added to the restricted main problem in the simplified subproblem, the method further comprises: The complete subproblem is replaced with the simplified subproblem, and the restricted main problem and the complete subproblem are iteratively solved. until there are no feasible columns in the complete subproblem that can be added to the restricted master problem, the solution of the restricted master problem is taken as the optimal final relaxed solution of the master problem; according to the optimal final relaxed solution of the master problem, an optimal final solution of the master problem is obtained.

3. The method of claim 2, wherein, in the process of continuing to iteratively solve the restricted master problem and the complete subproblem: the complete subproblem no longer generates feasible columns that have been added to the restricted master problem from the simplified subproblem.

4. The method according to any of claims 1 to 3, characterized in that, determining the probability that all edges in the underlying graph corresponding to the complete subproblem are selected in the final solution, including: inputting the underlying graph corresponding to the complete subproblem into a pre-trained deep learning prediction model; the deep learning prediction model outputs the probability that each edge in the underlying graph corresponding to the complete subproblem is selected in the final solution; wherein the deep learning prediction model is trained based on the underlying graph samples of the complete subproblem samples and the final solution of the master problem corresponding to the complete subproblem samples as training labels.

5. The method of claim 4, wherein, the deep learning prediction model is trained according to the following steps: obtain the underlying graph samples of the complete subproblem samples and the final solution of the master problem corresponding to the complete subproblem samples as training labels; construct a preset model based on a graph neural network; input the underlying graph samples of the complete subproblem samples into the preset model, and the preset model outputs the probability prediction value of each edge in the underlying graph samples of the complete subproblem samples; calculate the cross-entropy loss function value according to the probability prediction value of each edge in the underlying graph samples and the training label of the final solution of the master problem corresponding to the complete subproblem samples; train the preset model by gradient descent and update the model parameters of the preset model, and the preset model corresponding to the smallest loss function value obtained is taken as the trained deep learning prediction model.

6. The method of claim 5, wherein, the preset model based on the graph neural network includes: an input module for preprocessing nodes and edges in the underlying graph samples to obtain node encoding and edge encoding; a graph convolution module for obtaining deep representations of connection structures and information in the underlying graph samples based on the node encoding and edge encoding obtained by preprocessing, wherein the graph convolution module uses a residual layer with additional edge features as a message passing layer, and uses a skip connection-aggregation structure for edge encoding; a prediction module for determining the probability prediction value of each edge in the underlying graph samples in the final solution.

7. A device for accelerating the solution of a set cover problem based on a graph, characterized in that, the device includes: The module is used to construct railway personnel scheduling or establish delivery stations. In the scenario of establishing delivery stations, the optimization objective is to ensure that all target settlements are covered while minimizing the total configuration cost of delivery stations. Here, all target settlements constitute the entire set, and the settlements covered by each feasible delivery station form a smaller set. The delivery station configuration with the lowest cost is selected, ensuring that the configuration covers all target settlements. In the scenario of railway personnel scheduling, a graph-based set-covering problem is constructed, where the entire set of the railway personnel scheduling problem is defined. It contains all the value multiplication tasks that need to be performed, the set This represents the set of all feasible crew routes. A crew route refers to the sequence of duties performed by a crew member within a certain period of time. Each feasible crew route is a subset of the alternative routes. The optimization objective of the graph-based set covering problem corresponding to the railway personnel scheduling problem is: from the set Select several crew routes from the set, while ensuring the complete set Under the premise that all the duty tasks to be executed are covered, the total cost of the selected crew route is minimized, so as to achieve the minimum cost scheduling of crew members to perform duty tasks. The underlying graph corresponding to the railway personnel scheduling problem includes four types of nodes and four types of edges. The four types of nodes are start nodes, end nodes, empty return nodes, and duty nodes. The four types of edges include departure edges, return edges, empty return edges, and connecting edges. The start and end nodes represent crew bases, indicating that the crew route starts or ends at that crew base. The empty return node represents the end of the crew route at a station other than a crew base. The duty node represents the duty task. The departure edge is the edge from the start node to the duty node, the return edge is the edge from the duty node to the end node, the empty return edge is the edge from the duty node to the empty return node, and the connecting edge is the edge from the duty node to the empty return node. A continuation edge is an edge between multiple multiplication nodes. Each edge has a cost attribute: the cost of the outgoing edge and the continuation edge is 0, the cost of the returning edge is 1, and the cost of the empty return edge is 1.

5. The total cost of each passenger service route is the sum of the costs of the edges traversed by the path. The resource attribute of an edge is time. The resource consumption of each edge is the sum of the time consumption of the current edge and the continuation node. The total resource consumption of each passenger service route is the sum of the resource consumption of the edges traversed by the path. The maximum working time constraint of a passenger service route is limited in the form of total resource consumption. It has a "fast mode" and an "optimal mode". In the "optimal mode", a solution with optimality is obtained and the first computation time is consumed. In the "fast mode", a suboptimal solution is obtained and the second computation time is consumed. The second computation time is less than the first computation time. a decomposition module for decomposing the master problem of the graph-based set cover problem corresponding to the scheduling problem of railway personnel into a restricted master problem and a complete subproblem according to a column generation algorithm; a probability determination module for determining the probability that all edges in the underlying graph corresponding to the complete subproblem are selected in the final solution based on a pre-trained deep learning prediction model, wherein the deep learning prediction model is trained based on the underlying graph samples of the complete subproblem samples and the final solution of the master problem corresponding to the complete subproblem samples as training labels; A simplification module is configured to eliminate edges with probabilities less than a preset threshold to obtain a simplified bottom layer graph and a simplified sub-problem corresponding to the simplified bottom layer graph; An iteration solving module is configured to iteratively solve the restricted master problem and the simplified sub-problem; when there is no feasible column that can be added to the restricted master problem in the simplified sub-problem, the solution of the restricted master problem is taken as a final relaxation solution of the master problem; A final solution determining module is configured to obtain a final solution of the master problem according to the final relaxation solution of the master problem.

8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the graph-based set covering problem accelerated solving method in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer program is stored on the computer readable storage medium and is executed by the processor to implement the graph-based set covering problem accelerated solving method in any one of claims 1 to 6.