[go: up one dir, main page]

CN118551940B - Method and system for solving two-stage stochastic programming problem driven by artificial intelligence - Google Patents

Method and system for solving two-stage stochastic programming problem driven by artificial intelligence Download PDF

Info

Publication number
CN118551940B
CN118551940B CN202410996718.4A CN202410996718A CN118551940B CN 118551940 B CN118551940 B CN 118551940B CN 202410996718 A CN202410996718 A CN 202410996718A CN 118551940 B CN118551940 B CN 118551940B
Authority
CN
China
Prior art keywords
distribution
scene
graph
constructing
building
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410996718.4A
Other languages
Chinese (zh)
Other versions
CN118551940A (en
Inventor
张一帆
吴洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongke Nanjing Artificial Intelligence Innovation Research Institute
Institute of Automation of Chinese Academy of Science
Original Assignee
Zhongke Nanjing Artificial Intelligence Innovation Research Institute
Institute of Automation of Chinese Academy of Science
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongke Nanjing Artificial Intelligence Innovation Research Institute, Institute of Automation of Chinese Academy of Science filed Critical Zhongke Nanjing Artificial Intelligence Innovation Research Institute
Priority to CN202410996718.4A priority Critical patent/CN118551940B/en
Publication of CN118551940A publication Critical patent/CN118551940A/en
Application granted granted Critical
Publication of CN118551940B publication Critical patent/CN118551940B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/042Knowledge-based neural networks; Logical representations of neural networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Human Resources & Organizations (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Biomedical Technology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computational Linguistics (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Educational Administration (AREA)
  • Game Theory and Decision Science (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明公开了一种人工智能驱动的两阶段随机规划问题求解方法和系统,包括:采集配送建站数据,构建两阶段随机规划问题的数学模型;基于数学模型生成配送建站场景集合,将数学模型转换为图形结构;基于图形结构,构建分层图卷积网络,从分层图卷积网络中提取配送建站场景的关键信息,基于关键信息,构建配送建站场景相似度图;基于配送建站场景相似度图,构建配送建站场景重要性评分模型,评估配送建站场景的重要性,并选择出代表性配送建站场景,对代表性配送建站场景进行排序;基于排序后的代表性配送建站场景,构建确定性等价问题,对确定性等价问题进行求解,得到配送建站解决方案。提高了配送建站等两阶段规划问题的求解效率。

The present invention discloses an artificial intelligence-driven two-stage random programming problem solving method and system, including: collecting distribution station construction data, constructing a mathematical model of the two-stage random programming problem; generating a distribution station construction scene set based on the mathematical model, and converting the mathematical model into a graph structure; constructing a layered graph convolution network based on the graph structure, extracting key information of the distribution station construction scene from the layered graph convolution network, and constructing a distribution station construction scene similarity graph based on the key information; constructing a distribution station construction scene importance scoring model based on the distribution station construction scene similarity graph, evaluating the importance of the distribution station construction scene, and selecting representative distribution station construction scenes, and sorting the representative distribution station construction scenes; constructing a deterministic equivalence problem based on the sorted representative distribution station construction scenes, solving the deterministic equivalence problem, and obtaining a distribution station construction solution. The efficiency of solving two-stage planning problems such as distribution station construction is improved.

Description

人工智能驱动的两阶段随机规划问题求解方法和系统Artificial intelligence driven two-stage stochastic programming problem solving method and system

技术领域Technical Field

本发明属于人工智能领域,公开了一种人工智能驱动的两阶段随机规划问题求解方法和系统。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

近些年,基于神经网络、深度学习等人工智能方法在图像分析、自然语言处理等难以被形式化构建的任务上取得了的成功。相比之下,运筹学方法为规划、调度等易于形式化但求解困难的领域提供了有效的解决方案。基于两者各自的优势,一些结合深度学习和运筹学方法的工作在旅行商、车辆路径规划、负载均衡等任务上取得了超越已有算法的效果。然而,大部分研究集中在确定性问题上,鲜有工作关注到另一类广泛存在的现象-不完美信息下的组合优化问题。这类问题的信息会在决策过程中被逐步揭示,仅当问题被完全解决后,完整的信息才能被获知。在求解时,需要仅根据部分信息做出决策,不单要最大化预期收益,还必须满足已知的要求。类似的信息不完全情况在实际场景如容量调度、路线规划等任务中普遍存在。除了对解决方案的要求,这类任务往往还具备实时性,需要模型在短时间内给出反应。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.

在运筹学中,不完美信息下的组合优化往往被建模成两阶段的随机规划问题,随着场景数的增加,问题的规模(即决策变量的数目和约束的数目)线性增大,求解扩展形式极为困难。为了应对这一挑战,场景缩减技术被广泛采用,它利用问题本身的信息来挑选最具代表性的少量场景。通过利用这些场景避免了对大规模问题的计算。但是已有的场景缩减方法往往聚焦于理论上的结果,如方法在近似比等指标上的理论保证,并不能真正应用于实际问题的求解,比如配送建站问题。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

发明目的,提供一种人工智能驱动的两阶段随机规划问题求解方法和系统,以解决现有技术存在的上述问题。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.

技术方案,提供一种人工智能驱动的两阶段随机规划问题求解方法,包括如下步骤:The technical solution provides an artificial intelligence-driven two-stage stochastic programming problem solving method, including the following steps:

步骤S0、采集配送建站数据,构建两阶段随机规划问题的数学模型;其中配送建站数据包括确定性参数、随机参数、决策时间点和决策变量;其中,确定性参数包括:可建设站点数量、最大可建设站点数量、各站点到小区的运输距离矩阵,以及各站点的货物容量向量;随机参数包括各小区的客户需求向量;决策时间点包括站点建设决策时刻和货物配送决策时刻;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;

步骤S1、基于数学模型生成配送建站场景集合,在每个配送建站场景中,将数学模型转换为图形结构;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;

步骤S2、基于图形结构,构建分层图卷积网络,从分层图卷积网络中提取配送建站场景的关键信息,基于关键信息,构建配送建站场景相似度图;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;

步骤S3、基于配送建站场景相似度图,构建配送建站场景重要性评分模型,评估配送建站场景的重要性,并选择出代表性配送建站场景,对代表性配送建站场景进行排序;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;

步骤S4、基于排序后的代表性配送建站场景,构建确定性等价问题,对确定性等价问题进行求解,得到配送建站解决方案,从配送建站解决方案中提取关键决策信息;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;

步骤S5、基于关键决策信息,构建配送建站解决方案评估工具,使用配送建站解决方案评估工具在随机生成的配送场景中评估配送建站解决方案的质量,基于评估的结果,更新配送建站场景重要性评分模型的参数。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.

根据本申请的另一个方面,还提供人工智能驱动的两阶段随机规划问题求解系统,包括:According to another aspect of the present application, an artificial intelligence-driven two-stage stochastic programming problem solving system is also provided, comprising:

至少一个处理器;以及,at least one processor; and,

与至少一个所述处理器通信连接的存储器;其中,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 of the above technical solutions.

有益效果,针对配送建站问题、打车问题、配电站布局问题、水电站布局问题等等,本发明相比于传统方法仅关注理论上的近似比等指标,通过实际场景的生成和评估,确保了其在实际问题求解中的有效性;通过简化原始随机规划问题的求解过程,提高了求解效率;通过选择代表性配送建站场景,保留了问题的关键特征的同时减少了计算复杂度。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

图1为本发明的流程图。FIG. 1 is a flow chart of the present invention.

图2为本发明步骤S1的流程图。FIG. 2 is a flow chart of step S1 of the present invention.

图3为本发明步骤S2的流程图。FIG. 3 is a flow chart of step S2 of the present invention.

图4为本发明步骤S3的流程图。FIG. 4 is a flow chart of step S3 of the present invention.

图5为本发明步骤S4的流程图。FIG. 5 is a flow chart of step S4 of the present invention.

图6为本发明步骤S5的流程图。FIG. 6 is a flow chart of step S5 of the present invention.

具体实施方式DETAILED DESCRIPTION

结合某一场景来描述技术方案和技术细节。Describe the technical solution and technical details in conjunction with a certain scenario.

某地可以在4个地点建设物流站点,所有站点负责此地客户的货物配送需求。在设定时已知如下信息:由于资金限制,最多只能建造两个站点,4个地点到此地小区的运输距离,可以理解为运输成本;物流站点的货物容量。但是客户的需求并不清楚,无法通过提前查询知晓,而且客户的需求也会随时间变化,比如某些小区可能还没有完成入住,要在客户需求已知的情况下,在符合已知信息的情况下,做出决策,最小化建设和运输(预期)的总成本。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).

在建模时,战略层:4个地点对应着 4个决策,是否在第i个地点设立站点;要满足的约束有至多建造2个。在设立并运营后,则面临着战术层的决策,哪个站点向哪个小区供给多少货物,要满足的约束包括:客户的需求被满足;站点的配送货物总数小于等于其容量,同时要尽可能减少运输成本。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 stations 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.

将上述问题抽象为背景的问题后,通过人工智能的方法进行解决,具体提供了如下的解决方案。为了表述简要,一些配送建站场景,简化为场景,配送建站解决方案,简化为解决方案或方案。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.

字符说明如下:F表示两阶段随机规划问题的数学模型;X,Y表示分别表示第一阶段和第二阶段的决策变量集合;C表示约束集合;f(X,Y)表示目标函数;δ = {ξ1,ξ2,...,ξN}表示场景集合,N为场景总数;G = (V,E)表示问题的二部图表示;V = VX ∪ VY ∪ VC表示图的节点集,包括决策变量节点和约束节点;wij表示边的权重,表示变量在约束中的系数;Φ(·)表示非线性特征变换函数;H-GCN表示分层图卷积网络;h(v)表示节点嵌入;e(ξi)表示场景嵌入;Enc(·),Dec(·)表示编码器和解码器函数;Z表示隐空间;I(·;·)表示互信息;β表示信息瓶颈方法中的权衡参数;z*表示信息压缩后的场景表示;GS表示场景相似度图;γ表示核函数参数;∑表示协方差矩阵;s(zi*)表示场景重要性得分;k(·,·)表示RBF核函数;I表示选中的场景索引集;K表示选择的场景数量;C表示Sinkhorn算法中的成本矩阵;P表示Sinkhorn算法得到的排序矩阵;P'表示缩减后的确定性等价问题;wi表示场景权重;λ表示对偶信息;V(X,ξ)表示神经网络逼近器,用于估计第二阶段价值函数;ε表示最优间隙阈值;Ii表示场景影响度;∧表示所有。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.

如图1所示,本申请提出了一种人工智能驱动的两阶段随机规划问题求解方法,包括如下步骤:As shown in FIG1 , the present application proposes an artificial intelligence-driven two-stage stochastic programming problem solving method, comprising the following steps:

步骤S0、采集配送建站数据,构建两阶段随机规划问题的数学模型;其中配送建站数据包括确定性参数、随机参数、决策时间点和决策变量;其中,确定性参数包括:可建设站点数量、最大可建设站点数量、各站点到小区的运输距离矩阵,以及各站点的货物容量向量;随机参数包括各小区的客户需求向量;决策时间点包括站点建设决策时刻和货物配送决策时刻;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;

步骤S1、基于数学模型生成配送建站场景集合,在每个配送建站场景中,将数学模型转换为图形结构;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;

步骤S2、基于图形结构,构建分层图卷积网络,从分层图卷积网络中提取配送建站场景的关键信息,基于关键信息,构建场景相似度图;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;

步骤S3、基于配送建站场景相似度图,构建配送建站场景重要性评分模型,评估配送建站场景的重要性,并选择出代表性配送建站场景,对代表性配送建站场景进行排序;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;

步骤S4、基于排序后的代表性配送建站场景,构建确定性等价问题,对确定性等价问题进行求解,得到配送建站解决方案,从配送建站解决方案中提取关键决策信息;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;

步骤S5、基于关键决策信息,构建配送建站解决方案评估工具,使用配送建站解决方案评估工具在随机生成的配送场景中评估配送解决方案的质量,基于评估的结果,更新配送建站场景重要性评分模型的参数。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.

在本实施例中,通过构建一个完整的人工智能驱动的两阶段随机规划问题求解方法,实现了高效、准确的问题求解。首先,通过将配送建站的现实问题转化为数学模型,为后续处理奠定了基础。在生成配送建站场景集合时,将数学模型转换为图形结构,得问题可以被图神经网络处理,从而充分利用了图结构数据的特性。通过构建分层图卷积网络,方案能够有效地从复杂的场景中提取关键信息,该方法相比传统的特征提取方法,能够更好地捕捉场景间的内在关系。基于提取的关键信息构建场景相似度图,进一步增强了对场景间关系的理解。引入场景重要性评分模型,不仅能够评估场景的重要性,还能选择出具有代表性的场景,这减少了需要处理的场景数量,提高了计算效率。对代表性配送建站场景的排序进一步优化了问题的求解过程。通过构建确定性等价问题并求解,方法能够在复杂的随机环境中得到高质量的解决方案。最后,通过构建方案评估工具并在随机生成的场景中评估解决方案的质量,实现了解决方案的持续优化。通过不断更新场景重要性评分模型的参数,使得方法能够自适应地改进其性能。这种综合性的方法不仅能够有效处理配送建站的两阶段随机规划问题,还具有可扩展性和适应性,可以应用于各种复杂的决策问题中。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 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.

在本实施例中,通过预配置的数学模型生成场景集合,并将每个场景转换为图形结构,这样可以将复杂的随机规划问题转化为更易于处理的图形表示形式。图形结构能够更直观地展示问题中的关系和依赖性,有助于后续的图卷积网络处理。基于图形结构构建分层图卷积网络(Hierarchical Graph Convolutional Network,HGCN)。HGCN能够有效地提取图形中的关键信息,捕捉不同层次的特征。这样能够提高模型对场景的理解能力,从而为后续的相似度计算和重要性评估提供更准确的信息。基于提取的关键信息构建场景相似度图,并进一步构建场景重要性评分模型。相似度图能够帮助识别和聚类相似场景,从而减少冗余计算。重要性评分模型则通过评估场景的重要性,选择出具有代表性的场景进行排序,这样能够显著减少计算复杂度,提高求解效率。基于排序后的代表性配送建站场景构建确定性等价问题,并进行求解,通过这种方式,可以将原本复杂的随机规划问题转化为一系列确定性问题,从而简化求解过程。基于关键决策信息构建方案评估工具,并在随机生成的场景中评估解决方案的质量,可以动态调整和优化场景重要性评分模型的参数,从而不断提高模型的准确性和鲁棒性。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-making 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.

总之,本实施例不仅提高了求解效率,还能够在动态环境中不断优化和调整模型,具有较高的实用价值和应用前景。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.

在具体的实施例中,根据本申请的一个方面,步骤S0进一步为:In a specific embodiment, according to one aspect of the present application, step S0 further comprises:

S01、收集问题的基本信息,获取可建设站点的数量,得到总站点数为4个;获取资金限制信息,得到最多可建设2个站点;获取各站点到小区的运输距离数据,形成一个运输距离表;获取各站点的货物容量数据,形成一个站点容量列表。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.

S02、确定第一阶段决策内容,创建一个包含4个元素的列表,每个元素代表一个潜在的站点;将每个元素设置为可选择“建设”或“不建设”两种状态之一。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".

S03、确定第二阶段决策内容,创建一个二维表格,行代表站点,列代表小区;表格中的每个单元格表示从特定站点向特定小区配送的货物量。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.

S04、设置问题的限制条件,根据资金限制,设置最多选择2个站点进行建设的条件;根据客户需求,设置每个小区必须得到足够货物配送的条件;根据站点容量,设置每个站点的配送总量不超过其容量的条件。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.

S05、构建成本计算方法,创建一个函数,用于计算站点建设的总成本;创建另一个函数,用于计算货物配送的总成本,将这两个函数结合,形成一个总成本计算函数。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.

S06、形成完整的决策模型,将第一阶段的站点建设决策与第二阶段的货物配送决策整合在一起;设置模型的目标为最小化总成本计算函数的结果,将之前设置的所有限制条件应用到这个整合后的模型中。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.

如上文所述的场景,对其识别问题的关键要素,确定性参数为a1,a2,...,am,其中a1为可建设站点数量 (4个);a2为最大可建设站点数量 (2个);a3为各站点到小区的运输距离矩阵 D (4×m,m为小区数量);a4为各站点的货物容量向量 C (4×1)。随机参数为b1(ω),b2(ω),...,bn(ω),其中ω表示随机事件;b1(ω)表示各小区的客户需求向量 R(ω) (m×1)。决策时间点:分为t1 (第一阶段)和 t2 (第二阶段);t1表示站点建设决策,t2表示货物配送决策。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.

选择第一阶段决策变量。识别在t1时刻必须做出的决策: x1,x2,...,xp,这些决策通常涉及长期策略、资源分配或设施布局等;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;

选择第二阶段决策变量。识别在t2时刻,根据随机事件ω的实现后做出的决策:y1(ω),y2(ω),...,yq(ω),这些决策通常涉及短期操作、调度或应急措施等。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.

构建约束条件。第一阶段约束为: g1(x) ≤ 0,g2(x) ≤ 0,...,gr(x) ≤ 0;第二阶段约束为: h1(x,y,ω) ≤ 0,h2(x,y,ω) ≤ 0,...,hs(x,y,ω) ≤ 0。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.

构建目标函数:Construct the objective function:

f(x,y,ω) = cTx + Q(x,ω);f(x,y,ω) = c T x + Q(x,ω);

其中Q(x,ω) = min{q(ω)T y | h(x,y,ω) ≤ 0};where Q(x, ω) = min{q(ω) T y | h(x, y, ω) ≤ 0};

构建完整的两阶段随机规划模型:Construct the complete two-stage stochastic programming model:

minx {cT x + Eω[Q(x,ω)]};min x {c T x + E ω [Q(x, ω)]};

s.t. g(x)≤0,x∈X。s.t. g(x)≤0, x∈X.

在另一个实施例中,选择第一阶段决策变量:In another embodiment, the first stage decision variables are selected:

x = [x1,x2,x3,x4];x = [x1, x2, x3, x4];

其中xi∈{0,1},表示是否在第i个地点建设站点;Where xi∈{0,1}, indicates whether to build a site at the i-th location;

选择第二阶段决策变量:Select the second-stage decision variables:

y(ω) = [yij(ω)];y(ω) = [yij(ω)];

其中yij(ω)表示在场景ω下,从站点i向小区j配送的货物量;Where yij(ω) represents the amount of goods delivered from site i to cell j in scenario ω;

构建约束条件,第一阶段约束:Construct constraints, first stage constraints:

g1(x): ∑ixi≤2(最多建造2个站点);g1(x): ∑ i xi≤2 (at most 2 sites can be built);

第二阶段约束:Second stage constraints:

h1(x,y,ω): ∑i yij(ω) = Rj(ω),∧j (满足客户需求);h1(x,y,ω): ∑ i yij(ω) = Rj(ω), ∧j (meet customer needs);

h2(x,y,ω): ∑j yij(ω) ≤ Ci·xi,∧i (站点容量限制);h2(x,y,ω): ∑ j yij(ω) ≤ Ci·xi, ∧i (site capacity limit);

构建目标函数:Construct the objective function:

f(x,y,ω) =∑i fi·xi +∑ij dij·yij(ω);f(x, y, ω) =∑ i fi·xi +∑ ij dij·yij(ω);

其中,fi为建设第i个站点的成本,dij为从站点i到小区j的单位运输成本;Among them, fi is the cost of building the i-th site, dij is the unit transportation cost from site i to cell j;

构建完整的两阶段随机规划模型:Construct the complete two-stage stochastic programming model:

minx {∑i fi·xi + Eω[Q(x,ω)]};min x {∑ i fi·xi + E ω [Q(x, ω)]};

s.t. ∑i xi ≤ 2;st ∑ i xi ≤ 2;

xi∈{0,1},∧i;xi∈{0,1},∧i;

where Q(x,ω) = miny {∑ij dij·yij(ω)};where Q(x,ω) = min y {∑ ij dij·yij(ω)};

s.t. ∑i yij(ω) = Rj(ω),∧j;st ∑ i yij(ω) = Rj(ω), ∧j;

j yij(ω) ≤ Ci·xi,∧i;j yij(ω) ≤ Ci·xi,∧i;

yij(ω) ≥ 0,∧i,j。yij(ω) ≥ 0, ∧i,j.

如图2所示,根据本申请的一个方面,步骤S1进一步为:As shown in FIG. 2 , according to one aspect of the present application, step S1 further comprises:

步骤S11、获取预配置的两阶段随机规划问题的数学模型,包括决策变量集合、约束集合和目标函数;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;

步骤S12、基于数学模型,使用随机数生成器,生成场景集合;Step S12: Generate a scene set using a random number generator based on a mathematical model;

步骤S13、在每个配送建站场景中,基于数学模型,构建二部图表示的图形结构;Step S13: In each delivery station construction scenario, a graph structure represented by a bipartite graph is constructed based on a mathematical model;

步骤S14、使用非线性特征变换将二部图表示的图形结构映射到高维特征空间。Step S14: Use nonlinear feature transformation to map the graph structure represented by the bipartite graph to a high-dimensional feature space.

在本实施例中,读取创建的决策模型,包括站点建设和货物配送的决策变量、限制条件和成本计算函数。生成可能的客户需求场景,使用随机数生成器,创建多组不同的客户需求数据,每组代表一个可能的场景,将生成的场景数据存储在一个场景列表中,以便后续使用。将决策模型转换为一个图形结构,其中节点表示决策变量和限制条件。在图中添加连接线,表示决策变量和限制条件之间的关系。为每个连接线分配权重,反映决策变量在限制条件中的重要性。使用一个预先训练的图神经网络,处理创建的图形结构,获取图神经网络的输出,作为问题的增强特征表示。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.

在另一个实施例中,首先进行问题初始化与数据预处理,输入建模的数学模型F,包含决策变量集合X、Y,约束集合C,目标函数 f(X,Y)。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).

然后,生成场景集合δ= {ξ1,ξ2,...,ξN},其中N为场景总数,每个场景ξi包含随机参数值。使用蒙特卡洛方法生成N个客户需求向量 R(ω),可以假设每个小区的需求服从正态分布N(μj,σj2);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, and it can be assumed that the demand of each cell follows a normal distribution N(μj, σj 2 );

构建问题的二部图表示 G = (V,E),V = VX∪VY∪VC,其中VX为4个节点,表示第一阶段决策变量节点;VY为4m个节点,表示第二阶段决策变量节点(每个站点到每个小区),VC表示2+m+4个约束节点,包括最大建设数量约束、需求满足约束和容量约束;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;

连接决策变量节点和相关约束节点为:E = {(vi,vj) | vi∈VX∪VY,vj∈VC};Connect the decision variable nodes and related constraint nodes as follows: E = {(vi, vj) | vi∈VX∪VY, vj∈VC};

边权重wij为变量在约束中的系数值;The edge weight wij is the coefficient value of the variable in the constraint;

应用非线性特征变换Φ(G),将二部图G映射到高维特征空间:G' =Φ(G),使用图神经网络(如GraphSAGE)对图结构进行编码。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.

在本实施例中,首先,通过获取预配置的数学模型,包括决策变量集合、约束集合和目标函数,为整个求解过程提供了清晰的数学基础。这种预配置模型的使用提高了方法的通用性,使其能够适应不同类型的两阶段随机规划问题。使用随机数生成器来生成场景集合,该方法能够有效模拟现实世界中的不确定性,提高了问题求解的鲁棒性。将数学模型转换为二部图表示的图形结构是一个关键的创新点,这种转换使得复杂的数学问题可以用图的形式直观地表示出来,为后续的图神经网络处理奠定了基础。通过使用非线性特征变换将二部图映射到高维特征空间,进一步增强了模型捕捉复杂关系的能力。这种非线性变换能够揭示数据中的非线性模式,使得后续的学习算法能够更好地理解和处理问题。整个过程不仅提高了问题表示的效率,还增强了模型对复杂关系的理解能力,从而为后续的场景分析和问题求解提供了高质量的输入数据。该方法的优势在于它能够将复杂的随机规划问题转化为可以被现代机器学习算法有效处理的形式,从而提高了问题求解的效率和准确性。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. By mapping the bipartite graph to a high-dimensional feature space using a nonlinear feature transformation, the model's ability to capture complex relationships is further enhanced. 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.

如图3所示,根据本申请的一个方面,步骤S2进一步为:As shown in FIG3 , according to one aspect of the present application, step S2 further comprises:

步骤S21、基于图形结构,构建分层图卷积网络;Step S21, constructing a layered graph convolutional network based on the graph structure;

步骤S22、压缩分层图卷积网络中的配送建站场景特征,基于压缩后的配送建站场景特征,使用变分信息瓶颈方法提取场配送建站景的关键信息;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;

S23、计算所有配送建站场景的关键信息之间的相似度矩阵,基于相似度矩阵,构建邻接矩阵,对邻接矩阵进行归一化;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、基于归一化后的邻接矩阵,构建配送建站场景相似度图。S24. Based on the normalized adjacency matrix, a distribution site construction scenario similarity graph is constructed.

在本实施例中,构建多层次的图形处理网络,具体创建一个多层图形卷积网络,用于处理每个客户需求场景,使用注意力机制,对每个场景的节点信息进行加权汇总,构建场景之间的关系图,再次应用图形卷积操作。压缩场景特征信息,需要构建一个编码器网络,将场景特征转换为压缩形式;构建一个解码器网络,尝试从压缩形式还原原始特征,通过多次训练,优化编码器和解码器,使它们能高效地压缩和还原场景特征。提取场景的关键信息,具体为构建一个信息提取器,从压缩后的场景特征中筛选出最重要的信息,使用变分推断方法,平衡信息的保留和压缩程度,获取每个场景的最小化关键信息表示。最后建立场景间的相似关系图,计算所有场景关键信息之间的相似度,基于相似度,为每个场景找出最相近的几个邻居场景,创建一个图形结构,用节点表示场景,用连线表示场景间的相似关系。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.

步骤S22中压缩分层图卷积网络中的场景特征,进一步为:The scene features in the compressed layered graph convolutional network in step S22 are further:

S221、使用编码器将分层图卷积网络中的场景特征映射到隐空间,得到隐变量;S221. Use an encoder to map scene features in the layered graph convolutional network to a latent space to obtain latent variables.

S222、使用解码器将隐变量重构为新场景特征,计算场景特征和新场景特征之间的重构误差;S222, using the decoder to reconstruct the latent variables into new scene features, and calculating the reconstruction error between the scene features and the new scene features;

S223、计算隐变量分布与预设目标分布之间的沃瑟斯坦距离,将重构误差和沃瑟斯坦距离加权求和,作为损失函数;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、通过反向传播算法,最小化损失函数,优化编码器和解码器的参数;S224, minimizing the loss function and optimizing the parameters of the encoder and decoder through the back propagation algorithm;

S225、使用优化后的编码器和解码器压缩分层图卷积网络中的场景特征。S225. Use optimized encoders and decoders to compress scene features in layered graph convolutional networks.

在进一步的实施例中,构建分层图卷积网络H-GCN,底层GCN为对每个场景ξi 的二部图G'i进行卷积,得到节点嵌入h(v);中间池化层为对节点嵌入进行注意力加权平均,得到场景嵌入e(ξi);顶层 GCN为以场景为节点构建完全图,边权重为场景嵌入的余弦相似度,再次应用GCN。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 similarity of the scene embeddings, and GCN is applied again.

使用Wasserstein自编码器对场景嵌入进行压缩与重构,编码器为3层全连接网络Enc(e(ξi)),将场景嵌入映射到隐空间Z;解码器为3层全连接网络Dec(z),将隐变量重构为场景嵌入;最小化重构误差与 Wasserstein 距离的加权和。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.

应用变分信息瓶颈方法提取场景的最小充分统计量,使用变分推断近似互信息项,设置β=0.01,平衡信息保留和压缩。最大化I(Z; δ) -β·I(Z;e(δ)),其中I为互信息,β为权衡参数,得到信息压缩的场景表示z*。The variational information bottleneck method is applied to extract the minimum sufficient statistics of the scene, and the mutual information term is approximated using variational inference. β=0.01 is set to balance information preservation and compression. Maximize I(Z; δ) -β·I(Z; e(δ)), where I is the mutual information and β is the trade-off parameter, to obtain the information compressed scene representation z*.

最后,构建场景相似度图GS,使用RBF核函数计算场景表示间的相似度,设置γ=0.1作为核函数参数,节点为压缩后的场景表示z*,边权重为核化的Mahalanobis距离: w(zi*,zj*) = exp(-γ(zi*-zj*)T∑-1(zi*-zj*))。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*)).

