Artificial intelligence driven two-stage stochastic programming problem solving method and system
Through the two-stage stochastic planning method driven by artificial intelligence, we build mathematical models and graphic structures, and use hierarchical graph convolution networks and scene similarity graphs to solve the combinatorial optimization problem under imperfect information and realize efficient distribution and website construction and other practical applications. Solving the problem simplifies the computational complexity.
Patent Information
- Application Number
- CN202410996718.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-24
AI Technical Summary
Existing technologies are difficult to effectively solve combinatorial optimization problems under imperfect information. Especially in operations research, two-stage stochastic programming problems are difficult to solve in large-scale scenarios, and traditional scenario reduction methods cannot be truly applied to solve practical problems.
Adopting an artificial intelligence-driven two-stage stochastic programming problem-solving method, by building a mathematical model, a collection of delivery site construction scenarios is generated, converted into a graphic structure, and a hierarchical graph convolution network is used to extract key information and build a scene similarity graph and importance scoring model. , select representative scenarios, construct and solve deterministic equivalent problems, and finally use evaluation tools to optimize the solution.
In actual scenarios, the effectiveness of problem solving is ensured, the solving efficiency is improved, the computational complexity is simplified, and the key characteristics of the problem are retained. It is suitable for problems such as distribution station construction, taxi hailing, and power distribution station layout.
Smart Images