在本实施例中,首先,使用编码器将分层图卷积网络中的场景特征映射到隐空间,得到隐变量,这种做法能够将高维的场景特征压缩到低维空间,减少了数据的复杂度。使用解码器将隐变量重构为新场景特征,并计算场景特征和新场景特征之间的重构误差,这种自编码器结构不仅能够压缩数据,还能保证压缩后的数据仍然保留原始数据的关键信息。计算隐变量分布与预设目标分布之间的沃瑟斯坦距离,这是一个重要的创新点。沃瑟斯坦距离能够度量两个概率分布之间的差异,通过最小化这个距离,可以使得压缩后的特征分布更接近预期的分布,从而提高特征的质量和可解释性。将重构误差和沃瑟斯坦距离加权求和作为损失函数,这种做法在信息保留和分布匹配之间取得了平衡。通过反向传播算法最小化损失函数,优化编码器和解码器的参数,这个过程使得整个压缩模型能够自适应地学习最优的压缩策略。最后,使用优化后的编码器和解码器压缩分层图卷积网络中的场景特征,得到高质量的压缩特征。整个过程不仅实现了高效的特征压缩,还保证了压缩后的特征仍然保留了原始数据的关键信息。该方法的优势在于它能够在大幅度减少数据维度的同时,最大程度地保留有用信息,从而为后续的场景分析和问题求解提供高质量的输入数据。同时,通过引入沃瑟斯坦距离,方法还提高了压缩特征的可解释性和泛化能力。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 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.

进一步的,步骤S22中,应用变分信息瓶颈方法提取场景的最小充分统计量,获得关键信息的过程,具体为: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:

步骤S221、构建编码器网络q(z|e),输入场景嵌入e(ξi)和维度为de,构建两层全连接网络:FC(de,dh) 、ReLU 、 FC(dh,2*dz),输出均值μ和对角协方差矩阵Σ的参数,总维度为dz。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.

步骤S222、构建预测器网络p(ξ|z),以潜在变量z和维度为dz作为输入;Step S222, construct a predictor network p(ξ|z) with latent variable z and dimension dz as input;

包括两层全连接网络,FC(dz,dh) 、 ReLU 、FC(dh,dξ)。输出重构的场景参数ξ'和维度为dξ。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ξ.

步骤S223、计算变分信息瓶颈损失,具体过程如下:Step S223: Calculate the variational information bottleneck loss. The specific process is as follows:

对于每个场景ξi,从q(z|e(ξi))中采样K次,得到{zk}k=1KFor each scene ξi, sample K times from q(z|e(ξi)) to obtain {zk}k=1 K ;

计算重构误差Lrec = 1/K * Σk ||ξi - p(zk)||2Calculate the reconstruction error Lrec = 1/K * Σk ||ξi - p(zk)|| 2 ;