Figure CN118551940B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of artificial intelligence and discloses an artificial intelligence-driven two-stage stochastic programming problem solving method and system. Background Art
[0002] In recent years, artificial intelligence methods based on neural networks, deep learning, etc. have achieved success in tasks that are difficult to formalize, such as image analysis and natural language processing. In contrast, operations research methods provide effective solutions for areas such as planning and scheduling that are easy to formalize but difficult to solve. Based on the respective advantages of both, some works combining deep learning and operations research methods have achieved results that surpass existing algorithms in tasks such as traveling salesman, vehicle path planning, and load balancing. However, most research focuses on deterministic problems, and few works pay attention to another widely existing phenomenon-combinatorial optimization problems under imperfect information. The information of such problems will be gradually revealed in the decision-making process, and only when the problem is completely solved can the complete information be obtained. When solving, decisions need to be made based on only partial information, not only to maximize the expected benefits, but also to meet the known requirements. Similar incomplete information situations are common in actual scenarios such as capacity scheduling, route planning, and other tasks. In addition to the requirements for solutions, such tasks often have real-time requirements, requiring the model to respond in a short time.
[0003] In operations research, combinatorial optimization under imperfect information is often modeled as a two-stage stochastic programming problem. As the number of scenarios increases, the scale of the problem (i.e., the number of decision variables and the number of constraints) increases linearly, and it is extremely difficult to solve the expanded form. To address this challenge, scenario reduction technology is widely used, which uses the information of the problem itself to select a small number of the most representative scenarios. By using these scenarios, the calculation of large-scale problems is avoided. However, existing scenario reduction methods often focus on theoretical results, such as the theoretical guarantees of the methods on indicators such as approximation ratio, and cannot be truly applied to solving practical problems, such as distribution station construction problems. Summary of the invention
[0004] The purpose of the invention is to provide an artificial intelligence driven two-stage stochastic programming problem solving method and system to solve the above-mentioned problems existing in the prior art.
[0005] The technical solution provides an artificial intelligence-driven two-stage stochastic programming problem solving method, including the following steps:
[0006] Step S0, collecting distribution station construction data, and constructing a mathematical model of a two-stage stochastic programming problem; wherein the distribution station construction data includes deterministic parameters, random parameters, decision time points and decision variables; wherein the deterministic parameters include: the number of sites that can be constructed, the maximum number of sites that can be constructed, the transportation distance matrix from each site to the community, and the cargo capacity vector of each site; the random parameters include the customer demand vector of each community; the decision time points include the site construction decision time and the cargo distribution decision time;
[0007] Step S1, generating a set of delivery station construction scenarios based on a mathematical model, and in each delivery station construction scenario, converting the mathematical model into a graphical structure;
[0008] Step S2: Based on the graph structure, a layered graph convolutional network is constructed, key information of the delivery station construction scenario is extracted from the layered graph convolutional network, and a delivery station construction scenario similarity graph is constructed based on the key information;
[0009] Step S3: Based on the delivery station construction scenario similarity graph, a delivery station construction scenario importance scoring model is constructed to evaluate the importance of the delivery station construction scenario, and representative delivery station construction scenarios are selected and ranked;
[0010] Step S4: Based on the sorted representative delivery site construction scenarios, a deterministic equivalence problem is constructed, the deterministic equivalence problem is solved, a delivery site construction solution is obtained, and key decision information is extracted from the delivery site construction solution;
[0011] Step S5: Based on the key decision information, a distribution site construction solution evaluation tool is constructed, and the distribution site construction solution evaluation tool is used to evaluate the quality of the distribution site construction solution in the randomly generated distribution scenarios. Based on the evaluation results, the parameters of the distribution site construction scenario importance scoring model are updated.
[0012] According to another aspect of the present application, an artificial intelligence-driven two-stage stochastic programming problem solving system is also provided, comprising:
[0013] at least one processor; and,
[0014] a memory communicatively connected to at least one of the processors; wherein,
[0015] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the artificial intelligence driven two-stage stochastic programming problem solving method described in any of the above technical solutions.
[0016] Beneficial effects: For distribution station construction problems, taxi problems, distribution station layout problems, hydropower station layout problems, etc., compared with traditional methods that only focus on theoretical approximation ratios and other indicators, the present invention ensures its effectiveness in solving practical problems through the generation and evaluation of actual scenarios; improves the solution efficiency by simplifying the solution process of the original random planning problem; and retains the key features of the problem while reducing the computational complexity by selecting representative distribution station construction scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flow chart of the present invention.
[0018] Figure 2 This is a flow chart of step S1 of the present invention.
[0019] Figure 3 This is a flow chart of step S2 of the present invention.
[0020] Figure 4 This is a flow chart of step S3 of the present invention.
[0021] Figure 5 This is a flow chart of step S4 of the present invention.
[0022] Figure 6 This is a flow chart of step S5 of the present invention. DETAILED DESCRIPTION
[0023] Describe the technical solution and technical details in conjunction with a certain scenario.
[0024] A certain place can build logistics stations at 4 locations, and all the stations are responsible for the cargo distribution needs of the customers in this place. The following information is known during the setting: due to funding constraints, only two stations can be built at most, the transportation distance from the 4 locations to the community in this place can be understood as the transportation cost; the cargo capacity of the logistics station. However, the customer's needs are not clear and cannot be known through advance inquiries. Moreover, the customer's needs will change over time. For example, some communities may not have been fully occupied. When the customer's needs are known and in accordance with the known information, decisions must be made to minimize the total cost of construction and transportation (expected).
[0025] When modeling, at the strategic level: 4 locations correspond to 4 decisions, whether to set up a station at the i-th location; the constraints to be met are that at most 2 can be built. After the establishment and operation, the tactical level decision is faced, which station supplies how much goods to which community, and the constraints to be met include: customer needs are met; the total number of goods delivered by the station is less than or equal to its capacity, and at the same time, the transportation cost must be reduced as much as possible.
[0026] After abstracting the above problems into background problems, we solve them through artificial intelligence methods and provide the following solutions. For the sake of brevity, some delivery site construction scenarios are simplified to scenarios, and delivery site construction solutions are simplified to solutions or plans.
[0027] The characters are as follows: F represents the mathematical model of the two-stage stochastic programming problem; X, Y represent the decision variable sets of the first and second stages respectively; C represents the constraint set; f(X, Y) represents the objective function; δ = {ξ1, ξ2, ..., ξN} represents the scene set, N is the total number of scenes; G = (V, E) represents the bipartite graph representation of the problem; V = VX ∪ VY ∪ VC represents the node set of the graph, including decision variable nodes and constraint nodes; wij represents the edge weight, which represents the coefficient of the variable in the constraint; Φ(·) represents the nonlinear feature transformation function; H-GCN represents the hierarchical graph convolutional network; h(v) represents the node embedding; e(ξi) represents the scene embedding; Enc(·), Dec(·) represent the encoder and decoder functions; Z represents the latent space; I(·; ·) represents the mutual information; β represents the trade-off parameter in the information bottleneck method; z* represents the scene representation after information compression; GS represents the scene similarity graph; γ represents the kernel function parameter number; ∑ represents the covariance matrix; s(zi*) represents the scene importance score; k(·,·) represents the RBF kernel function; I represents the selected scene index set; K represents the number of selected scenes; C represents the cost matrix in the Sinkhorn algorithm; P represents the ranking matrix obtained by the Sinkhorn algorithm; P' represents the reduced deterministic equivalent problem; wi represents the scene weight; λ represents the dual information; V(X,ξ) represents the neural network approximator, which is used to estimate the second-stage value function; ε represents the optimal gap threshold; Ii represents the scene influence; ∧ represents all.
[0028] like Figure 1 As shown, this application proposes an artificial intelligence-driven two-stage stochastic programming problem solving method, comprising the following steps:
[0029] Step S0, collecting distribution station construction data, and constructing a mathematical model of a two-stage stochastic programming problem; wherein the distribution station construction data includes deterministic parameters, random parameters, decision time points and decision variables; wherein the deterministic parameters include: the number of sites that can be constructed, the maximum number of sites that can be constructed, the transportation distance matrix from each site to the community, and the cargo capacity vector of each site; the random parameters include the customer demand vector of each community; the decision time points include the site construction decision time and the cargo distribution decision time;
[0030] Step S1, generating a set of delivery station construction scenarios based on a mathematical model, and in each delivery station construction scenario, converting the mathematical model into a graphical structure;
[0031] Step S2: Based on the graph structure, a layered graph convolutional network is constructed, key information of the delivery station construction scenario is extracted from the layered graph convolutional network, and a scenario similarity graph is constructed based on the key information;
[0032] Step S3: Based on the delivery station construction scenario similarity graph, a delivery station construction scenario importance scoring model is constructed to evaluate the importance of the delivery station construction scenario, and representative delivery station construction scenarios are selected and ranked;
[0033] Step S4: Based on the sorted representative delivery site construction scenarios, a deterministic equivalence problem is constructed, the deterministic equivalence problem is solved, a delivery site construction solution is obtained, and key decision information is extracted from the delivery site construction solution;
[0034] Step S5: Based on the key decision information, a distribution site construction solution evaluation tool is constructed, and the distribution site construction solution evaluation tool is used to evaluate the quality of the distribution solution in the randomly generated distribution scenario. Based on the evaluation results, the parameters of the distribution site construction scenario importance scoring model are updated.
[0035] In this embodiment, by constructing a complete artificial intelligence-driven two-stage random programming problem solving method, efficient and accurate problem solving is achieved. First, by converting the real problem of distribution station construction into a mathematical model, the foundation is laid for subsequent processing. When generating a set of distribution station construction scenarios, the mathematical model is converted into a graph structure, and the problem can be processed by a graph neural network, thereby making full use of the characteristics of graph structure data. By constructing a layered graph convolutional network, the scheme can effectively extract key information from complex scenes. Compared with traditional feature extraction methods, this method can better capture the intrinsic relationship between scenes. The scene similarity graph is constructed based on the extracted key information, which further enhances the understanding of the relationship between scenes. The introduction of the scene importance scoring model can not only evaluate the importance of the scene, but also select representative scenes, which reduces the number of scenes to be processed and improves the computational efficiency. The sorting of representative distribution station construction scenes further optimizes the problem solving process. By constructing and solving a deterministic equivalent problem, the method can obtain high-quality solutions in a complex random environment. Finally, by constructing a solution evaluation tool and evaluating the quality of the solution in randomly generated scenes, the continuous optimization of the solution is achieved. By continuously updating the parameters of the scene importance scoring model, the method can adaptively improve its performance. This comprehensive approach can not only effectively handle the two-stage stochastic planning problem of distribution station establishment, but also has scalability and adaptability, and can be applied to various complex decision-making problems.
[0036] In this embodiment, a scene set is generated by a preconfigured mathematical model, and each scene is converted into a graph structure, so that a complex stochastic programming problem can be converted into a more easily processable graphical representation. The graph structure can more intuitively display the relationships and dependencies in the problem, which is helpful for subsequent graph convolution network processing. A hierarchical graph convolutional network (HGCN) is constructed based on the graph structure. HGCN can effectively extract key information from the graph and capture features at different levels. This can improve the model's ability to understand the scene, thereby providing more accurate information for subsequent similarity calculations and importance assessments. A scene similarity graph is constructed based on the extracted key information, and a scene importance scoring model is further constructed. The similarity graph can help identify and cluster similar scenes, thereby reducing redundant calculations. The importance scoring model selects representative scenes for sorting by evaluating the importance of the scene, which can significantly reduce the computational complexity and improve the solution efficiency. A deterministic equivalence problem is constructed based on the representative distribution station construction scene after sorting, and is solved. In this way, the originally complex stochastic programming problem can be converted into a series of deterministic problems, thereby simplifying the solution process. By building a solution evaluation tool based on key decision information and evaluating the quality of solutions in randomly generated scenarios, the parameters of the scenario importance scoring model can be dynamically adjusted and optimized, thereby continuously improving the accuracy and robustness of the model.
[0037] In summary, this embodiment not only improves the solution efficiency, but also can continuously optimize and adjust the model in a dynamic environment, and has high practical value and application prospects.
[0038] In a specific embodiment, according to one aspect of the present application, step S0 further comprises:
[0039] S01. Collect basic information about the problem, obtain the number of sites that can be built, and find that the total number of sites is 4; obtain funding restriction information and find that a maximum of 2 sites can be built; obtain the transportation distance data from each site to the community and form a transportation distance table; obtain the cargo capacity data of each site and form a site capacity list.
[0040] S02. Determine the content of the first-stage decision, create a list of 4 elements, each element represents a potential site; set each element to one of the two states of "build" or "do not build".
[0041] S03. Determine the decision content of the second stage and create a two-dimensional table, where rows represent sites and columns represent communities; each cell in the table represents the amount of goods delivered from a specific site to a specific community.
[0042] S04. Set constraints for the problem. According to funding constraints, set the condition that a maximum of 2 sites can be selected for construction; according to customer demand, set the condition that each community must receive sufficient goods delivery; according to site capacity, set the condition that the total delivery volume of each site does not exceed its capacity.
[0043] S05. Construct a cost calculation method. Create a function to calculate the total cost of site construction. Create another function to calculate the total cost of goods distribution. Combine these two functions to form a total cost calculation function.
[0044] S06. Form a complete decision model, integrating the site construction decision of the first phase with the cargo distribution decision of the second phase; set the model's goal to minimize the result of the total cost calculation function, and apply all previously set constraints to this integrated model.
[0045] For the scenario described above, the key elements of the identification problem are determined by the following parameters: a1, a2, ..., am, where a1 is the number of sites that can be built (4); a2 is the maximum number of sites that can be built (2); a3 is the transportation distance matrix D from each site to the community (4×m, m is the number of communities); a4 is the cargo capacity vector C (4×1) of each site. The random parameters are b1(ω), b2(ω), ..., bn(ω), where ω represents a random event; b1(ω) represents the customer demand vector R(ω) (m×1) of each community. Decision time points: divided into t1 (first stage) and t2 (second stage); t1 represents the site construction decision, and t2 represents the cargo distribution decision.
[0046] Select the first-stage decision variables. Identify the decisions that must be made at time t1: x1, x2, ..., xp, which usually involve long-term strategies, resource allocation, or facility layout;
[0047] Select the second-stage decision variables. Identify the decisions made at time t2 based on the realization of the random event ω: y1(ω), y2(ω), ..., yq(ω), which usually involve short-term operations, scheduling, or emergency measures.
[0048] Construct constraints. The first-stage constraints are: g1(x) ≤ 0, g2(x) ≤ 0, ..., gr(x) ≤ 0; the second-stage constraints are: h1(x, y, ω) ≤ 0, h2(x, y, ω) ≤ 0, ..., hs(x, y, ω) ≤ 0.
[0049] Construct the objective function:
[0050] f(x,y,ω) = c Tx + Q(x,ω);
[0051] where Q(x,ω) = min{q(ω) T y | h(x, y, ω) ≤ 0};
[0052] Construct the complete two-stage stochastic programming model:
[0053] min x {c T x + E ω [Q(x,ω)]};
[0054] st g(x)≤0,x∈X.
[0055] In another embodiment, the first stage decision variables are selected:
[0056] x = [x1, x2, x3, x4];
[0057] Where xi∈{0,1}, indicates whether to build a site at the i-th location;
[0058] Select the second-stage decision variables:
[0059] y(ω) = [yij(ω)];
[0060] Where yij(ω) represents the amount of goods delivered from site i to cell j in scenario ω;
[0061] Construct constraints, first stage constraints:
[0062] g1(x): ∑ i xi≤2 (up to 2 sites can be built);
[0063] Second stage constraints:
[0064] h1(x, y, ω): ∑ i yij(ω) = Rj(ω), ∧j (meeting customer needs);
[0065] h2(x, y, ω): ∑ j yij(ω) ≤ Ci·xi, ∧i (site capacity limit);
[0066] Construct the objective function:
[0067] f(x,y,ω) = ∑ i fi·xi +∑ i ∑ j dij·yij(ω);
[0068] Among them, fi is the cost of building the i-th site, and dij is the unit transportation cost from site i to cell j;
[0069] Construct the complete two-stage stochastic programming model:
[0070] min x {∑ i fi·xi + E ω [Q(x,ω)]};
[0071] st ∑ i xi ≤ 2;
[0072] xi∈{0,1},∧i;
[0073] where Q(x,ω) = min y {∑ i ∑ j dij·yij(ω)};
[0074] st ∑ i yij(ω) = Rj(ω), ∧j;
[0075] ∑ j yij(ω) ≤ Ci·xi, ∧i;
[0076] yij(ω) ≥ 0, ∧i,j.
[0077] like Figure 2 As shown, according to one aspect of the present application, step S1 is further:
[0078] Step S11, obtaining a preconfigured mathematical model of a two-stage stochastic programming problem, including a decision variable set, a constraint set, and an objective function;
[0079] Step S12: Generate a scene set using a random number generator based on a mathematical model;
[0080] Step S13: In each delivery station construction scenario, a graph structure represented by a bipartite graph is constructed based on a mathematical model;
[0081] Step S14: Use nonlinear feature transformation to map the graph structure represented by the bipartite graph to a high-dimensional feature space.
[0082] In this embodiment, the created decision model is read, including the decision variables, constraints and cost calculation functions for site construction and cargo distribution. Possible customer demand scenarios are generated, and a random number generator is used to create multiple groups of different customer demand data, each group representing a possible scenario, and the generated scenario data is stored in a scenario list for subsequent use. The decision model is converted into a graph structure in which nodes represent decision variables and constraints. Connecting lines are added to the graph to indicate the relationship between decision variables and constraints. Weights are assigned to each connecting line to reflect the importance of the decision variable in the constraints. A pre-trained graph neural network is used to process the created graph structure and obtain the output of the graph neural network as an enhanced feature representation of the problem.
[0083] In another embodiment, problem initialization and data preprocessing are first performed, and a mathematical model F to be modeled is input, including a decision variable set X, Y, a constraint set C, and an objective function f(X, Y).
[0084] Then, a scenario set δ = {ξ1, ξ2, ..., ξN} is generated, where N is the total number of scenarios and each scenario ξi contains random parameter values. The N customer demand vectors R(ω) are generated using the Monte Carlo method. It can be assumed that the demand of each cell follows a normal distribution N(μj, σj 2 );
[0085] The bipartite graph representation of the construction problem is G = (V, E), V = VX∪VY∪VC, where VX is 4 nodes, representing the decision variable nodes of the first stage; VY is 4m nodes, representing the decision variable nodes of the second stage (from each site to each cell), and VC represents 2+m+4 constraint nodes, including the maximum construction quantity constraint, demand satisfaction constraint, and capacity constraint;
[0086] The connection between decision variable nodes and related constraint nodes is: E = {(vi, vj) | vi∈VX∪VY, vj∈VC};
[0087] The edge weight wij is the coefficient value of the variable in the constraint;
[0088] Apply nonlinear feature transformation Φ(G) to map the bipartite graph G to a high-dimensional feature space: G' = Φ(G), and use a graph neural network (such as GraphSAGE) to encode the graph structure.
[0089] In this embodiment, first, by obtaining a preconfigured mathematical model, including a set of decision variables, a set of constraints, and an objective function, a clear mathematical basis is provided for the entire solution process. The use of this preconfigured model improves the versatility of the method, making it adaptable to different types of two-stage stochastic programming problems. Using a random number generator to generate a set of scenarios, the method can effectively simulate the uncertainty in the real world and improve the robustness of problem solving. Converting the mathematical model into a graphical structure represented by a bipartite graph is a key innovation. This conversion allows complex mathematical problems to be intuitively represented in the form of a graph, laying the foundation for subsequent graph neural network processing. The ability of the model to capture complex relationships is further enhanced by mapping the bipartite graph to a high-dimensional feature space using a nonlinear feature transformation. This nonlinear transformation can reveal nonlinear patterns in the data, allowing subsequent learning algorithms to better understand and process problems. The whole process not only improves the efficiency of problem representation, but also enhances the model's ability to understand complex relationships, thereby providing high-quality input data for subsequent scenario analysis and problem solving. The advantage of this method is that it can convert complex stochastic programming problems into a form that can be effectively processed by modern machine learning algorithms, thereby improving the efficiency and accuracy of problem solving.
[0090] like Figure 3 As shown, according to one aspect of the present application, step S2 is further:
[0091] Step S21, constructing a layered graph convolutional network based on the graph structure;
[0092] Step S22, compressing the delivery station construction scene features in the layered graph convolutional network, and extracting key information of the delivery station construction scene using the variational information bottleneck method based on the compressed delivery station construction scene features;
[0093] S23, calculating the similarity matrix between the key information of all delivery station building scenarios, constructing an adjacency matrix based on the similarity matrix, and normalizing the adjacency matrix;
[0094] S24. Based on the normalized adjacency matrix, a distribution site construction scenario similarity graph is constructed.
[0095] In this embodiment, a multi-level graph processing network is constructed, specifically a multi-layer graph convolution network is created to process each customer demand scenario, and the attention mechanism is used to perform weighted aggregation of the node information of each scene, build a relationship graph between the scenes, and apply the graph convolution operation again. To compress the scene feature information, it is necessary to build an encoder network to convert the scene features into a compressed form; to build a decoder network to try to restore the original features from the compressed form, and to optimize the encoder and decoder through multiple trainings so that they can efficiently compress and restore the scene features. To extract the key information of the scene, specifically to build an information extractor to filter out the most important information from the compressed scene features, use a variational inference method to balance the retention and compression of information, and obtain the minimized key information representation of each scene. Finally, a similarity relationship graph between scenes is established, the similarity between all scene key information is calculated, and based on the similarity, the closest neighbor scenes are found for each scene, and a graph structure is created, with nodes representing scenes and lines representing similar relationships between scenes.
[0096] The scene features in the compressed layered graph convolutional network in step S22 are further:
[0097] S221. Use an encoder to map scene features in the layered graph convolutional network to a latent space to obtain latent variables.
[0098] S222, using a decoder to reconstruct the latent variable into a new scene feature, and calculating a reconstruction error between the scene feature and the new scene feature;
[0099] S223, calculating the Wasserstein distance between the latent variable distribution and the preset target distribution, and taking the weighted sum of the reconstruction error and the Wasserstein distance as the loss function;
[0100] S224, minimizing the loss function and optimizing the parameters of the encoder and decoder through the back propagation algorithm;
[0101] S225. Compress scene features in layered graph convolutional networks using optimized encoders and decoders.
[0102] In a further embodiment, a hierarchical graph convolutional network H-GCN is constructed, where the bottom GCN convolves the bipartite graph G'i of each scene ξi to obtain the node embedding h(v); the middle pooling layer performs attention-weighted averaging on the node embeddings to obtain the scene embedding e(ξi); the top GCN constructs a complete graph with scenes as nodes, the edge weights are the cosine similarities of the scene embeddings, and GCN is applied again.
[0103] The Wasserstein autoencoder is used to compress and reconstruct the scene embedding. The encoder is a 3-layer fully connected network Enc(e(ξi)), which maps the scene embedding to the latent space Z; the decoder is a 3-layer fully connected network Dec(z), which reconstructs the latent variables into the scene embedding; and the weighted sum of the reconstruction error and the Wasserstein distance is minimized.
[0104] The variational information bottleneck method is applied to extract the minimum sufficient statistics of the scene, and the variational inference is used to approximate the mutual information term, setting β = 0.01 to balance information preservation and compression. Maximizing I(Z; δ) -β·I(Z; e(δ)), where I is the mutual information and β is the trade-off parameter, obtains the information compressed scene representation z*.
[0105] Finally, the scene similarity graph GS is constructed, and the RBF kernel function is used to calculate the similarity between scene representations. γ=0.1 is set as the kernel function parameter, the node is the compressed scene representation z*, and the edge weight is the kernelized Mahalanobis distance: w(zi*,zj*) = exp(-γ(zi*-zj*)T∑-1(zi*-zj*)).
[0106] In this embodiment, first, an encoder is used to map the scene features in the layered graph convolution network to a latent space to obtain latent variables. This approach can compress high-dimensional scene features into a low-dimensional space, reducing the complexity of the data. A decoder is used to reconstruct the latent variables into new scene features, and the reconstruction error between the scene features and the new scene features is calculated. This autoencoder structure can not only compress the data, but also ensure that the compressed data still retains the key information of the original data. The Wasserstein distance between the latent variable distribution and the preset target distribution is calculated, which is an important innovation. The Wasserstein distance can measure the difference between two probability distributions. By minimizing this distance, the compressed feature distribution can be closer to the expected distribution, thereby improving the quality and interpretability of the features. The weighted sum of the reconstruction error and the Wasserstein distance is used as the loss function. This approach strikes a balance between information retention and distribution matching. The loss function is minimized by the back-propagation algorithm, and the parameters of the encoder and decoder are optimized. This process enables the entire compression model to adaptively learn the optimal compression strategy. Finally, the optimized encoder and decoder are used to compress the scene features in the layered graph convolution network to obtain high-quality compressed features. The whole process not only achieves efficient feature compression, but also ensures that the compressed features still retain the key information of the original data. The advantage of this method is that it can retain useful information to the greatest extent while significantly reducing the data dimension, thereby providing high-quality input data for subsequent scene analysis and problem solving. At the same time, by introducing the Wasserstein distance, the method also improves the interpretability and generalization ability of the compressed features.
[0107] Furthermore, in step S22, the process of applying the variational information bottleneck method to extract the minimum sufficient statistics of the scene and obtain key information is specifically as follows:
[0108] Step S221, construct an encoder network q(z|e), input the scene embedding e(ξi) and dimension de, construct a two-layer fully connected network: FC(de, dh), ReLU, FC(dh, 2*dz), output the parameters of the mean μ and the diagonal covariance matrix Σ, and the total dimension is dz.
[0109] Step S222, construct a predictor network p(ξ|z) with latent variable z and dimension dz as input;
[0110] It includes two layers of fully connected networks, FC(dz, dh), ReLU, and FC(dh, dξ). The output reconstructed scene parameters ξ' and dimension are dξ.
[0111] Step S223: Calculate the variational information bottleneck loss. The specific process is as follows:
[0112] For each scene ξi, sample K times from q(z|e(ξi)) to obtain {zk}k=1 K ;
[0113] Calculate the reconstruction error Lrec = 1 / K * Σk ||ξi - p(zk)|| 2 ;
[0114] Calculate KL divergence L KL = KL(q(z|e(ξi)) || N(0,I));
[0115] Calculate the total loss, L VIB = Lrec + β * L KL , where β is the trade-off parameter;
[0116] Step S224: Use the Adam optimizer to minimize L VIB , as follows:
[0117] Set the learning rate lr = 0.001 and the number of iterations maxiter = 1000;
[0118] For each mini-batch, calculate L VIB , calculate the gradient ∇L VIB ; and update the encoder and predictor parameters.
[0119] Step S225, extracting the minimum sufficient statistics, specifically: for each scene ξi, using the trained encoder q(z|e(ξi)) to obtain zi*.
[0120] In step S24, the process of constructing the scene similarity graph GS specifically includes the following steps:
[0121] Step S241, calculate the similarity matrix S between scene representations, that is, for each pair of scene representations (zi*, zj*), calculate the Euclidean distance: dij = ||zi* - zj*||2; apply the RBF kernel function Sij = exp(-γ * dij 2 ), where γ = 0.1.
[0122] Step S242: Construct a K-nearest neighbor graph. Specifically, for each scene zi*, find the K most similar scenes (K = 10). Create an adjacency matrix A: If j is one of i's K-nearest neighbors, then A ij = S ij , otherwise A ij = 0.
[0123] Step S243, normalizing the adjacency matrix, specifically:
[0124] Calculate the degree matrix D ii = Σ j A ij ; Calculate the normalized adjacency matrix A norm = D (-1 / 2) * A * D (-1 / 2) .
[0125] Step S244, construct a scene similarity graph GS, including: nodes, each scene represents zi*; edges, according to Anorm, connecting node pairs with non-zero values; edge weights, corresponding Anorm ij value.
[0126] In this embodiment, first, a hierarchical graph convolutional network is constructed based on a graph structure. This network structure can effectively capture the hierarchical information in the scene and can better reflect the complex structure of the scene than the traditional feature extraction method. Compression technology is introduced to process the scene features in the hierarchical graph convolutional network. This approach not only reduces the dimension of the data, but also retains the key information and improves the efficiency of subsequent processing. Using the variational information bottleneck method to extract the key information of the scene is another important innovation. This method can compress the data to the greatest extent while retaining the necessary information, thereby achieving a balance between information retention and computational efficiency. By calculating the similarity matrix between the key information of all scenes, the method can comprehensively analyze the relationship between the scenes. Based on the similarity matrix, an adjacency matrix is constructed and normalized. This step not only considers the similarity between the scenes, but also makes the influence of different scenes more balanced through normalization. Finally, a scene similarity graph is constructed based on the normalized adjacency matrix. This graph structure intuitively represents the relationship between the scenes and provides a solid foundation for subsequent scene selection and sorting. The whole process not only efficiently extracts the key features of the scene, but also establishes a relationship network between the scenes, which is crucial for understanding and processing complex stochastic programming problems. The advantage of this method is that it can significantly reduce the complexity of the data while retaining key information, making subsequent processing more efficient and accurate.
[0127] like Figure 4 As shown, step S3 is further as follows:
[0128] S31. Based on the scene similarity graph, a scene importance scoring model based on graph attention network is constructed to evaluate the importance of each delivery station construction scene;
[0129] S32. Based on the importance of each delivery station building scenario, a kernel matrix is constructed and the eigendecomposition of the kernel matrix is calculated;
[0130] S33. Based on eigendecomposition, the kernel matrix is sampled using a determinant point process to obtain a predetermined number of representative delivery station building scenarios;
[0131] S34. Use the Sinkhorn algorithm to sort the representative delivery site construction scenarios to obtain sorted representative delivery site construction scenarios.
[0132] In this embodiment, first, a scene importance scoring model based on a graph attention network is constructed based on a scene similarity graph, which is an important innovation. The graph attention network can adaptively learn the importance of the relationship between different scenes, so as to more accurately evaluate the importance of each scene. Compared with the traditional importance evaluation method, this method can better capture the complex interactions between scenes. A kernel matrix is constructed based on the importance of each scene, and the characteristic decomposition of the kernel matrix is calculated. This step provides a mathematical basis for subsequent scene selection. The kernel matrix is sampled using a determinant point process. This method can not only select important scenes, but also ensure that the selected scene set is diverse, avoiding information redundancy. Through a predetermined number of sampling, the method can flexibly control the number of representative distribution station construction scenes, and strike a balance between computational efficiency and information integrity. Finally, the representative distribution station construction scenes are sorted using the Sinkhorn algorithm, which is another innovation. The Sinkhorn algorithm can optimize the sorting of scenes while maintaining scene diversity, so that subsequent problem solving can be more efficient. The whole process not only efficiently evaluates the importance of the scene, but also selects a representative and diverse scene set and optimizes the sorting of these scenes. The advantage of this method is that it can significantly reduce the number of scenarios that need to be processed while ensuring information integrity, thereby significantly improving the efficiency of subsequent problem solving. At the same time, by optimizing the order of scenarios, the method can further improve the quality of problem solving.
[0133] In step S32, a kernel matrix is constructed and eigendecomposition of the kernel matrix is performed. The specific process is as follows:
[0134] S321. Construct the kernel matrix L:
[0135] For each pair of scenes (i, j): Lij = qi * qj * k(zi*, zj*); where qi = s(zi*) is the scene importance score and k(·, ·) is the RBF kernel function.
[0136] S322. Calculate the eigendecomposition of L: L = V∏V T , where ∏ represents a diagonal matrix; the Lanczos algorithm is used to calculate the first r largest eigenvalues and the corresponding eigenvectors.
[0137] In step S33, a determinantal point process (DPP) is applied to perform diversified scene selection, and the specific process is as follows:
[0138] Initialization: Select a set Y = Ψ, where Ψ is the set of initial selections; repeat until |Y| = K:
[0139] For each i ΘY, where Θ denotes not belonging to, calculate: Pi = Σ{λj>0} λj / (λj + 1) * (vj T ei)2; select a new element i with probability Pi / Σk Pk; update Y = Y ∪ {i}; for jΘY, update vj = vj- (vj T ei) * ei / ||ei|| 2 ; Re-orthogonalize the remaining vj;
[0140] Returns the selected K scene index set Y.
[0141] S34, the process of sorting the selected scenes using the Sinkhorn algorithm is as follows:
[0142] S341. Construct cost matrix C:
[0143] For each pair (scene i, location j): Cij = |i - j| + α * ||zi* - zmean||2;
[0144] where zmean is the mean representation of the selected scene, α is a trade-off parameter, the difference between the scene and the position (|ij|) and the Euclidean distance between the scene representation and the mean representation (||zi* - zmean||2), the latter multiplied by a trade-off parameter (α).
[0145] S342. Initialization: u = ones(K) / K, v = ones(K) / K; ε = 0.1 (regularization parameter), maxiter = 100;
[0146] S343. Sinkhorn iteration: repeat until convergence or maxiter is reached:
[0147] u = a / (K * exp(C / ε) * v); v = b / (K * exp(CT / ε) * u); where a and b are uniformly distributed vectors;
[0148] S344. Calculate the transport plan T = diag(u) * exp(-C / ε) * diag(v);
[0149] S345. Extract ranking from transshipment plan:
[0150] For each position j, select scene i with the largest Pij; return a sorted list of scene indices.
[0151] According to one aspect of the present application, step S34 may also be:
[0152] S341. Construct a cost matrix based on representative delivery station building scenarios;
[0153] S342, initializing the parameters of the Sinkhorn algorithm, and performing iterative calculation of the parameters using the Sinkhorn algorithm based on the cost matrix to obtain updated parameters;
[0154] S343, calculating a transshipment plan matrix based on the updated parameters and cost matrix;
[0155] S344. Extract the sorting results from the transfer plan matrix, i.e., the representative distribution station establishment scenarios after sorting.
[0156] In a further embodiment, based on the scene similarity graph GS, a scene importance scoring model based on the graph attention network (GAT) is constructed, and the attention coefficient between nodes is calculated using a multi-head attention layer. Specifically, there are 2 layers of GAT, each with 4 attention heads, and gated graph pooling is used to aggregate global information to obtain the importance score s(zi*) of each scene; Determinantal Point Process (DPP) is applied to select K=20 scenes: Construct the kernel matrix:
[0157] Lij = s(zi*)·s(zj*)·k(zi*, zj*);
[0158] Among them, k(zi*, zj*) is the RBF kernel function, and the fast greedy algorithm is used for DPP sampling to obtain K representative and diverse scene index sets I. The selected scenes are sorted using the Sinkhorn algorithm: the cost matrix C is constructed, Cij represents the cost of scene i in position j, the number of iterations is set to 100, the regularization parameter is set to 0.1, the discrete optimal transmission problem is solved, and the sorting matrix P is obtained.
[0159] In this embodiment, first, a cost matrix is constructed based on representative distribution station construction scenarios, which provides a quantitative evaluation standard for scene sorting. The construction of the cost matrix takes into account the similarities and differences between scenarios, providing a comprehensive information basis for the subsequent sorting process. The parameters of the Sinkhorn algorithm are initialized innovatively, and the parameters are iteratively calculated based on the cost matrix. This method can optimize the sorting of scenarios while maintaining the diversity of scenarios. The use of the Sinkhorn algorithm is an important innovation, which can effectively solve large-scale optimal transmission problems, thereby achieving a good balance between computational efficiency and sorting quality. Through multiple iterations, the algorithm can gradually optimize the parameters so that the final sorting result is closer to the global optimal solution. Based on the updated parameters and cost matrix, the transfer plan matrix is calculated. This step converts the abstract optimization problem into a specific sorting scheme. The transfer plan matrix not only contains the sorting information of the scenarios, but also reflects the strength of association between different scenarios. Finally, the sorting results are extracted from the transfer plan matrix to obtain the sorted representative distribution station construction scenarios. The advantage of this method is that it can simultaneously consider the importance and diversity of the scenarios, ensuring that the sorting results can both reflect the criticality of the scenarios and maintain the representativeness of the scenario set. Through this optimized sorting, the subsequent problem-solving process can be more efficient because the algorithm can prioritize the most representative and influential scenarios, thereby converging to high-quality solutions more quickly. At the same time, this sorting method is also highly scalable and can handle a large number of scenarios, suitable for complex practical problems. In general, this scenario sorting method based on the Sinkhorn algorithm not only improves the efficiency of solving two-stage stochastic programming problems, but also enhances the quality and robustness of the solution.
[0160] like Figure 5 As shown, according to one aspect of the present application, step S4 is further:
[0161] S41. Construct a deterministic equivalence problem based on the sorted representative delivery station building scenarios;
[0162] S42, using a column generation method to dynamically generate new decision variables, and adding the new decision variables to the deterministic equivalence problem to form an added variable deterministic equivalence problem;
[0163] S43, using the cutting plane method, strengthen the linear relaxation of the deterministic equivalence problem with added variables to obtain the final deterministic equivalence problem;
[0164] S44. Use the branch-and-price algorithm to solve the final deterministic equivalence problem, obtain a solution, and extract key decision information from the solution.
[0165] Based on the sorted representative delivery site construction scenarios, a smaller-scale decision problem is constructed, the constraints in the original problem are applied to this simplified problem, and the objective function of the simplified problem is set to reflect the optimization goal of the original problem.
[0166] In a further embodiment, a reduced deterministic equivalent problem P' is constructed based on the selected scenario, the decision variables are x and 20 groups of y(ω), the constraints are instantiations of the original constraints under the 20 selected scenarios, and the objective function is:
[0167] f'(x,{y}) =∑ i fi·xi + 1 / 20∑ k ∑ i ∑ j dij·yij(ωk);
[0168] A customized branch-and-price algorithm is applied to solve the problem P', a column generation method is used to dynamically generate distribution decision variables, a cutting plane method is used to strengthen linear relaxation, and a branching strategy based on reinforcement learning is constructed. The first-stage decision x* (site construction plan) and the dual information λ are extracted.
[0169] In another embodiment, the decision variable is X∪{Yi | i∈I}, the constraint is the instantiation of the original constraint C in the selected scenario, and the objective function is:
[0170] f'(X,{Yi}) = cTX + ∑ i∈I wi·qiTYi;
[0171] Where wi is the scene weight.
[0172] According to another aspect of the present application, the generation frequency of the new decision variable in step S42 is also adjusted, specifically:
[0173] S421. Build resource monitoring tools to monitor current CPU and memory usage;
[0174] S422: If the CPU or memory usage exceeds the preset warning line, the frequency of generating new decision variables is reduced; if the CPU or memory usage is lower than the preset warning line, the frequency of generating new decision variables is increased.
[0175] Create a resource monitoring tool and set up a resource monitoring program to check the system status once a second. Build warning lines for CPU and memory usage, which are 80% and 70% respectively. Check resource usage regularly. After each round of the solution process, start a resource check to obtain the current CPU and memory usage percentages. Adjust the calculation method according to the resource status: if the CPU or memory usage exceeds the warning line, reduce the frequency of generating new variables, increase the standard for deleting unnecessary calculations, and reduce the number of simultaneous calculation tasks; if the resource usage is far below the warning line, increase the frequency of generating new variables, reduce the standard for deleting calculations, and increase the number of simultaneous calculation tasks. Update the calculation parameters and apply the adjusted parameters to the solution program.
[0176] In a specific embodiment, a resource monitoring object is created, and the monitoring interval is set to 1 second; resource thresholds are constructed: CPU usage threshold 80%, memory usage threshold 70%. During the solution process, resource usage is periodically checked: after each branch pricing iteration, the resource monitoring module is called to obtain the current CPU usage cpu usage and memory usage mem usage . Adjust the computing strategy based on resource usage:
[0177] If the cpu usage > cpu threshold or mem usage > mem threshold , halve the frequency of column generation: column * = 2; increase the pruning threshold pruning threshold = 1.2; reduce the number of parallel computing threads threads = max(1, parallel threads / / 2),
[0178] Otherwise, if the cpu usage < cpu threshold / 2 and mem usage < mem threshold / 2, double the frequency of column generation: column = max(1, column / / 2); reduce the pruning threshold: pruning threshold / = 1.2; Increase the number of threads for parallel computing: parallel threads = min(max threads , parallel threads * 2).
[0179] Apply new parameter settings to dynamically adjust the use of computing resources, improving resource utilization efficiency while ensuring solution quality.
[0180] In this embodiment, first, a deterministic equivalence problem is constructed based on the representative distribution site construction scenario after sorting. This approach converts complex random problems into deterministic problems that can be directly solved, simplifying the complexity of the problem. New decision variables are dynamically generated using the column generation method, which is an important optimization technique. The column generation method can gradually introduce new decision variables in the solution process instead of considering all possible variables at the beginning, which reduces the scale of the problem and improves the solution efficiency. The newly generated decision variables are added to the deterministic equivalence problem to form an added variable deterministic equivalence problem. This method of dynamically adjusting the problem structure makes the solution process more flexible and efficient. Another innovation is to use the cutting plane method to strengthen the linear relaxation of the added variable deterministic equivalence problem. The cutting plane method can gradually strengthen the constraints of the problem, making the linear relaxation closer to the integer solution, thereby improving the quality of the final solution. Through these steps, the final deterministic equivalence problem is obtained, laying the foundation for subsequent solutions. Finally, the final deterministic equivalence problem is solved using the branch and price algorithm, which combines the advantages of branch and bound and column generation and can efficiently handle large-scale integer programming problems. Extracting key decision information from the solution provides the necessary input for subsequent evaluation and optimization. The whole process not only transforms complex stochastic problems into solvable deterministic problems, but also improves the efficiency and quality of solutions through a series of optimization techniques. The advantage of this method is that it can effectively handle large-scale and complex two-stage stochastic programming problems, and has strong flexibility and scalability.
[0181] In step S42, a new decision variable is dynamically generated using a column generation method, specifically:
[0182] S421. Initialize the main problem: Use a set of initial feasible delivery solutions yinit to construct the restricted main problem (RMP);
[0183] S422. Solve the restricted master problem: Use the simplex method to solve the RMP and obtain the dual variable π;
[0184] S423. Solution to sub-problem (pricing problem):
[0185] For each site i: build a network flow model: the source point is site i, and the sink point is the demand point; the reduced cost of the edge: rcij = dij - πj; use the network simplex method to solve the shortest path problem; if a path with a negative reduced cost is found, add it to the RMP;
[0186] S424. Update the main problem: If a new column (delivery solution) is found, return to step S422; otherwise, the current solution is the optimal solution;
[0187] S425. Applied integer variable processing: Use branch and bound method to handle integer constraints; Use cutting plane method to strengthen linear relaxation;
[0188] S426. Initialization: Solve the linear relaxation problem and obtain the initial solution xLP;
[0189] S427. Generate cutting plane: Check whether the current solution xLP satisfies the integer constraint; if not, use the Gomory cutting plane method to generate the cutting plane: select a decimal decision variable xi; construct the Gomory cutting plane: Σ j fij xj ≥ fi0; where fij and fi0 are calculated from the coefficients in the simplex table;
[0190] S428. Add cutting plane and re-solve: add the generated cutting plane to the constraint set; re-solve the linear programming problem;
[0191] S429. Iteration: Repeat steps S427-S428 until there is no new valid cutting plane or the maximum number of iterations is reached. In this embodiment, first, a resource monitoring tool is constructed to monitor the current CPU and memory usage in real time. This approach provides the necessary information basis for subsequent dynamic adjustment. By setting a preset warning line, the method can timely identify the tight or surplus state of computing resources. When the CPU or memory usage exceeds the preset warning line, the generation frequency of new decision variables is reduced. This approach can effectively alleviate the pressure of computing resources and prevent system overload. On the contrary, when the CPU or memory usage is lower than the preset warning line, the generation frequency of new decision variables is increased. This approach can make full use of idle computing resources and accelerate the solution process. The innovation of this dynamic adjustment mechanism is that it can adaptively adjust the behavior of the algorithm according to the real-time resource status, thereby maximizing the computing efficiency while ensuring the solution quality. This method not only improves resource utilization, but also enhances the robustness of the algorithm, so that it can maintain efficient operation under different hardware environments. At the same time, by dynamically adjusting the generation frequency of new decision variables, the method can also maintain good performance when the problem scale and complexity change dynamically. Another advantage of this adaptive mechanism is that it can adjust strategies during different stages of the solution process. For example, in the initial stage, new variables may need to be generated more frequently to quickly explore the solution space, while in the later stage, the generation frequency may need to be reduced to refine the current solution. In general, this dynamic adjustment mechanism improves the efficiency and adaptability of the entire solution process, enabling the method to better handle large-scale and complex two-stage stochastic programming problems.
[0192] like Figure 6 As shown, according to one aspect of the present application, step S5 is further:
[0193] S51. Based on key decision information, construct a solution evaluation tool and calculate the approximate expected total cost;
[0194] S52. Based on the approximate expected total cost, test the solution in randomly generated scenarios, calculate the average performance of the solution, and form a comprehensive performance score;
[0195] S53, comparing the comprehensive performance score with the preset performance target, if the preset performance target is not reached, returning to step S3; if the preset performance target is reached, outputting the final solution to the distribution station establishment;
[0196] S54. Calculate the impact of each scenario on the final solution, and based on the impact, use the policy gradient method to update the parameters of the scenario importance scoring model.
[0197] In this embodiment, the solution evaluation tool is a neural network that is used to quickly estimate the performance of different site construction solutions in various scenarios. The neural network is trained using historical data and simulation data to improve its prediction accuracy. The constructed evaluation tool is used to test the current site construction solution in a large number of randomly generated scenarios.
[0198] In a further embodiment, a neural network approximator V(x, ξ) is constructed to estimate the second-stage value function, where x is the site construction plan, ξ represents the scenario parameters, and the neural network approximator is a 3-layer fully connected network. The network is trained using the double sampling method and the ReLU activation function is used to obtain an estimate of the optimal delivery cost in the second stage. Calculate the approximate expected total cost:
[0199] E[f(x*,y)] ≈∑ i fi·xi* + 1 / N∑ j=1 N V(x*,ξj);
[0200] To evaluate the quality of the solution, calculate the approximately optimal gap: Gap = (E[f(x*, y)] - LB) / LB, where LB is the lower bound.
[0201] If Gap > optimal gap threshold ε, take 0.05 and return to step S3 for iterative optimization;
[0202] Update the scene selection model and calculate the influence of each scene: Ii = |V(x*,ξi) - 1 / K·∑ j∈I V(x*,ξj)|;
[0203] Update the GAT model parameters using the policy gradient method or the Adam optimizer.
[0204] S541. Constructing a policy network π θ(a|s), the network structure includes 2 layers of GAT, 1 layer of full connection and Softmax.
[0205] The input state s is the node feature of the scene similarity graph GS; the output action probability a is the probability distribution of selecting each scene.
[0206] S542. Construct the value network Vφ(s), including 2 layers of GAT and 2 layers of full connection;
[0207] The input state s is the node feature of the scene similarity graph GS; the output state is the value estimate.
[0208] S543. Sampling trajectory:
[0209] For each cycle: initialize state s0; for t=0, 1, ..., T-1: start from π θ (a|s t ) in the sampling action a t ;
[0210] Execute action a t , observe the reward r t and the next state s t+1 ;Storage trajectory τ = (s0,a0,r0,…,s T , a T , r T );
[0211] S544. Compute advantage estimates:
[0212] For each time step t in trajectory τ: A t = Σ k=t T γ (k-t) r k -V Φ (s t );
[0213] S545. Update strategy network parameters θ:
[0214] Calculate policy gradient: ▽ θ J = E τ [Σ t ▽ θ log π θ (a t |s t ) A t ];
[0215] Update θ using the Adam optimizer.
[0216] S546. Update the value network parameter φ: Minimize the mean square error: L(φ) = Eτ [Σ t (V φ (s t ) - R t ) 2 ];
[0217] Where R t = Σ k=t T γ k-t r k ;
[0218] Update φ using the Adam optimizer;
[0219] S547. Iterative training: Repeat steps S543-S546 until convergence or the maximum number of iterations is reached.
[0220] In this embodiment, first, a solution evaluation tool is constructed based on key decision information, and the approximate expected total cost is calculated. This approach provides a quantitative standard for the evaluation of the solution. The solution is tested in randomly generated scenarios, the average performance of the solution is calculated, and a comprehensive performance score is formed. This method can comprehensively evaluate the performance of the solution in various possible situations, and improves the reliability of the evaluation. The comprehensive performance score is compared with the preset performance target, and it is determined whether to return to step S3 to reselect and sort the scenarios based on the comparison result. This feedback mechanism forms a closed loop for the entire solution process and can continuously optimize the solution. If the preset performance target is achieved, the final solution is output, which ensures that the output solution meets the predetermined quality standards. The degree of influence of each scenario on the final solution is calculated. This approach can identify the key scenarios that have the greatest impact on the quality of the solution. Based on the degree of influence, the policy gradient method is used to update the parameters of the scenario importance scoring model, which is another important innovation. The policy gradient method can adaptively adjust the model parameters according to the actual effect, so that the scenario importance scoring model can continuously improve its performance. The whole process not only realizes a comprehensive evaluation of the solution, but also establishes a self-optimization mechanism, so that the entire solution method can continuously improve its performance with use. The advantage of this method is that it can adapt to changes in the problem and continuously optimize the solution strategy, thereby continuously improving the quality of the solution in long-term use. At the same time, by identifying key scenarios and updating model parameters, the method can also better focus on the most critical factors for problem solving, further improving the solution efficiency.
[0221] In another embodiment of the present application, the process of scene selection and sorting may also be:
[0222] Evaluate the importance of scenes, including: Create a graph attention network to process the scene similarity graph. Using this network, calculate an importance score for each scene. Associate the calculated importance score with each scene.
[0223] Select representative scenarios, including: using a deterministic point process approach, taking into account the importance and diversity of scenarios. Select a subset of the most representative scenarios from all scenarios. Save the selected scenarios to a new list.
[0224] Sort the selected scenes, including: creating a cost matrix that represents the cost of placing each scene in different locations. Using the Sinkhorn algorithm to find an optimal scene sorting scheme. Re-sort the selected scenes based on the algorithm results.
[0225] In another embodiment of the present application, the construction and solution of the reduction problem can also be:
[0226] Create a simplified version of the decision problem, including: Building a smaller decision problem based on the selected and ranked scenarios. Applying the constraints from the original problem to the simplified version. Setting the objective function of the simplified version to reflect the optimization goal of the original problem.
[0227] Solve the problem using advanced solving techniques, including: Implementing column generation methods to dynamically add new decision variables to the problem. Using cutting plane methods to progressively strengthen the linear relaxation of the problem. Applying branch-and-price algorithms to find high-quality solutions in a reasonable amount of time.
[0228] Extract key decision information, including: extracting the first-stage site construction decision from the solution results. Record key information in the solution process, such as dual variable values, etc.
[0229] In another embodiment of the present application, monitoring and adjusting the use of computing resources may also include:
[0230] Create a resource monitor to continuously check the CPU and memory usage. Dynamically adjust the parameters of the solution algorithm, such as parallelism, accuracy requirements, etc., based on resource usage. Reduce the calculation intensity when resources are tight, and improve the calculation accuracy when resources are sufficient.
[0231] In another embodiment of the present application, step S5 may also be:
[0232] Create a neural network to quickly estimate the performance of different site construction solutions in various scenarios. Use historical data and simulated data to train this neural network to improve its prediction accuracy. Use the constructed evaluation tool to test the current site construction solution in a large number of randomly generated scenarios. Calculate the average performance of the solution in all test scenarios to obtain an overall score. Compare the overall score of the solution with the preset performance target. If the score does not meet the target, return to the scenario selection step and restart the solution process. Calculate the impact of each scenario on the final decision. Use the policy gradient method to update the parameters of the scenario importance evaluation model. Through multiple iterations, gradually improve the strategy of scenario selection and improve the quality of the solution.
[0233] In another embodiment of the present application, the step of constructing a scene relationship network may also be:
[0234] Calculate the similarity between scenes, including: for each pair of scenes, calculate the distance of their core information and convert the distance into a similarity score.
[0235] Find similar partners for each scenario, including: Select the 10 most similar other scenarios for each scenario. Record these similar relationships.
[0236] Balance the relationship network, including: Calculate the overall similarity of each scene. Use the overall similarity to adjust the connection strength between scenes.
[0237] Generating the final relationship network includes: creating a network where each node represents a scene, and establishing connections between scenes based on the adjusted similarity.
[0238] In another embodiment of the present application, the process of selecting a representative scene may also be:
[0239] Assess the uniqueness and importance of scenarios: Create a scoring matrix that takes into account the importance of scenarios and how different they are from each other.
[0240] Analyze the characteristics of the rating matrix: Use mathematical methods to find the main characteristics and patterns of the rating matrix.
[0241] Step-by-step selection of representative scenes: Initially, the selection set is empty. Repeat the following steps until the required number of scenes are selected: Calculate the selection probability of each unselected scene. Select a new scene based on the probability. Update the features of the remaining scenes to ensure diversity.
[0242] Output selected scenes: Returns a numbered list of the selected scenes.
[0243] In another embodiment of the present application, the process of sorting the selected scenes may also be:
[0244] Calculate a cost value for each scene at different locations. Consider the impact of location and scene features. Initialize the sorting tool. Set the algorithm parameters. Repeat the following steps: update the location probability of the scene, adjust the selection probability of the location. Finally, create a sorting scheme based on the final probability distribution.
[0245] In another embodiment of the present application, the process of determining the final sorting may also be:
[0246] Analyze the sorting scheme and select the most appropriate scene for each location. Output the sorted scene list.
[0247] Dynamically generate new delivery plans, including:
[0248] Prepare an initial delivery plan: Create a basic, workable delivery plan as a starting point.
[0249] Optimize the current delivery plan: Use linear programming methods to find the best way to implement the current plan. Record important information obtained during the optimization process.
[0250] Find opportunities for improvement: For each delivery station: Build a network model that represents the delivery paths from the station to each demand point. Calculate the actual cost of each path. Find new delivery paths that can reduce the total cost. If a better path is found, add it to the delivery plan.
[0251] Update the overall delivery plan: If a new effective delivery path is found, re-optimize the overall plan. If no new improvements are found, the current plan is considered to be the best.
[0252] Handling integer constraints: Use branch and bound to convert continuous delivery quantities into integer values.
[0253] Initialize the problem relaxation: construct a simplified version of the delivery problem that allows non-integer solutions.
[0254] Check if the current solution satisfies the integer requirement. If not, add new constraints to approach an integer solution: Select a decision variable that is not an integer. Construct a new constraint based on this variable. Add this new constraint to the problem.
[0255] Take the newly added constraints into account and solve the optimization problem again.
[0256] Repeat the process of adding constraints and solving until a satisfactory integer solution is obtained or the preset number of iterations is reached.
[0257] In another embodiment of the present application, it also includes creating a scenario selection strategy network:
[0258] Build a neural network to evaluate the quality of each scene. The input data is the relationship between scenes. The output data is the probability of selecting each scene.
[0259] Create a state evaluation network: Build another neural network to evaluate the quality of the current selected state.
[0260] The scene relationship information is used as input, and the neural network output is used to evaluate the value of the current state.
[0261] For each round of decision making: Start from the initial state.
[0262] Repeat the following steps: Use the policy network to select a scenario. Record the results and new state after selecting this scenario. Save a record of the entire decision process.
[0263] Evaluate decision quality: For each decision step: Calculate the actual long-term gain. Compare with the prediction of the state evaluation network. Record the prediction error.
[0264] Improve selection strategy: Calculate how to adjust the policy network based on the actual decision-making results. Use optimization algorithms to update the parameters of the policy network.
[0265] Improved state estimation: Using the recorded actual results, the state estimation network is optimized. The network parameters are adjusted to make its predictions more accurate.
[0266] Repeat the process of simulation, evaluation, and improvement until both the strategy and evaluation are stable, or the predetermined number of training times is completed.
[0267] According to another aspect of the present application, there is also provided an artificial intelligence driven two-stage stochastic programming problem solving system, comprising:
[0268] at least one processor; and,
[0269] a memory communicatively connected to at least one of the processors; wherein,
[0270] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the artificial intelligence driven two-stage stochastic programming problem solving method described in any of the above technical solutions.
[0271] The preferred embodiments of the present invention are described in detail above; however, the present invention is not limited to the specific details in the above embodiments. Within the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all belong to the protection scope of the present invention.
Claims
1. An AI-driven two-stage stochastic programming problem solving method. It is characterized in that The steps include: S0. Collect distribution station construction data and construct a mathematical model of a two-stage stochastic planning problem; the distribution station construction data includes deterministic parameters, random parameters, decision time points and decision variables; the deterministic parameters include: the number of sites that can be constructed, the maximum number of sites that can be constructed, the transportation distance matrix from each site to the community, and the cargo capacity vector of each site; the random parameters include the customer demand vector of each community; the decision time points include the site construction decision time and the cargo distribution decision time; S1. Generate a set of delivery station construction scenarios based on the mathematical model, and in each delivery station construction scenario, convert the mathematical model into a graphical structure; S2. Based on the graph structure, a layered graph convolutional network is constructed, key information of the delivery station construction scenario is extracted from the layered graph convolutional network, and a delivery station construction scenario similarity graph is constructed based on the key information; S3. Based on the delivery station construction scenario similarity graph, a delivery station construction scenario importance scoring model is constructed to evaluate the importance of the delivery station construction scenario, and representative delivery station construction scenarios are selected and ranked; S4. Based on the sorted representative delivery site construction scenarios, construct a deterministic equivalence problem, solve the deterministic equivalence problem, obtain a delivery site construction solution, and extract key decision information from the delivery site construction solution; S5. Based on the key decision information, a distribution site construction solution evaluation tool is constructed. The distribution site construction solution evaluation tool is used to evaluate the quality of the distribution site construction solution in the randomly generated distribution scenarios. Based on the evaluation results, the parameters of the distribution site construction scenario importance scoring model are updated. Step S1 is further as follows: S11, obtaining a preconfigured mathematical model of a two-stage stochastic programming problem, including a decision variable set, a constraint set, and an objective function; S12, based on the mathematical model, using a random number generator to generate a scene set; S13. In each delivery station construction scenario, a graphical structure represented by a bipartite graph is constructed based on a mathematical model; S14, using nonlinear feature transformation to map the graph structure represented by the bipartite graph to a high-dimensional feature space; Step S2 is further as follows: S21. Construct a hierarchical graph convolutional network based on the graph structure. S22, compressing the delivery station construction scene features in the layered graph convolutional network, based on the compressed delivery station construction scene features, using the variational information bottleneck method to extract the key information of the delivery station construction scene; S23, calculating the similarity matrix between the key information of all delivery station building scenarios, constructing an adjacency matrix based on the similarity matrix, and normalizing the adjacency matrix; S24. Based on the normalized adjacency matrix, construct a delivery station construction scenario similarity graph; Step S4 is further as follows: S41. Construct a deterministic equivalence problem based on the sorted representative delivery station building scenarios; S42, using a column generation method to dynamically generate new decision variables, and adding the new decision variables to the deterministic equivalence problem to form an added variable deterministic equivalence problem; S43, using the cutting plane method, strengthen the linear relaxation of the deterministic equivalence problem with added variables to obtain the final deterministic equivalence problem; S44. Use the branch-and-price algorithm to solve the final deterministic equivalence problem, obtain the distribution station building solution, and extract key decision information from the distribution station building solution; The scene features in the compressed layered graph convolutional network in step S22 are further: S221. Use an encoder to map the delivery station scene features in the layered graph convolutional network to a latent space to obtain latent variables; S222. Use the decoder to reconstruct the latent variables into new scene features, and calculate the reconstruction error between the delivery station scene features and the new scene features; S223, calculating the Wasserstein distance between the latent variable distribution and the preset target distribution, and taking the weighted sum of the reconstruction error and the Wasserstein distance as the loss function; S224, minimizing the loss function and optimizing the parameters of the encoder and decoder through the back propagation algorithm; S225. Use the optimized encoder and decoder to compress the delivery station scene features in the layered graph convolutional network.
2. The artificial intelligence driven two-stage stochastic programming problem solving method according to claim 1, It is characterized in that Step S3 is further as follows: S31. Based on the delivery station construction scenario similarity graph, a delivery station construction scenario importance scoring model based on graph attention network is constructed to evaluate the importance of each delivery station construction scenario. S32. Based on the importance of each delivery station building scenario, a kernel matrix is constructed and the eigendecomposition of the kernel matrix is calculated; S33. Based on eigendecomposition, the kernel matrix is sampled using a determinant point process to obtain a predetermined number of representative delivery station building scenarios; S34. Use the Sinkhorn algorithm to sort the representative delivery site construction scenarios to obtain sorted representative delivery site construction scenarios.
3. The artificial intelligence driven two-stage stochastic programming problem solving method according to claim 2, It is characterized in that Step S5 is further as follows: S51. Based on key decision information, build a distribution station construction plan evaluation tool and calculate the approximate expected total cost; S52. Based on the approximate expected total cost, test the delivery site building solution in the randomly generated delivery site building scenario, calculate the average performance of the delivery site building solution, and form a comprehensive performance score; S53, comparing the comprehensive performance score with the preset performance target, if the preset performance target is not reached, returning to step S3; If the preset performance target is achieved, the final solution is output; S54. Calculate the impact of each delivery site construction scenario on the final solution, and based on the impact, use the policy gradient method to update the parameters of the delivery site construction scenario importance scoring model.
4. The artificial intelligence driven two-stage stochastic programming problem solving method according to claim 3, It is characterized in that The method also includes adjusting the generation frequency of the new decision variables in step S42, specifically: S421. Build resource monitoring tools to monitor current CPU and memory usage; S422: If the CPU or memory usage exceeds the preset warning line, the frequency of generating new decision variables is reduced; if the CPU or memory usage is lower than the preset warning line, the frequency of generating new decision variables is increased.
5. The artificial intelligence driven two-stage stochastic programming problem solving method according to claim 3, It is characterized in that Step S34 is further as follows: S341. Construct a cost matrix based on representative delivery station building scenarios; S342, initializing the parameters of the Sinkhorn algorithm, and performing iterative calculation of the parameters using the Sinkhorn algorithm based on the cost matrix to obtain updated parameters; S343, calculating a transshipment plan matrix based on the updated parameters and cost matrix; S344. Extract the sorting results from the transfer plan matrix, i.e., the representative distribution station establishment scenarios after sorting.
6. Two-stage stochastic programming problem solving system driven by artificial intelligence, It is characterized in that include: at least one processor; as well as, a memory communicatively connected to at least one of the processors; wherein, The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the artificial intelligence driven two-stage stochastic programming problem solving method described in any one of claims 1 to 5.
Citation Information
Patent Citations
Distributed new energy, energy storage and power distribution network planning method considering flexible investment
CN112217202A
Collaborative design management platform building system based on XDB file under BS architecture
CN112651711A
Information acquisition method, device and system
CN114731341A
Multi-region wind power output scene generation method and device
CN115187426A
Electric vehicle battery swap station site selection path optimization method considering multi-site capacity design
CN115879657A