计算KL散度LKL = KL(q(z|e(ξi)) || N(0,I));Calculate the KL divergence L KL = KL(q(z|e(ξi)) || N(0, I));

计算总损失,LVIB = Lrec + β * LKL,其中β为权衡参数;Calculate the total loss, L VIB = Lrec + β * L KL , where β is the trade-off parameter;

步骤S224、使用Adam优化器最小化LVIB,具体如下:Step S224: Use the Adam optimizer to minimize L VIB , as follows:

设置学习率lr = 0.001,迭代次数maxiter = 1000;Set the learning rate lr = 0.001 and the number of iterations maxiter = 1000;

对每个最小批次,计算LVIB,计算梯度∇LVIB;并更新编码器和预测器参数。For each mini-batch, L VIB is computed, the gradient ∇L VIB is computed; and the encoder and predictor parameters are updated.

步骤S225、提取最小充分统计量,具体为:对每个场景ξi,使用训练好的编码器q(z|e(ξi))得到zi*。Step S225, extracting the minimum sufficient statistics, specifically: for each scene ξi, using the trained encoder q(z|e(ξi)) to obtain zi*.

步骤S24中,构建场景相似度图GS的过程,具体包括如下步骤:In step S24, the process of constructing the scene similarity graph GS specifically includes the following steps:

步骤S241、计算场景表示间的相似度矩阵S,即对于每对场景表示(zi*,zj*),计算欧氏距离:dij = ||zi* - zj*||2;应用RBF核函数Sij = exp(-γ * dij2),其中γ = 0.1。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.

步骤S242、构建K近邻图,具体为:对每个场景zi*,找到K个最相似的场景(K =10)。创建邻接矩阵A:如果j是i的K近邻之一,则Aij = Sij,否则Aij = 0。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.

步骤S243、归一化邻接矩阵,具体为:Step S243, normalizing the adjacency matrix, specifically:

计算度矩阵Dii = Σj Aij;计算归一化邻接矩阵Anorm = D(-1/2) * A * D (-1/2)Calculate the degree matrix Dii = ΣjAij ; calculate the normalized adjacency matrixAnorm = D (-1/2) *A*D (-1/2) .

步骤S244、构建场景相似度图GS,包括:节点,各场景表示zi*;边,根据Anorm,连接有非零值的节点对;边权重,对应的Anormij值。Step S244, construct a scene similarity graph GS, including: nodes, each scene representation zi*; edges, according to Anorm, connecting node pairs with non-zero values; edge weights, corresponding Anorm ij values.

在本实施例中,首先,基于图形结构构建分层图卷积网络,这种网络结构能够有效地捕捉场景中的层次化信息,相比传统的特征提取方法,更能反映场景的复杂结构。引入压缩技术来处理分层图卷积网络中的场景特征,这种做法不仅减少了数据的维度,还保留了关键信息,提高了后续处理的效率。使用变分信息瓶颈方法提取场景的关键信息是另一个重要的创新点,该方法能够在保留必要信息的同时最大程度地压缩数据,从而在信息保留和计算效率之间取得平衡。通过计算所有场景的关键信息之间的相似度矩阵,方法能够全面地分析场景间的关系。基于相似度矩阵构建邻接矩阵并进行归一化,这一步骤不仅考虑了场景间的相似性,还通过归一化处理使得不同场景的影响力更加均衡。最后,基于归一化后的邻接矩阵构建场景相似度图,这种图结构直观地表示了场景间的关系,为后续的场景选择和排序提供了坚实的基础。整个过程不仅高效地提取了场景的关键特征,还建立了场景间的关系网络,这对于理解和处理复杂的随机规划问题至关重要。该方法的优势在于它能够在保留关键信息的同时大幅度降低数据的复杂性,从而使得后续的处理更加高效和准确。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.

如图4所示,步骤S3进一步为:As shown in FIG4 , step S3 further comprises:

S31、基于场景相似度图,构建基于图注意力网络的场景重要性评分模型,评估每个配送建站场景的重要性;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;

S32、基于每个配送建站场景的重要性,构建核矩阵,计算核矩阵的特征分解;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、基于特征分解,使用行列式点过程对核矩阵进行采样,得到预定个代表性配送建站场景;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、使用辛克霍恩算法对代表性配送建站场景进行排序,得到排序后的代表性配送建站场景。S34. Use the Sinkhorn algorithm to sort the representative delivery station construction scenarios to obtain sorted representative delivery station construction scenarios.

在本实施例中,首先,基于场景相似度图构建基于图注意力网络的场景重要性评分模型,这是一个重要的创新点。图注意力网络能够自适应地学习不同场景之间的关系重要性,从而更准确地评估每个场景的重要性。该方法相比传统的重要性评估方法,能够更好地捕捉场景间的复杂相互作用。基于每个场景的重要性构建核矩阵,并计算核矩阵的特征分解,这一步骤为后续的场景选择提供了数学基础。使用行列式点过程对核矩阵进行采样,该方法不仅能够选择重要的场景,还能确保选择的场景集合具有多样性,避免了信息的冗余。通过预定个数的采样,方法能够灵活地控制代表性配送建站场景的数量,在计算效率和信息完整性之间取得平衡。最后,使用辛克霍恩算法对代表性配送建站场景进行排序,这是另一个创新点。辛克霍恩算法能够在保持场景多样性的同时,优化场景的排序,使得后续的问题求解能够更加高效。整个过程不仅高效地评估了场景的重要性,还选择了具有代表性和多样性的场景集合,并对这些场景进行了优化排序。该方法的优势在于它能够在保证信息完整性的同时大幅度减少需要处理的场景数量,从而显著提高后续问题求解的效率。同时,通过优化场景的排序,方法还能进一步提高问题求解的质量。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.

步骤S32中构建核矩阵并进行核矩阵的特征分解,具体过程为:In step S32, a kernel matrix is constructed and eigendecomposition of the kernel matrix is performed. The specific process is as follows:

S321. 构建核矩阵L:S321. Construct the kernel matrix L:

对于每对场景(i,j):Lij = qi * qj * k(zi*,zj*);其中qi = s(zi*)为场景重要性得分,k(·,·)为RBF核函数。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.

S322. 计算L的特征分解:L = V∏VT,其中∏表示对角矩阵;使用Lanczos算法计算前r个最大特征值和对应的特征向量。S322. Calculate the eigendecomposition of L: L = V∏V T , where ∏ represents a diagonal matrix; use the Lanczos algorithm to calculate the first r largest eigenvalues and corresponding eigenvectors.

步骤S33中,应用行列式点过程(Determinantal Point Process ,DPP)进行多样化场景选择,过程具体如下:In step S33, a determinantal point process (DPP) is applied to perform diversified scene selection, and the specific process is as follows:

初始化:选择集合Y = Ψ,其中Ψ表示初始选择的集合;重复直到|Y| = K:Initialization: Select a set Y = Ψ, where Ψ is the set of initial selections; repeat until |Y| = K:

对每个i ΘY,其中Θ表示不属于,计算:Pi = Σ{λj>0} λj / (λj + 1) * (vjTei)2;以概率 Pi / Σk Pk 选择一个新元素i;更新Y = Y ∪ {i};对于jΘY,更新vj = vj- (vjT ei) * ei / ||ei||2;重新正交化剩余的vj;For each i ΘY, where Θ means not belonging, 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;

返回选中的K个场景索引集合Y。Returns the selected K scene index set Y.

S34、 使用辛克霍恩(Sinkhorn)算法对选中的场景进行排序的过程,具体为:S34, the process of sorting the selected scenes using the Sinkhorn algorithm is as follows:

S341. 构建成本矩阵C:S341. Construct cost matrix C:

对于每对(场景i,位置j):Cij = |i - j| + α * ||zi* - zmean||2For each pair (scene i, location j): Cij = |i - j| + α * ||zi* - zmean|| 2 ;

其中zmean为选中场景的平均表示,α为权衡参数,场景和位置的差值(|i-j|) 以及场景表示与平均表示之间的欧氏距离 ( ||zi* - zmean||2 ),后者乘以一个权衡参数(α)。where zmean is the mean representation of the selected scene, α is a trade-off parameter, the difference between the scene and the location (|ij|) and the Euclidean distance between the scene representation and the mean representation (||zi* - zmean|| 2 ), the latter multiplied by a trade-off parameter (α).

S342. 初始化:u = ones(K) / K,v = ones(K) / K;ε = 0.1(正则化参数),maxiter = 100;S342. Initialization: u = ones(K) / K, v = ones(K) / K; ε = 0.1 (regularization parameter), maxiter = 100;

S343. Sinkhorn迭代:重复直到收敛或达到maxiter:S343. Sinkhorn iteration: repeat until convergence or maxiter is reached:

u = a / (K * exp(C / ε) * v);v = b / (K * exp(C.T / ε) * u);其中a和b为均匀分布向量;u = a / (K * exp(C / ε) * v); v = b / (K * exp(C.T / ε) * u); where a and b are uniformly distributed vectors;

S344. 计算转运计划 T= diag(u) * exp(-C / ε) * diag(v);S344. Calculate the transport plan T = diag(u) * exp(-C / ε) * diag(v);

S345. 从转运计划中提取排序:S345. Extract ranking from transshipment plan:

对于每个位置j,选择Pij最大的场景i;返回排序后的场景索引列表。For each position j, select the scene i with the largest Pij; return the sorted list of scene indices.

根据本申请的一个方面,其中,步骤S34还可以为:According to one aspect of the present application, step S34 may also be:

S341、基于代表性配送建站场景,构建成本矩阵;S341. Construct a cost matrix based on representative delivery station building scenarios;

S342、初始化辛克霍恩算法的参数,基于成本矩阵,对参数进行辛克霍恩算法迭代计算,得到更新后的参数;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、基于更新后的参数和成本矩阵,计算转运计划矩阵;S343, calculating a transfer plan matrix based on the updated parameters and cost matrix;

S344、从转运计划矩阵中提取排序结果,即排序后的代表性配送建站场景。S344. Extract the sorting results from the transfer plan matrix, i.e., the representative distribution station establishment scenarios after sorting.

在进一步的实施例中,基于场景相似度图GS,构建基于图注意力网络(GAT)的场景重要性评分模型,使用多头注意力层计算节点间的注意力系数,具体有2层GAT,每层4个注意力头,使用门控图池化汇聚全局信息,得到每个场景的重要性得分 s(zi*);应用Determinantal Point Process (DPP)选择K=20个场景:构建核矩阵: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:

Lij = s(zi*)·s(zj*)·k(zi*,zj*);Lij = s(zi*)·s(zj*)·k(zi*, zj*);

其中k(zi*,zj*)为RBF核函数,使用快速贪婪算法进行DPP采样,得到K个具有代表性和多样性的场景索引集I。使用Sinkhorn算法对选中的场景进行排序:构建成本矩阵C,Cij表示场景i排在位置j的代价,设置迭代次数为100,正则化参数为0.1,求解离散最优传输问题,得到排序矩阵P。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 Sinkhorn algorithm is used to sort the selected scenes: construct the cost matrix C, Cij represents the cost of scene i in position j, set the number of iterations to 100, the regularization parameter to 0.1, solve the discrete optimal transmission problem, and obtain the sorting matrix P.

在本实施例中,首先,基于代表性配送建站场景构建成本矩阵,这种做法为场景排序提供了量化的评估标准。成本矩阵的构建考虑了场景之间的相似性和差异性,为后续的排序过程提供了全面的信息基础。创新性地初始化辛克霍恩算法的参数,并基于成本矩阵对参数进行迭代计算,该方法能够在保持场景多样性的同时,优化场景的排序。辛克霍恩算法的使用是一个重要的创新点,它能够有效解决大规模的最优传输问题,从而在计算效率和排序质量之间取得良好的平衡。通过多次迭代,算法能够逐步优化参数,使得最终的排序结果更加接近全局最优解。基于更新后的参数和成本矩阵,计算转运计划矩阵,这一步骤将抽象的优化问题转化为具体的排序方案。转运计划矩阵不仅包含了场景的排序信息,还反映了不同场景之间的关联强度。最后,从转运计划矩阵中提取排序结果,得到排序后的代表性配送建站场景。该方法的优势在于它能够同时考虑场景的重要性和多样性,确保排序结果既能反映场景的关键程度,又能保持场景集合的代表性。通过这种优化排序,后续的问题求解过程能够更加高效,因为算法可以优先处理最具代表性和影响力的场景,从而更快地收敛到高质量的解决方案。同时,这种排序方法还具有很强的可扩展性,能够处理大量的场景,适用于复杂的实际问题。总的来说,这种基于辛克霍恩算法的场景排序方法不仅提高了两阶段随机规划问题求解的效率,还增强了解决方案的质量和鲁棒性。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 scenario, 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 scenario. The advantage of this method is that it can simultaneously consider the importance and diversity of the scenario, ensuring that the sorting results can both reflect the criticality of the scenario 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.

如图5所示,根据本申请的一个方面,步骤S4进一步为:As shown in FIG5 , according to one aspect of the present application, step S4 is further as follows:

S41、基于排序后的代表性配送建站场景,构建确定性等价问题;S41. Construct a deterministic equivalence problem based on the sorted representative delivery station building scenarios;

S42、使用列生成方法,动态生成新决策变量,将新决策变量添加到确定性等价问题中,形成添加变量确定性等价问题;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、采用割平面法,加强添加变量确定性等价问题的线性松弛,得到最终确定性等价问题;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、使用分支定价算法,对最终确定性等价问题进行求解,得到解决方案,从解决方案中提取关键决策信息。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.

根据排序后的代表性配送建站场景,构建一个规模较小的决策问题,将原始问题中的约束条件应用到这个简化版问题中,设置简化版问题的目标函数,使其反映原始问题的优化目标。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.

在进一步的实施例中,基于选中的场景构建缩减后的确定性等价问题P',决策变量为x和20组y(ω),约束为原约束在20个选中场景下的实例化,目标函数为: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:

f'(x,{y}) =∑i fi·xi + 1/20 ∑kij dij·yij(ωk);f'(x, {y}) =∑ i fi·xi + 1/20 ∑ kij dij·yij(ωk);

应用定制的分支定价算法求解问题P',使用列生成方法动态生成配送决策变量,采用割平面法加强线性松弛,构建基于强化学习的分支策略。提取第一阶段决策x*(站点建设方案)和对偶信息λ。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.

在另一个实施例中,决策变量为X∪{Yi | i∈I},约束为原约束C在选中场景下的实例化,目标函数为: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:

f'(X,{Yi}) = cTX + ∑i∈I wi·qiTYi;f'(X, {Yi}) = cTX + ∑ i∈I wi·qiTYi;

其中wi为场景权重。Where wi is the scene weight.

根据本申请的另一个方面,还包括对步骤S42中的新决策变量的生成频率进行调整,具体为:According to another aspect of the present application, the generation frequency of the new decision variable in step S42 is also adjusted, specifically:

S421、构建资源监控工具,监控当前的CPU和内存使用;S421. Build resource monitoring tools to monitor current CPU and memory usage;

S422、如果CPU或内存使用超过预设警戒线,则降低新决策变量的生成频率;如果CPU或内存使用低于预设警戒线,则增加新决策变量的生成频率。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.

创建资源监控工具,设置一个资源监控程序,每秒检查一次系统状态。构建CPU和内存使用的警戒线,分别为80%和70%。定期检查资源使用情况,在求解过程的每一轮后,启动资源检查,获取当前的CPU和内存使用百分比。根据资源状况调整计算方式:如果CPU或内存使用超过警戒线,降低新变量生成的频率,提高删除不必要计算的标准,减少同时进行的计算任务数量;如果资源使用远低于警戒线,增加新变量生成的频率,降低删除计算的标准,增加同时进行的计算任务数量。更新计算参数,将调整后的参数应用到求解程序中。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 new variable generation, 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 new variable generation, 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.

在具体的实施例中,创建资源监测对象,设置监控间隔为1秒;构建资源阈值:CPU使用率阈值80%,内存使用率阈值70%。在求解过程中周期性检查资源使用情况:每完成一次分支定价迭代后,调用资源监测模块,获取当前CPU使用率cpuusage和内存使用率memusage。根据资源使用情况调整计算策略: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%. Resource usage is checked periodically during the solution process: after each branch pricing iteration, the resource monitoring module is called to obtain the current CPU usage cpu usage and memory usage mem usage . The calculation strategy is adjusted according to resource usage:

如果cpuusage > cputhreshold 或 memusage > memthreshold,将列生成的频率减半:column *= 2;增加剪枝阈值pruningthreshold= 1.2;减少并行计算的线程数parallelthreads= max(1,parallelthreads // 2),If cpu usage > cpu threshold or mem usage > mem threshold , halve the frequency of column generation: column * = 2; increase the pruning threshold = 1.2; reduce the number of parallel threads = max(1, parallel threads // 2),

否则,如果cpuusage < cputhreshold/2 且 memusage < memthreshold/2,将列生成的频率加倍:column = max(1,column// 2);减小剪枝阈值:pruningthreshold /= 1.2;增加并行计算的线程数:parallelthreads = min(maxthreads,parallelthreads * 2)。Otherwise, if 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).

应用新的参数设置,动态地调整计算资源的使用,在保证解质量的同时提高资源利用效率。Apply new parameter settings to dynamically adjust the use of computing resources, improving resource utilization efficiency while ensuring solution quality.

在本实施例中,首先,基于排序后的代表性配送建站场景构建确定性等价问题,这种做法将复杂的随机问题转化为可以直接求解的确定性问题,简化了问题的复杂度。使用列生成方法动态生成新决策变量,这是一个重要的优化技巧。列生成方法能够在求解过程中逐步引入新的决策变量,而不是一开始就考虑所有可能的变量,这减少了问题的规模,提高了求解效率。将新生成的决策变量添加到确定性等价问题中,形成添加变量确定性等价问题,这种动态调整问题结构的方法使得求解过程更加灵活和高效。采用割平面法加强添加变量确定性等价问题的线性松弛是另一个创新点。割平面法能够逐步加强问题的约束,使得线性松弛更接近整数解,从而提高了最终解的质量。通过这些步骤得到最终确定性等价问题,为后续的求解奠定了基础。最后,使用分支定价算法对最终确定性等价问题进行求解,这种算法结合了分支定界和列生成的优点,能够高效地处理大规模整数规划问题。从解决方案中提取关键决策信息,为后续的评估和优化提供了必要的输入。整个过程不仅将复杂的随机问题转化为可解的确定性问题,还通过一系列优化技巧提高了求解的效率和解的质量。该方法的优势在于它能够有效处理大规模、复杂的两阶段随机规划问题,并且具有很强的灵活性和可扩展性。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.

步骤S42中使用列生成方法动态生成新的决策变量,具体为:In step S42, a new decision variable is dynamically generated using a column generation method, specifically:

S421. 初始化主问题:使用一组初始可行的配送方案yinit构建受限主问题(RMP);S421. Initialize the main problem: construct the restricted main problem (RMP) using a set of initial feasible delivery solutions yinit;

S422. 求解受限主问题:使用单纯形法求解RMP,得到对偶变量π;S422. Solve the restricted master problem: Use the simplex method to solve the RMP and obtain the dual variable π;

S423. 解子问题(定价问题):S423. Solution to sub-problem (pricing problem):

对每个站点i:构建网络流模型:源点为站点i,汇点为需求点;边的reduced cost:rcij = dij - πj;使用网络单纯形法求解最短路问题;如果找到负reduced cost的路径,将其添加到RMP中;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;

S424. 更新主问题:如果找到新的列(配送方案),返回步骤S422;否则,当前解为最优解;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;

S425. 应用整数变量处理:使用分支定界法处理整数约束;采用割平面法加强线性松弛;S425. Applied integer variable processing: Use branch and bound method to handle integer constraints; Use cutting plane method to strengthen linear relaxation;

S426. 初始化:求解线性松弛问题,得到初始解xLP;S426. Initialization: Solve the linear relaxation problem and obtain the initial solution xLP;

S427. 生成割平面:检查当前解xLP是否满足整数约束;如不满足,使用Gomory割平面方法生成割平面:选择一个小数决策变量xi;构造Gomory割平面:Σj fij xj ≥ fi0;其中fij和fi0由单纯形表中的系数计算得到;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;

S428. 添加割平面并重新求解:将生成的割平面添加到约束集中;重新求解线性规划问题;S428. Add cutting plane and re-solve: add the generated cutting plane to the constraint set; re-solve the linear programming problem;

S429. 迭代:重复步骤S427-S428,直到没有新的有效割平面或达到最大迭代次数。在本实施例中,首先,构建资源监控工具,实时监控当前的CPU和内存使用情况,这种做法为后续的动态调整提供了必要的信息基础。通过设置预设警戒线,方法能够及时识别计算资源的紧张或富余状态。当CPU或内存使用超过预设警戒线时,降低新决策变量的生成频率,这种做法能够有效缓解计算资源的压力,防止系统过载。相反,当CPU或内存使用低于预设警戒线时,增加新决策变量的生成频率,这种做法能够充分利用空闲的计算资源,加速求解过程。这种动态调整机制的创新之处在于它能够根据实时的资源状况自适应地调整算法的行为,从而在保证解质量的同时最大化计算效率。该方法不仅提高了资源利用率,还增强了算法的鲁棒性,使其能够在不同的硬件环境下保持高效运行。同时,通过动态调整新决策变量的生成频率,方法还能在问题规模和复杂度动态变化的情况下保持良好的性能。这种自适应机制的另一个优势是它能够在不同阶段的求解过程中调整策略,例如在初始阶段可能需要更频繁地生成新变量以快速探索解空间,而在后期可能需要降低生成频率以细化当前解。总的来说,这种动态调整机制提高了整个求解过程的效率和适应性,使得方法能够更好地处理大规模、复杂的两阶段随机规划问题。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 quality of the solution. 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 scale and complexity of the problem 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.

如图6所示,根据本申请的一个方面,步骤S5进一步为:As shown in FIG6 , according to one aspect of the present application, step S5 is further as follows:

S51、基于关键决策信息,构建方案评估工具,并计算近似期望总成本;S51. Based on key decision information, build a solution evaluation tool and calculate the approximate expected total cost;

S52、基于近似期望总成本,在随机生成的场景中测试解决方案,计算解决方案的平均表现,形成表现综合评分;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;

S53、将表现综合评分与预设性能目标进行比较,如果未达到预设性能目标,则返回步骤S3;如果达到预设性能目标,输出最终解决配送建站方案;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;

S54、计算每个场景对最终解决方案的影响程度,基于影响程度,使用策略梯度方法,更新场景重要性评分模型的参数。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.

本实施例中,方案评估工具为一个神经网络,用于快速估算不同站点建设方案在各种场景下的表现,使用历史数据和模拟数据训练这个神经网络,提高其预测准确性。使用构建的评估工具,在大量随机生成的场景中测试当前的站点建设方案。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.

在进一步的实施例中,构建神经网络逼近器V(x,ξ)估计第二阶段价值函数,其中x为站点建设方案,ξ表示场景参数,神经网络逼近器为3层全连接网络,使用双重采样方法训练网络,使用ReLU激活函数,得到第二阶段最优配送成本的估计。计算近似期望总成本: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:

E[f(x*,y)] ≈∑i fi·xi* + 1/N∑j=1 N V(x*,ξj);E[f(x*, y)] ≈∑ i fi·xi* + 1/N∑ j=1 N V(x*, ξj);

评估解的质量,计算近似最优间隙:Gap = (E[f(x*,y)] - LB) / LB,其中 LB 为下界。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.

如果Gap >最优间隙阈值ε,取0.05,返回步骤S3进行迭代优化;If Gap > optimal gap threshold ε, take 0.05 and return to step S3 for iterative optimization;

更新场景选择模型,计算每个场景的影响度:Ii = |V(x*,ξi) - 1/K·∑j∈I V(x*,ξj)|;Update the scene selection model and calculate the influence of each scene: Ii = |V(x*,ξi) - 1/K·∑ j∈I V(x*,ξj)|;

使用策略梯度方法或Adam优化器更新GAT模型参数。Update the GAT model parameters using the policy gradient method or the Adam optimizer.

S541. 构建策略网络πθ(a|s),网络结构包括2层GAT 、 1层全连接和 Softmax。S541. Construct a policy network π θ (a|s), the network structure includes 2 layers of GAT, 1 layer of full connection and Softmax.

输入状态s为场景相似度图GS的节点特征;输出动作概率a为选择每个场景的概率分布。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.

S542. 构建价值网络Vφ(s),包括2层GAT和 2层全连接;S542. Construct the value network Vφ(s), including 2 layers of GAT and 2 layers of full connection;

输入状态s为场景相似度图GS的节点特征;输出状态为价值估计。The input state s is the node feature of the scene similarity graph GS; the output state is the value estimate.

S543. 采样轨迹:S543. Sampling trajectory:

对于每个周期:初始化状态s0;对t=0,1,…,T-1:从πθ(a|st)中采样动作atFor each cycle: initialize state s 0 ; for t=0, 1, ..., T-1: sample action a t from π θ (a|s t );

执行动作at,观察奖励rt和下一状态st+1;存储轨迹τ = (s0,a0,r0,…,sT,aT,rT);Execute action a t , observe reward r t and next state s t+1 ; store trajectory τ = (s 0 , a 0 , r 0 , … , s T , a T , r T );

S544. 计算优势估计:S544. Compute advantage estimates:

对于轨迹τ中的每个时间步t:At = Σk=t T γ(k-t) rk - VΦ(st);For each time step t in trajectory τ: A t = Σ k=t T γ (kt) r k − V Φ (s t );

S545. 更新策略网络参数θ:S545. Update strategy network parameters θ:

计算策略梯度:▽θ J = Eτtθ log πθ(at|st) At];Calculate the policy gradient: ▽ θ J = E τtθ log π θ (a t |s t ) A t ];

使用Adam优化器更新θ。Update θ using the Adam optimizer.

S546. 更新价值网络参数φ:最小化均方误差:L(φ) = Eτt (Vφ(st) - Rt)2];S546. Update the value network parameter φ: minimize the mean square error: L(φ) = E τt (V φ (s t ) - R t ) 2 ];

其中Rt = Σk=t T γk-trkwhere R t = Σ k=t T γ kt r k ;

使用Adam优化器更新φ;Update φ using the Adam optimizer;

S547. 迭代训练:重复步骤S543-S546,直到收敛或达到最大迭代次数。S547. Iterative training: Repeat steps S543-S546 until convergence or the maximum number of iterations is reached.

在本实施例中,首先,基于关键决策信息构建方案评估工具,并计算近似期望总成本,这种做法为解决方案的评估提供了量化的标准。在随机生成的场景中测试解决方案,计算解决方案的平均表现,形成表现综合评分,该方法能够全面评估解决方案在各种可能情况下的表现,提高了评估的可靠性。将表现综合评分与预设性能目标进行比较,并根据比较结果决定是否返回步骤S3重新进行场景选择和排序,这种反馈机制使得整个求解过程形成了一个闭环,能够不断优化解决方案。如果达到预设性能目标,则输出最终解决方案,这确保了输出的解决方案满足预定的质量标准。计算每个场景对最终解决方案的影响程度,这种做法能够识别出对解决方案质量影响最大的关键场景。基于影响程度,使用策略梯度方法更新场景重要性评分模型的参数,这是另一个重要的创新点。策略梯度方法能够根据实际效果自适应地调整模型参数,使得场景重要性评分模型能够不断改进其性能。整个过程不仅实现了解决方案的全面评估,还建立了一个自我优化的机制,使得整个求解方法能够随着使用不断提高其性能。该方法的优势在于它能够适应问题的变化,持续优化求解策略,从而在长期使用中不断提高解决方案的质量。同时,通过识别关键场景并更新模型参数,方法还能够更好地聚焦于对问题解决最关键的因素,进一步提高求解效率。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.

在本申请的另一实施例中,场景选择与排序的过程,还可以为:In another embodiment of the present application, the process of scene selection and sorting may also be:

评估场景的重要性,包括:创建一个图形注意力网络,用于处理场景相似关系图。使用这个网络,为每个场景计算一个重要性分数。将计算得到的重要性分数与每个场景关联起来。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.

选择具有代表性的场景,包括:使用确定性点过程方法,考虑场景的重要性和多样性。从所有场景中选择一部分最具代表性的场景。将选中的场景保存到一个新的列表中。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.

对选中的场景进行排序,包括:创建一个成本矩阵,表示将每个场景放置在不同位置的代价。使用Sinkhorn算法,寻找一个最优的场景排序方案。根据算法结果,对选中的场景进行重新排序。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.

在本申请的另一实施例中,缩减问题构建与求解,还可以为:In another embodiment of the present application, the construction and solution of the reduction problem can also be:

创建简化版的决策问题,包括:基于选中并排序的场景,构建一个规模较小的决策问题。将原始问题中的约束条件应用到这个简化版问题中。设置简化版问题的目标函数,使其反映原始问题的优化目标。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.

使用高级求解方法解决问题,包括:实现列生成方法,动态地添加新的决策变量到问题中。使用割平面法,逐步加强问题的线性松弛。应用分支定价算法,在合理的时间内找到高质量的解决方案。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.

提取关键决策信息,包括:从求解结果中提取第一阶段的站点建设决策。记录求解过程中的关键信息,如对偶变量值等。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.

在本申请的另一实施例中,监控和调整计算资源使用,还可以为:In another embodiment of the present application, monitoring and adjusting the use of computing resources may also include:

创建一个资源监控器,持续检查CPU和内存的使用情况。根据资源使用状况,动态调整求解算法的参数,如并行度、精度要求等。在资源紧张时降低计算强度,在资源充足时提高计算精度。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.

在本申请的另一实施例中,步骤S5还可以为:In another embodiment of the present application, step S5 may also be:

创建一个神经网络,用于快速估算不同站点建设方案在各种场景下的表现。使用历史数据和模拟数据训练这个神经网络,提高其预测准确性。使用构建的评估工具,在大量随机生成的场景中测试当前的站点建设方案。计算方案在所有测试场景中的平均表现,得到一个综合评分。将方案的综合评分与预设的性能目标进行比较。如果评分未达到目标,返回到场景选择步骤,重新开始求解过程。计算每个场景对最终决策的影响程度。使用策略梯度方法,更新场景重要性评估模型的参数。通过多次迭代,逐步改进场景选择的策略,提高解决方案的质量。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.

在本申请的另一实施例中,构建场景关系网络的步骤,还可以为:In another embodiment of the present application, the step of constructing a scene relationship network may also be:

计算场景间的相似度,包括:对每对场景,计算其核心信息的距离。将距离转换为相似度得分。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.

找出每个场景的相似伙伴,包括:为每个场景选择10个最相似的其他场景。记录这些相似关系。Find similar partners for each scenario, including: Select the 10 most similar other scenarios for each scenario. Record these similar relationships.

平衡关系网络,包括:计算每个场景的总体相似度。使用总体相似度调整场景间的联系强度。Balancing the relationship network, including: calculating the overall similarity of each scene. Using the overall similarity to adjust the connection strength between scenes.

生成最终的关系网络,包括:创建一个网络,其中每个节点代表一个场景。根据调整后的相似度,在场景间建立连接。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.

在本申请的另一实施例中,选择具有代表性的场景的过程,还可以为:In another embodiment of the present application, the process of selecting a representative scene may also be:

评估场景的独特性和重要性:创建一个评分矩阵,考虑场景的重要性和它们之间的不同。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.

分析评分矩阵的特征:使用数学方法,找出评分矩阵的主要特征和模式。Analyze the characteristics of the rating matrix: Use mathematical methods to find the main characteristics and patterns of the rating matrix.

逐步选择代表性场景:初始时,选择集合为空。重复以下步骤直到选够所需数量的场景:计算每个未选场景的选择概率。根据概率选择一个新场景。更新剩余场景的特征,确保多样性。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.

输出选中的场景:返回被选中的场景的编号列表。Output selected scenes: Returns a numbered list of the selected scenes.

在本申请的另一实施例中,对选中的场景进行排序的过程,还可以为:In another embodiment of the present application, the process of sorting the selected scenes may also be:

为每个场景在不同位置计算一个成本值。考虑位置和场景特征的影响。初始化排序工具。设置算法参数。重复以下步骤:更新场景的位置概率,调整位置的选择概率。最后,根据最终的概率分布,创建一个排序方案。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.

在本申请的另一实施例中,确定最终排序的过程,还可以为:In another embodiment of the present application, the process of determining the final sorting may also be:

分析排序方案,为每个位置选择最合适的场景。输出排好序的场景列表。Analyze the sorting scheme and select the most appropriate scene for each location. Output the sorted scene list.

动态生成新的配送方案,包括:Dynamically generate new delivery plans, including:

准备初始配送方案:创建一个基本可行的配送计划,作为起点。Prepare an initial delivery plan: Create a basic, workable delivery plan as a starting point.

优化当前配送方案:使用线性规划方法,找出当前方案的最佳执行方式。记录优化过程中得到的重要信息。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.

寻找改进机会:对每个配送站点:构建一个网络模型,表示从该站点到各需求点的配送路径。计算每条路径的实际成本。找出可以降低总成本的新配送路径。如果找到更好的路径,将其添加到配送方案中。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.

更新整体配送计划:如果发现了新的有效配送路径,重新优化整体方案。如果没有找到新的改进,认为当前方案已经最优。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.

处理整数限制:使用分支定界法,将连续的配送量转化为整数值。Handling integer constraints: Use branch and bound to convert continuous delivery quantities into integer values.

初始化问题松弛:构建一个简化版的配送问题,允许非整数解。Initialize the problem relaxation: construct a simplified version of the delivery problem that allows non-integer solutions.

检查当前解是否满足整数要求。如果不满足,添加新的约束条件来逼近整数解:选择一个不是整数的决策变量。根据这个变量构造一个新的限制条件。将这个新条件添加到问题中。Check if the current solution satisfies the integer requirement. If not, add new constraints to approach an integer solution: Choose a decision variable that is not an integer. Construct a new constraint based on this variable. Add this new constraint to the problem.

将新添加的约束条件纳入考虑。再次解决优化问题。Take the newly added constraints into account and solve the optimization problem again.

重复添加约束和求解的过程。直到得到一个满意的整数解,或达到预设的迭代次数。Repeat the process of adding constraints and solving until a satisfactory integer solution is obtained or the preset number of iterations is reached.

在本申请的另一实施例中,还包括创建场景选择策略网络:In another embodiment of the present application, it also includes creating a scenario selection strategy network:

构建一个神经网络,用于评估选择每个场景的好坏。输入数据是场景之间的关系信息。输出数据是选择每个场景的可能性。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.

创建状态评估网络:构建另一个神经网络,用于评估当前选择状态的优劣。Create a state evaluation network: Build another neural network to evaluate the quality of the current selected state.

以场景关系信息作为输入。采用神经网络输出对当前状态的价值评估。The scene relationship information is used as input, and the neural network output is used to evaluate the value of the current state.

对于每一轮决策:从初始状态开始。For each round of decision making: Start from the initial state.

反复执行以下步骤:使用策略网络选择一个场景。记录选择这个场景后的结果和新的状态。保存整个决策过程的记录。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.

评估决策质量:对每个决策步骤:计算实际获得的长期收益。与状态评估网络的预测进行比较。记录预测误差。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.

改进选择策略:根据实际决策效果,计算如何调整策略网络。使用优化算法,更新策略网络的参数。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.

改进状态评估:使用记录的实际结果,优化状态评估网络。调整网络参数,使其预测更加准确。Improve state estimation: Use the recorded actual results to optimize the state estimation network. Adjust the network parameters to make its predictions more accurate.

重复模拟、评估和改进的过程。直到策略和评估都达到稳定,或完成预定的训练次数。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.

根据本申请的另一个方面,还提供一种人工智能驱动的两阶段随机规划问题求解系统,包括:According to another aspect of the present application, there is also provided an artificial intelligence driven two-stage stochastic programming problem solving system, comprising:

至少一个处理器;以及,at least one processor; and,

与至少一个所述处理器通信连接的存储器;其中,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 of the above technical solutions.

以上详细描述了本发明的优选实施方式,但是,本发明并不限于上述实施方式中的具体细节,在本发明的技术构思范围内,可以对本发明的技术方案进行多种等同变换,这些等同变换均属于本发明的保护范围。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 (6)

1. The method for solving the two-stage stochastic programming problem driven by artificial intelligence is characterized by comprising the following steps of:
S0, collecting distribution station building data, and constructing a mathematical model of a two-stage random programming problem; the distribution building data comprises deterministic parameters, random parameters, decision time points and decision variables; wherein the deterministic parameters include: the number of the constructable stations, the maximum number of the constructable stations, a transport distance matrix from each station to a cell, and a cargo capacity vector of each station; the random parameters comprise customer demand vectors of the cells; the decision time point comprises a site construction decision time and a cargo delivery decision time;
s1, generating a distribution building scene set based on a mathematical model, and converting the mathematical model into a graph structure in each distribution building scene;
S2, constructing a layered graph rolling network based on the graph structure, extracting key information of the distribution site building scene from the layered graph rolling network, and constructing a distribution site building scene similarity graph based on the key information;
S3, based on the distribution site building scene similarity graph, a distribution site building scene importance scoring model is constructed, the importance of distribution site building scenes is evaluated, representative distribution site building scenes are selected, and the representative distribution site building scenes are ordered;
S4, constructing a deterministic equivalence problem based on the ordered representative distribution station establishment scene, solving the deterministic equivalence problem to obtain a distribution station establishment solution, and extracting key decision information from the distribution station establishment solution;
S5, constructing a distribution and construction solution evaluation tool based on the key decision information, evaluating the quality of the distribution and construction solution in a randomly generated distribution scene by using the distribution and construction solution evaluation tool, and updating parameters of a distribution and construction scene importance scoring model based on the evaluation result;
step S1 is further as follows:
S11, acquiring a mathematical model of a preconfigured two-stage stochastic programming problem, wherein the mathematical model comprises a decision variable set, a constraint set and an objective function;
s12, generating a scene set by using a random number generator based on a mathematical model;
S13, constructing a graphic structure represented by a bipartite graph based on a mathematical model in each distribution building scene;
s14, mapping the graphic structure represented by the bipartite graph to a high-dimensional feature space by using nonlinear feature transformation;
Step S2 is further as follows:
s21, constructing a hierarchical graph rolling network based on a graph structure;
S22, compressing distribution site building scene features in the hierarchical graph rolling network, and extracting key information of site distribution site building scenes by using a variation information bottleneck method based on the compressed distribution site building scene features;
s23, calculating similarity matrixes among key information of all distribution building scenes, constructing an adjacent matrix based on the similarity matrixes, and normalizing the adjacent matrix;
S24, constructing a distribution station building scene similarity graph based on the normalized adjacency matrix;
step S4 is further:
s41, constructing a deterministic equivalence problem based on the ordered representative distribution station building scene;
S42, dynamically generating a new decision variable by using a column generation method, and adding the new decision variable into the deterministic equivalence problem to form an added variable deterministic equivalence problem;
s43, adopting a cut plane method to strengthen linear relaxation of the added variable certainty equivalent problem, and obtaining a final certainty equivalent problem;
S44, solving the final deterministic equivalence problem by using a branch pricing algorithm to obtain a distribution station establishment solution, and extracting key decision information from the distribution station establishment solution;
In step S22, the compressing the scene features in the hierarchical graph convolutional network is further:
s221, mapping the distribution station building scene characteristics in the hierarchical graph convolution network to a hidden space by using an encoder to obtain hidden variables;
s222, reconstructing hidden variables into new scene features by using a decoder, and calculating reconstruction errors between the distribution station building scene features and the new scene features;
S223, calculating Wo Sesi-th distance between the hidden variable distribution and the preset target distribution, and carrying out weighted summation on the reconstruction error and the Wo Sesi-th distance to serve as a loss function;
S224, minimizing a loss function through a back propagation algorithm, and optimizing parameters of an encoder and a decoder;
S225, compressing the distribution site building scene features in the hierarchical graph rolling network by using the optimized encoder and decoder.
2. The artificial intelligence driven two-stage stochastic programming problem solving method of claim 1, wherein step S3 further comprises:
S31, based on the distribution site building scene similarity graph, constructing a distribution site building scene importance scoring model based on a graph attention network, and evaluating the importance of each distribution site building scene;
S32, constructing a kernel matrix based on the importance of each distribution building scene, and calculating the feature decomposition of the kernel matrix;
S33, based on feature decomposition, sampling a nuclear matrix by using a determinant point process to obtain a preset representative distribution station building scene;
and S34, sorting the representative distribution site building scenes by using Xin Kehuo En algorithm to obtain sorted representative distribution site building scenes.
3. The artificial intelligence driven two-stage stochastic programming problem solving method of claim 2, wherein step S5 is further:
s51, constructing a distribution station-building scheme assessment tool based on key decision information, and calculating approximate expected total cost;
S52, testing the distribution building solutions in the randomly generated distribution building scene based on the approximate expected total cost, and calculating the average performance of the distribution building solutions to form a performance comprehensive score;
s53, comparing the comprehensive performance score with a preset performance target, and returning to the step S3 if the comprehensive performance score does not reach the preset performance target; if the preset performance target is reached, outputting a final solution;
S54, calculating the influence degree of each distribution building scene on the final solution, and updating parameters of the distribution building scene importance scoring model by using a strategy gradient method based on the influence degree.
4. The artificial intelligence driven two-stage stochastic programming problem solving method of claim 3, further comprising adjusting the frequency of generation of the new decision variables in step S42, specifically:
s421, constructing a resource monitoring tool, and monitoring the current CPU and memory use;
s422, if the CPU or the memory usage exceeds a preset guard line, reducing the generation frequency of the new decision variable; if the CPU or memory usage is below the preset guard line, the frequency of generation of the new decision variable is increased.
5. The artificial intelligence driven two-stage stochastic programming problem solving method of claim 3, wherein step S34 further comprises:
s341, constructing a cost matrix based on the representative distribution station construction scene;
S342, initializing parameters of Xin Kehuo En algorithm, and carrying out Xin Kehuo En algorithm iterative computation on the parameters based on a cost matrix to obtain updated parameters;
S343, calculating a transfer plan matrix based on the updated parameters and the cost matrix;
and S344, extracting a sequencing result, namely the sequenced representative distribution site building scene, from the transfer plan matrix.
6. The artificial intelligence driven two-stage stochastic programming problem solving system is characterized by comprising:
At least one processor; and
A memory communicatively coupled to at least one of the processors; wherein,
The memory stores instructions executable by the processor for execution by the processor to implement the artificial intelligence driven two-phase stochastic programming problem solving method of any of claims 1-5.
CN202410996718.4A 2024-07-24 2024-07-24 Method and system for solving two-stage stochastic programming problem driven by artificial intelligence Active CN118551940B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410996718.4A CN118551940B (en) 2024-07-24 2024-07-24 Method and system for solving two-stage stochastic programming problem driven by artificial intelligence

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410996718.4A CN118551940B (en) 2024-07-24 2024-07-24 Method and system for solving two-stage stochastic programming problem driven by artificial intelligence

Publications (2)

Publication Number Publication Date
CN118551940A CN118551940A (en) 2024-08-27
CN118551940B true CN118551940B (en) 2024-10-11

Family

ID=92450314

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410996718.4A Active CN118551940B (en) 2024-07-24 2024-07-24 Method and system for solving two-stage stochastic programming problem driven by artificial intelligence

Country Status (1)

Country Link
CN (1) CN118551940B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112217202A (en) * 2020-09-29 2021-01-12 东南大学 Distributed new energy, energy storage and power distribution network planning method considering flexibility investment
CN112651711A (en) * 2020-12-22 2021-04-13 北京市市政工程设计研究总院有限公司 System for building collaborative design management platform based on XDB (X data base) file under BS (browser/server) architecture

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110895638B (en) * 2019-11-22 2022-12-06 国网福建省电力有限公司 A method for building an active distribution network model considering the location and capacity of electric vehicle charging stations
EP4052446A4 (en) * 2019-12-09 2023-08-09 Siemens Aktiengesellschaft INFORMATION COLLECTION METHOD, DEVICE AND SYSTEM
CN113810233B (en) * 2021-09-17 2022-10-18 重庆邮电大学 A Distributed Computing Offloading Method Based on Computational Network Collaboration in Random Networks
CN115187426A (en) * 2022-06-01 2022-10-14 中国电力科学研究院有限公司 Method and device for generating multi-region wind power output scene
CN115879657A (en) * 2022-09-30 2023-03-31 浙江财经大学 Optimization method for site selection route of electric vehicle swap station considering multi-site capacity design
CN117273490A (en) * 2023-09-28 2023-12-22 国网湖北省电力有限公司电力科学研究院 Random planning method for multi-new-energy station co-construction shared energy storage
CN117808180B (en) * 2023-12-27 2024-07-05 北京科技大学 Path planning method, application and device based on knowledge and data combination
CN118154277B (en) * 2024-03-25 2025-06-27 大连理工大学 Robustness recommendation system representation learning method based on cross distillation

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112217202A (en) * 2020-09-29 2021-01-12 东南大学 Distributed new energy, energy storage and power distribution network planning method considering flexibility investment
CN112651711A (en) * 2020-12-22 2021-04-13 北京市市政工程设计研究总院有限公司 System for building collaborative design management platform based on XDB (X data base) file under BS (browser/server) architecture

Also Published As

Publication number Publication date
CN118551940A (en) 2024-08-27

Similar Documents

Publication Publication Date Title
Yang et al. Deep ensemble learning based probabilistic load forecasting in smart grids
Hsieh et al. Forecasting stock markets using wavelet transforms and recurrent neural networks: An integrated system based on artificial bee colony algorithm
CN112819604A (en) Personal credit evaluation method and system based on fusion neural network feature mining
Shakya et al. Neural network demand models and evolutionary optimisers for dynamic pricing
Raghavendra et al. Artificial humming bird with data science enabled stability prediction model for smart grids
CN119089156A (en) Business prediction method, device and equipment based on LNM large numerical model
Gong et al. Ensemble models of TCN-LSTM-LightGBM based on ensemble learning methods for short-term electrical load forecasting
KR102409041B1 (en) portfolio asset allocation reinforcement learning method using actor critic model
Xu et al. Graph Neural Networks in Financial Markets: Modeling Volatility and Assessing Value-at-Risk
Wistuba et al. Inductive transfer for neural architecture optimization
CN119417229A (en) A risk assessment system and method for power trading center based on multi-risk superposition
CN117913800B (en) A distribution network construction planning method and system
CN119578871A (en) A financial early warning method and system for financial enterprise customers based on Transformer
CN118551940B (en) Method and system for solving two-stage stochastic programming problem driven by artificial intelligence
Hadavandi et al. Developing an evolutionary neural network model for stock index forecasting
Petropoulos et al. Macroeconomic forecasting and sovereign risk assessment using deep learning techniques
Lemos et al. Temporal convolutional network applied for forecasting individual monthly electric energy consumption
Zong et al. A Multitask Framework for Optimizing Smart Grid Energy Consumption Using RegClassXNet and Dynamic Cluster Adjustment
Bonissone The life cycle of a fuzzy knowledge-based classifier
Sun et al. Application of neural network model combining information entropy and ant colony clustering theory for short-term load forecasting
Das et al. A harmony search-based artificial neural network for stock market prediction
Polupanov et al. Improving the neural network mathematical model of corporate bankruptcy
CN120088046B (en) Abnormal transaction behavior identification method
Zhang Data-Driven Locational Marginal Price Prediction from Market Participants’ Perspective
CN120181544B (en) Method and system for predicting production material demand based on artificial intelligence

Legal Events

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