Greenway site selection optimization method and device based on graph neural network and reinforcement learning
By employing graph neural networks and reinforcement learning, this study addresses the problem that traditional MILP models cannot handle the uncertainty of aggregated demand units in urban greenway site selection and planning, thereby achieving a better greenway site selection scheme and improving coverage efficiency and scheme balance.
Patent Information
- Application Number
- CN202511194323.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-25
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-08-25
AI Technical Summary
Traditional mixed-integer linear programming (MILP) models cannot effectively handle the uncertainty of aggregated demand units in urban greenway site selection planning, leading to coverage calculation errors and non-optimal solutions.
Using graph neural networks and reinforcement learning, we acquire line and surface features of the study area, generate individual demand points, construct the environment, and perform data sampling and training during the Markov decision process. We then optimize the greenway site selection scheme using graph neural networks and policy networks.
It achieves a better greenway site selection scheme under the condition of uncertainty, improves coverage efficiency and scheme balance, and avoids the non-optimal problem in traditional methods.
Smart Images

Figure CN121189686B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of urban construction planning technology, and in particular to a method and apparatus for optimizing greenway site selection based on graph neural networks and reinforcement learning. Background Technology
[0002] Urban greenways refer to open, linear green spaces within cities, providing facilities for citizens to engage in leisure, sports, and education. Urban greenways are crucial green infrastructure in cities, significantly impacting the city's image, residents' well-being, and economic benefits. The primary task in planning and constructing urban greenways is site selection planning.
[0003] Currently, the traditional Mixed-Integer Linear Programming (MILP) model is commonly used for the site selection and planning of urban greenways. Traditional MILP models primarily focus on line features, especially the optimal layout of simple line features without branches or loops, ensuring that the services provided cover as much demand as possible. However, in practical applications, the organizational units of demand are generally aggregated polygon features. Because the coverage metric provided in traditional MILP models is binary (covered and uncovered), partial coverage of demand units may lead to incorrect calculations of actual covered demand, resulting in suboptimal solutions. Summary of the Invention
[0004] This invention provides a method and apparatus for optimizing greenway site selection using graph neural networks and reinforcement learning. It addresses the shortcomings of MILP models, which may lead to incorrect calculations of actual needs when partially covering demand units, resulting in non-optimal solutions. The invention aims to train an agent that considers uncertainty, thereby obtaining a better greenway site selection scheme.
[0005] This invention provides a greenway site selection optimization method based on graph neural networks and reinforcement learning, comprising:
[0006] Obtain multiple candidate line features and multiple polygon features for organizing requirements within the study area;
[0007] Within each of the surface features, generate several individual demand points and calculate the coverage relationship between the individual demand points and the candidate line features;
[0008] An environment is built based on the candidate line elements and their attributes, the area elements and their attributes, the intersection elements and their attributes between the candidate line elements, the individual demand points, and the coverage relationships;
[0009] Data sampling is performed in the cyclic execution of the Markov decision process to obtain a training data set; at each cycle, the agent aggregates and encodes the current state fed back by the environment using a graph neural network as input of a policy network; when the current selected line element reaches the maximum line element length, the environment randomly samples a target number of individual demand points from the actual demand in the plurality of individual demand points in each surface element, and takes the ratio of the number of target individual demand points covered by the current selected line element determined based on the coverage relationship to the total number of target individual demand points as the reward fed back to the agent;
[0010] The agent is trained based on the training data set, and a greenway site selection scheme is obtained by using the trained agent, wherein the greenway site selection scheme includes a plurality of selected line elements and a total amount of covered demand.
[0011] According to the greenway site selection optimization method based on the graph neural network and the reinforcement learning provided by the application, data sampling is performed in the cyclic execution of the Markov decision process to obtain a training data set, which includes:
[0012] A preset number of agents and environments are copied;
[0013] Each agent and environment is assigned a thread, and the agent and the environment cyclically execute a Markov decision process, and data sampling is performed in the cyclic execution of the Markov decision process until the total sampling number of each thread reaches a preset sampling number, thereby obtaining the training data set.
[0014] According to the greenway site selection optimization method based on the graph neural network and the reinforcement learning provided by the application, the agent and the environment cyclically execute a Markov decision process, and data sampling is performed in the cyclic execution of the Markov decision process, which includes:
[0015] The following steps are cyclically executed:
[0016] The agent requests a current state from the environment; the current state includes attributes of the to-be-selected line element, the surface element, and the intersection element between the to-be-selected line element;
[0017] The agent converts the current state fed back by the environment into a state tensor, and inputs the state tensor into the graph neural network for aggregated encoding to obtain an edge-aggregated encoded tensor;
[0018] The agent inputs the edge-aggregated encoded tensor into the policy network to obtain probabilities of different actions, and masks illegal actions to obtain a probability distribution; the action is to select a to-be-selected line element;
[0019] The agent samples a current action based on the probability distribution and submits the current action to the environment;
[0020] The environment performs state updating based on the current action and feeds back a next state and a current reward to the agent;
[0021] The current state, the current action, the probability distribution, the next state, the current reward and a completion state are packaged and stored as training data collected in this cycle; the completion state is used to represent that there is no any candidate line element meeting the restriction condition at present.
[0022] According to the greenway site selection optimization method based on the graph neural network and the reinforcement learning provided by the application, the environment feeds back the current reward to the agent, comprising:
[0023] In the case that the current selected line element is a loop or all actions corresponding to the next state are illegal actions, the environment feeds back a negative reward to the agent as the current reward;
[0024] When the current selected line element reaches the maximum line element length, the environment randomly samples the actual number of target individual demand points from the plurality of individual demand points in each surface element, and feeds back the ratio of the number of target individual demand points covered by the current selected line element determined based on the coverage relationship to the total number of target individual demand points to the agent as the current reward.
[0025] According to the greenway site selection optimization method based on the graph neural network and the reinforcement learning provided by the application, the agent is trained based on the training data set, comprising:
[0026] The following steps are repeatedly executed:
[0027] Data sampling is performed from the training data set to obtain a plurality of target training data;
[0028] Each target training data is converted into a plurality of target tensors;
[0029] For each target tensor, the target tensor is input into the graph neural network, and the graph neural network is used to construct a target topological graph and generate a target encoding tensor of the target topological graph;
[0030] The target encoding tensor of the target topological graph is input into a value network to obtain a state estimation value;
[0031] The network parameters of the agent are adjusted based on the state estimation value.
[0032] The application provides a greenway site selection optimization method based on a graph neural network and reinforcement learning, and the graph neural network comprises a graph generation layer and a plurality of convolution layers.
[0033] The graph neural network is specifically used for:
[0034] The graph generation layer is used to extract candidate line elements and attributes thereof, surface elements and attributes thereof, and intersection elements and attributes thereof between the candidate line elements from an input tensor, and a topological graph is constructed by taking the candidate line elements as edges, the surface elements as surfaces, and the intersection elements as vertices.
[0035] The attributes of edges, surfaces and vertices in the topological graph and the attributes of environmental elements are respectively preliminarily coded to obtain attribute coding of the edges, the surfaces and the vertices and attribute coding of the environmental elements.
[0036] The convolution layer is used to perform the following steps:
[0037] For each edge, the attribute coding of the edges, surfaces and vertices adjacent to the edge is respectively aggregated, and the attribute coding of the edges, surfaces and vertices adjacent to the edge after aggregation is spliced to obtain the attribute coding of the edges after aggregation.
[0038] For each vertex, the attribute coding of the edges adjacent to the vertex after aggregation is aggregated to the attribute coding of the vertex.
[0039] The attribute coding of the edges, the surfaces and the vertices finally obtained by the current convolution layer is taken as the input of the next convolution layer.
[0040] The attribute coding of the edges and the vertices output by the last convolution layer and the attribute coding of the environmental elements are used to generate a coding tensor of the topological graph.
[0041] According to the greenway site selection optimization method based on the graph neural network and the reinforcement learning, the distribution mode of the plurality of individual demand points generated in each surface element comprises at least one of uniform distribution, edge distribution, center distribution and multi-center distribution.
[0042] The application further provides a greenway site selection optimization device based on a graph neural network and reinforcement learning, comprising:
[0043] An acquisition module is configured to acquire a plurality of candidate line elements in a research area and a plurality of surface elements for organizing demand.
[0044] A generation module is configured to generate a plurality of individual demand points in each surface element.
[0045] A calculation module is configured to calculate a coverage relationship between the individual demand points and the candidate line elements.
[0046] A building module is configured to build an environment based on the candidate line elements and their attributes, the surface elements and their attributes, intersection elements between the candidate line elements and their attributes, the individual demand points, and the coverage relationship;
[0047] A sampling module is configured to sample data in a loop to perform a Markov decision process to obtain a training data set; in each loop, an agent aggregates and encodes a current state fed back by an environment using a graph neural network as an input of a policy network; when a current selected line element reaches a maximum line element length, the environment randomly samples a target individual demand point from a number of individual demand points in each surface element, and takes a ratio of a number of target individual demand points covered by the current selected line element based on the coverage relationship to a total number of target individual demand points as a reward fed back to the agent;
[0048] A training module is configured to train the agent based on the training data set;
[0049] An optimization module is configured to obtain a greenway site selection scheme using the trained agent, and the greenway site selection scheme includes a plurality of selected line elements and a total amount of coverage.
[0050] The application further provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the greenway site selection optimization method based on the graph neural network and the reinforcement learning when executing the computer program.
[0051] The application further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the greenway site selection optimization method based on the graph neural network and the reinforcement learning.
[0052] The application further provides a computer program product including a computer program, and the computer program is executed by a processor to implement the greenway site selection optimization method based on the graph neural network and the reinforcement learning.
[0053] The application provides a greenway site selection optimization method and device based on a graph neural network and reinforcement learning. Firstly, a plurality of candidate line elements in a research area and a plurality of surface elements for organizing demand are obtained. Then, a plurality of individual demand points are generated in each surface element, and the covering relationship between the individual demand points and the candidate line elements is calculated. In this way, a large amount of calculation tasks can be completed before training, and the fluency and efficiency of training are improved. Next, the environment is built based on the candidate line elements and their attributes, the surface elements and their attributes, the intersection elements between the candidate line elements and their attributes, the individual demand points and the covering relationship. Data sampling is performed in the Markov decision process to obtain a training data set. In each cycle, the agent aggregates and encodes the current state fed back by the environment using the graph neural network as the input of the policy network, which can simplify and aggregate information, thereby accelerating the process of the agent identifying the environment and learning the strategy. When the current selected line element reaches the maximum line element length, the environment randomly samples a target individual demand point from a plurality of individual demand points in each surface element, and the ratio of the number of target individual demand points covered by the current selected line element to the total number of target individual demand points is determined based on the covering relationship, and is fed back to the agent as a reward. Since the target individual demand points sampled each time are different, the environment needs to dynamically calculate the demand coverage. Finally, the agent is trained based on the training data set, and a greenway site selection scheme is obtained by using the trained agent. The greenway site selection scheme includes a plurality of selected line elements and the total amount of demand covered. Since the agent will face millions of demand distribution situations and demand coverage calculation results in the process of interacting with the environment, it can learn a more balanced and comprehensive greenway site selection scheme. Therefore, the application can train an agent considering uncertainty, thereby obtaining a more balanced and comprehensive greenway site selection scheme. BRIEF DESCRIPTION OF DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the application or the prior art, the following will briefly introduce the drawings needed in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative effort.
[0055] Figure 1 is a binary coverage standard diagram provided by the prior art.
[0056] Figure 2 is a flowchart of the greenway site selection optimization method based on the graph neural network and the reinforcement learning provided by the embodiment of the application.
[0057] Figure 3 is a schematic diagram of the selected line elements which are discontinuous in space, have bifurcated roads and loops.
[0058] Figure 4 is a schematic diagram of calculating a target value provided by an embodiment of the present application.
[0059] Figure 5 is a schematic diagram of a greenway scheme obtained by each model when the distance threshold is 800 meters provided by an embodiment of the present application.
[0060] Figure 6 is a schematic diagram of a greenway scheme obtained by each model when the distance threshold is 1000 meters provided by an embodiment of the present application.
[0061] Figure 7 is a structural schematic diagram of a greenway site selection optimization device based on a graph neural network and reinforcement learning provided by an embodiment of the present application.
[0062] Figure 8 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0063] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described clearly and completely below in combination with the drawings in the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0064] A city greenway refers to an open green linear space in a city, which can provide facilities for citizens to relax, exercise, and educate. The greenway is an important green infrastructure in the city, which has important significance for the city image, urban residents and economic benefits. Specifically, 1) the greenway can improve the ecological environment of the city, protect biodiversity, increase green space, reduce air and noise pollution, reduce the urban heat island effect, and improve the health level of urban residents; 2) the greenway can enrich the landscape level of the city, display the history and culture of the city, enhance the characteristics and charm of the city, and improve the image and quality of the city, attract tourists and investors, and promote the economic and social development of the city; 3) the greenway can meet the diversified needs of urban residents, provide safe and comfortable walking and cycling conditions, increase the choice of traffic, alleviate traffic congestion, reduce traffic accidents, save energy and resources, reduce carbon emissions, and achieve low-carbon travel; 4) the greenway can enhance the sense of community belonging of urban residents, promote communication and interaction among neighbors, improve the participation awareness and responsibility of citizens, cultivate the awareness and action of environmental protection, and build harmonious social relationships; 5) the greenway can also drive the development of related industries such as tourism, catering, and culture, create more employment opportunities and tax revenues, and according to statistics, every 1 yuan invested in greenway construction can bring 1.4 yuan of economic benefits.
[0065] The first work in the planning and construction of urban greenways is to carry out site planning of urban greenways. At present, the traditional MILP model is usually used for site planning of urban greenways. The traditional MILP model mainly focuses on linear elements, especially the optimal layout of simple linear elements without branches and loops, so that the services provided can cover as many demands as possible. However, in practical applications, the organization unit of demand is generally an aggregated area element. Since the coverage metric provided in the traditional MILP model is binary (covered and not covered), in the case of partially covered demand units, it may lead to incorrect calculation of the actual demand covered, thereby causing the non-optimality of the solution.
[0066] As shown in Figure 1 , regardless of the way of coverage metric (arbitrary coverage, center coverage, 50% area coverage or complete coverage), there is a significant difference between the units considered to be covered and the actual covered demand. This feature makes it difficult for the MILP model to handle the uncertainty caused by aggregated demand units.
[0067] Based on this, the embodiment of the present application provides a greenway site selection optimization method and device based on graph neural network and reinforcement learning, which can train an intelligent agent considering uncertainty, thereby obtaining a more balanced and comprehensive greenway site selection scheme.
[0068] First, the greenway site selection optimization method based on graph neural network and reinforcement learning of the present application will be described below. Figures 2-6
[0069] Please refer to Figure 2 , Figure 2 is the flowchart of the greenway site selection optimization method based on graph neural network and reinforcement learning provided by the embodiment of the present application. As shown in Figure 2 , the method comprises steps 201-205.
[0070] Step 201, obtaining a plurality of candidate linear elements and a plurality of area elements for organizing demand in a study area.
[0071] Specifically, the basic geographic vector element data in the study area is read through the data path set by the user, including candidate linear element data and area element data for organizing demand. The intersection elements between the linear elements are calculated according to the vertex coordinates of the linear elements. According to the field set by the user, the original attributes of the linear elements, area elements and intersection elements are read, and the original attributes are normalized for further operation. It should be noted that the attributes mentioned below are normalized attributes.
[0072] Step 202, generating a plurality of individual demand points in each area element, and calculating the coverage relationship between the individual demand points and the candidate linear elements.
[0073] Specifically, the demand unit of urban greenways is an aggregated surface feature. Based on the demand data within each surface feature, a number of individual demand points far exceeding the actual demand are generated within that surface feature. The coverage relationship between the individual demand points and the candidate line features is calculated. A large number of computational tasks can be completed before training, providing a data foundation for subsequent individual demand point sampling and coverage calculation, thereby improving the smoothness and efficiency of training.
[0074] Optionally, the distribution pattern of several individual demand points generated within each surface feature includes at least one of the following distribution patterns: uniform distribution, marginal distribution, central distribution, and multi-center distribution.
[0075] Step 203: Build an environment based on the candidate line features and their attributes, the area features and their attributes, the intersection features and their attributes between the candidate line features, individual demand points, and coverage relationships.
[0076] Specifically, the environment is a crucial component of reinforcement learning. The agent learns strategies and solves practical problems through interaction with the environment. The greenway maximum coverage site selection optimization problem can be viewed as the environment, primarily comprising: candidate line elements and their attributes, area elements and their attributes, intersection points between candidate line elements and their attributes, individual demand points, and coverage relationships. During interaction with the agent, the attributes of each part of the environment change accordingly. This dynamic environment provides a basis for the reinforcement learning agent to learn about the uncertainty of demand distribution, avoiding the partial coverage problem that occurs in typical static environments.
[0077] In the greenway maximum coverage site selection optimization problem, it is necessary to select line features from candidate line features under constraints to achieve the goal of maximizing the total coverage demand. These constraints include: 1) the total length of the selected line features is less than or equal to the length of the maximum line feature; 2) the selected line features must be spatially continuous, and branching paths and loops are prohibited. For example, constraint 2) restricts three cases as follows: Figure 3 The selected line features shown are spatially discontinuous, exhibiting branching paths and loops. The total covered demand is generally calculated by measuring the Euclidean distance between the selected line features and each polygon feature with a demand attribute value. If the distance is less than a set distance threshold, the demand attribute value of that polygon feature is added to the total demand. For example... Figure 4As shown, the number in each face element represents the demand attribute value. According to the set distance threshold, the coverage range of the selected line element can be calculated, and the distance from any point in the coverage range to the selected line element is less than the set distance threshold. Through the coverage relationship between the coverage range and each face element, the covered face element can be determined. The demand attribute value of the covered face element is summed up to obtain the target value of the line element selection scheme, which is 36 in this example. The final purpose of the maximum coverage site selection optimization problem is to maximize the calculated target value.
[0078] In step 204, data sampling is performed in a loop to execute a Markov decision process to obtain a training data set. In each loop, the agent aggregates and encodes the current state fed back by the environment using a graph neural network as the input of the policy network. The environment randomly samples the target individual demand points from the actual demand quantity in each face element when the current selected line element reaches the maximum line element length. The ratio of the number of target individual demand points covered by the current selected line element determined based on the coverage relationship to the total number of target individual demand points is taken as the reward fed back to the agent.
[0079] Specifically, a Markov decision process (MDP) consists of four basic elements, namely state, action, reward and transition. Among them, 1) state: the layout of elements in the research area and related attribute parameters; 2) action: the agent will make action selection in the candidate line element in the spatial maximum coverage site selection optimization problem, and some illegal actions will be shielded; 3) reward: the reward of each intermediate time step is set to 0, and at the final time step, the environment calculates the proportion of covered demand as the settlement value of the reward; 4) transition: the element attribute in the research area will change according to the action selection of the agent. In the Markov decision process, the transition probability and reward function of the current time step only depend on the state of the time step and the decision of the agent, and are independent of the state and decision of the past time step. This feature makes it suitable for decision-making in dynamic environments, and the optimal state value function is calculated to maximize the long-term cumulative reward, thereby determining the optimal strategy to solve the decision-making problem.
[0080] In an embodiment, the data sampling in the loop to execute the Markov decision process in step 204 to obtain the training data set comprises:
[0081] In step 2041, a preset number of agents and environments are copied.
[0082] Step 2042, assign a thread to each agent and environment, execute the Markov decision process in a loop with the agent and the environment, and sample data in the loop of executing the Markov decision process until the total number of samples of each thread reaches the preset number of samples, to obtain a training data set.
[0083] In this embodiment, multiple identical agents and environments are copied, and for each agent and environment, the assigned thread is used to independently execute the Markov decision process in a loop, and sample data in the loop of executing the Markov decision process. Multiple threads can simultaneously sample data, which can improve the efficiency of data sampling.
[0084] In one embodiment, the graph neural network includes a graph generation layer and a multi-layer convolutional layer, and the graph neural network is specifically used to execute the following steps 301-303.
[0085] Step 301, using the graph generation layer to extract the candidate line elements and their attributes, the surface elements and their attributes, and the intersection elements and their attributes between the candidate line elements from the input tensor, and constructing a topological graph with the candidate line elements as edges, the surface elements as faces, and the intersection elements as vertices, which can realize the normalization of input data.
[0086] Specifically, as shown in Table 1, each graph element in the topological graph has its unique attributes.
[0087] Table 1: Attribute table of each graph element in the topological graph
[0088]
[0089] In the transition caused by the action of the agent, the attribute of the type of dynamic will change, and the reward can be obtained by counting the "demand quantity" attribute of the covered surface.
[0090] Although the state tensor can be converted into a standard topological graph, directly training the entire topological graph as data input still requires a large amount of time and excellent physical device foundation. Therefore, embedding the attributes of adjacent vertices, edges and faces in the topological graph with each other can realize the aggregation and simplification of information, thereby accelerating the process of the agent recognizing the environment and learning the strategy. The encoding process of the topological graph is described below.
[0091] Step 302, the attributes of edges, faces and vertices in the topological graph and the attributes of environmental elements are respectively preliminarily encoded to obtain the attribute encoding of edges, faces and vertices and the attribute encoding of environmental elements.
[0092] Specifically, the preliminary encoding can be performed by expressions (1)-(4):
[0093] (1)
[0094] (2)
[0095] (3)
[0096] (4)
[0097] wherein, , , respectively represent the attributes of edges, faces and vertices in the current topological graph, represent the attributes of environmental elements, , , , represent the linear layers for transformation, 、 、 、 respectively represent the attribute encodings of edges, faces, vertices and environmental elements.
[0098] Step 303, using the current convolutional layer to perform the following steps 3031-3034.
[0099] Step 3031, for each edge, aggregate the attribute encodings of the edge-adjacent edges, faces and vertices respectively, and concatenate the aggregated attribute encodings of the edge-adjacent edges, faces and vertices to obtain the aggregated attribute encoding of the edge.
[0100] Specifically, the attribute encodings of the edge-adjacent edges, faces and vertices can be aggregated respectively by expressions (5)-(7):
[0101] (5)
[0102] (6)
[0103] (7)
[0104] wherein, , , represent linear transformation layers, || represents a concatenation operation, represents the set of edges adjacent to the edge, represents the number of faces in .
[0105] Then, the aggregated attribute encodings of the edge-adjacent edges, faces and vertices can be concatenated by expression (8):
[0106] (8)
[0107] wherein, denotes the aggregated attribute encoding of the edge, denotes the linear transformation layer.
[0108] Step 3032, for each vertex, aggregate the aggregated attribute encoding of the edges adjacent to the vertex into the attribute encoding of the vertex.
[0109] Specifically, considering the importance of the vertex in the continuity of the online element, the aggregated edge can be re-aggregated into the vertex by expression (9):
[0110] (9)
[0111] wherein, denotes the linear transformation layer, denotes the vertex adjacent edge set, denotes the number of edges in .
[0112] Step 3033, taking the attribute encoding of the edge, face and vertex finally obtained by the current convolution layer as the input of the next convolution layer.
[0113] Step 3034, generating the encoding tensor of the topological graph based on the attribute encoding of the edge and vertex output by the last convolution layer and the attribute encoding of the environmental element.
[0114] Specifically, after passing through layers of convolution layers, the attribute encoding of the edge and vertex and can be obtained. The encoding of the entire topological graph can be represented by expressions (10)-(12):
[0115] (10)
[0116] (11)
[0117] (12)
[0118] wherein, denotes the encoding of the topological graph.
[0119] In an embodiment, the Markov decision process in step 2042 is executed by using the agent and the environment in a loop, and data sampling is performed in the loop of executing the Markov decision process, including: executing the following steps 401-406 in a loop.
[0120] Step 401, the agent requests the current state from the environment; the current state includes the attributes of the candidate line elements, the surface elements, and the intersection elements between the candidate line elements.
[0121] Step 402, the agent converts the current state fed back by the environment into a state tensor, and inputs the state tensor into a graph neural network for aggregated encoding to obtain an edge-aggregated encoded tensor.
[0122] Step 403, the agent inputs the edge-aggregated encoded tensor into a policy network to obtain the probabilities of different actions, and screens illegal actions to obtain a probability distribution; the action is to select a candidate line element.
[0123] Specifically, the policy network is the core of the decision-making of the agent. At each time step, it accepts the edge-aggregated encoded tensor output by the graph neural network as input, and outputs the probability distribution of the selected action. Specifically, the edge-aggregated encoded tensor is first passed through a multi-layer perceptron (MLP) to obtain a score, and is converted into a probability distribution through a Softmax function:
[0124] (13)
[0125] (14)
[0126] wherein, represents the edge-aggregated encoded tensor, represents the score, represents the probability distribution.
[0127] The action selected by the agent will be sampled from this probability distribution. In addition, for some obviously illegal actions, such as repeated line element selection or discontinuous line element selection, an action mask will be used to filter them, reducing the number of action selections and further improving the training efficiency.
[0128] Step 404, the agent samples the current action based on the probability distribution and submits the current action to the environment.
[0129] Step 405, the environment updates the state based on the current action and feeds back the next state and the current reward to the agent.
[0130] In an embodiment, the environment in step 405 feeds back the current reward to the agent, including:
[0131] The environment feeds back a negative reward to the agent as the current reward in the case that the current selected line element is a loop or all actions corresponding to the next state are illegal actions (such as repeated line element selection or discontinuous line element selection).
[0132] The environment feeds back a current reward to the agent based on a ratio of a number of target individual demand points covered by the current selected line element determined based on the covering relationship to a total number of the target individual demand points when the current selected line element reaches a maximum line element length.
[0133] Step 406, pack and store the current state, current action, probability distribution, next state, current reward and completion state as training data collected in this cycle; the completion state is used to represent that there is no selected line element meeting the restriction condition at present.
[0134] Step 205, training the agent based on the training data set, and obtaining a greenway site selection scheme by using the trained agent, the greenway site selection scheme including a plurality of selected line elements and a total amount of covered demand.
[0135] In an embodiment, the training of the agent based on the training data set in step 205 includes: cyclically performing the following steps: data sampling from the training data set to obtain a plurality of target training data; converting each target training data into a plurality of target tensors; for each target tensor, inputting a state in the target tensor into a graph neural network, constructing a target topological graph by using the graph neural network and generating a target encoding tensor of the target topological graph; inputting the target encoding tensor of the target topological graph into a value network to obtain a state estimated value; and adjusting network parameters of the agent based on the state estimated value.
[0136] Specifically, the value network is used to predict and evaluate the decisions made by the agent, thereby helping the agent to further improve its decision-making ability. Unlike the policy network, the value network accepts the encoding tensor of the entire topological graph as input and directly obtains the predicted value of the current policy:
[0137] (15)
[0138] The policy network and the value network together constitute the reinforcement learning agent. In training, the weight parameters of the multilayer perceptron will be continuously optimized until the generated action approaches the optimal and the predicted policy value approaches the actual value.
[0139] Optionally, proximal policy optimization is the main algorithm used in the training of the agent. The loss function used in the training mainly consists of three parts: policy loss, value loss and entropy loss. The specific calculation methods of the policy loss, the value loss and the entropy loss are not described here.
[0140] The method for obtaining the greenway site selection scheme by using the trained agent specifically comprises the following steps of S1, finding a line element that can meet the constraint condition in all unselected candidate line elements , and performing S2; S2, if the set is not empty, performing S3, otherwise performing S4; S3, selecting an element from the set by the agent, and adding the element to the selected line elements, and performing S1; S4, calculating the total amount of covered demands, and outputting the selected line elements and the total amount of covered demands.
[0141] The method for optimizing greenway site selection based on the graph neural network and the reinforcement learning provided in the embodiments of the present application first acquires a plurality of candidate line elements in a research area and a plurality of surface elements for organizing demands; then generates a plurality of individual demand points in each surface element, and calculates the covering relationship between the individual demand points and the candidate line elements; in this way, a large amount of calculation tasks can be completed before training, and the fluency and efficiency of training can be improved; then, an environment is built based on the candidate line elements and their attributes, the surface elements and their attributes, the intersection elements between the candidate line elements and their attributes, the individual demand points and the covering relationship; data sampling is performed in the cyclic execution of the Markov decision process to obtain a training data set; in each cycle, the agent aggregates and encodes the current state fed back by the environment by using the graph neural network as the input of the policy network, which can realize the simplification and aggregation of information, thereby accelerating the process of the agent identifying the environment and learning the strategy; when the current selected line elements reach the maximum line element length, the environment randomly samples a target individual demand point of the actual demand quantity from a plurality of individual demand points in each surface element, and takes the ratio of the number of the target individual demand points covered by the current selected line elements to the total number of the target individual demand points as the reward fed back to the agent; since the target individual demand points sampled each time are different, the environment needs to dynamically calculate the coverage of the demands; finally, the agent is trained based on the training data set, and a greenway site selection scheme is obtained by using the trained agent; the greenway site selection scheme comprises a plurality of selected line elements and the total amount of covered demands; since the agent will face the demand distribution situation and the demand coverage calculation result for millions of times in the process of interacting with the environment, a more balanced and comprehensive greenway site selection scheme is learned. Therefore, the embodiments of the present application can train an agent considering uncertainty, thereby obtaining a more balanced and comprehensive greenway site selection scheme.
[0142] The method for optimizing greenway site selection based on the graph neural network and the reinforcement learning provided in the embodiments of the present application (hereinafter referred to as the present method) is verified through specific experiments.
[0143] In solving the maximum coverage site selection optimization problem, the best scheme is generally obtained by establishing a MILP model. In practical applications, taking some blocks in a certain area as an example, under two different coverage distance threshold settings, the greenway site selection schemes obtained by the MILP model and the greenway site selection schemes obtained by the method are compared, and the test results are shown in Table 2.
[0144] Table 2 Test results
[0145]
[0146] From the above Table 2 and Figure 5 and 6 It can be seen that in the test results of the coverage distance of 800 meters and 100 meters, the ratio of the coverage demand to the total demand of the method is greater than the ratio of the coverage demand to the total demand obtained by the MILP model using four different coverage measurement methods. Therefore, no matter under which distance threshold setting, the method can obtain a better solution, and the improvement is large, which shows that the method can consider the uncertain factors and give a better greenway site selection scheme than the traditional MILP model.
[0147] The greenway site selection optimization device based on the graph neural network and the reinforcement learning provided by the application is described below. The greenway site selection optimization device based on the graph neural network and the reinforcement learning described below can be correspondingly referred to the greenway site selection optimization method based on the graph neural network and the reinforcement learning described above.
[0148] Please refer to Figure 7 , Figure 7 is a structural schematic diagram of the greenway site selection optimization device based on the graph neural network and the reinforcement learning provided by the embodiment of the application. As Figure 7 shown, the device can include:
[0149] The acquisition module 10 is configured to acquire a plurality of candidate line elements in a research area and a plurality of surface elements for organizing demand.
[0150] The generation module 20 is configured to generate a plurality of individual demand points in each surface element.
[0151] The calculation module 30 is configured to calculate the coverage relationship between the individual demand points and the candidate line elements.
[0152] The building module 40 is configured to build an environment based on the candidate line elements and their attributes, the surface elements and their attributes, the intersection elements between the candidate line elements and their attributes, the individual demand points and the coverage relationship.
[0153] The sampling module 50 is configured to sample data in the loop execution of the Markov decision process to obtain a training data set; in each loop, the agent aggregates and encodes the current state fed back by the environment by using the graph neural network as input of the policy network; the environment randomly samples a target individual demand point from a plurality of individual demand points in each area element when the current selected line element reaches the maximum line element length, and takes the ratio of the number of target individual demand points covered by the current selected line element determined based on the coverage relationship to the total number of target individual demand points as the reward fed back to the agent;
[0154] The training module 60 is configured to train the agent based on the training data set;
[0155] The optimization module 70 is configured to obtain a greenway site selection scheme by using the trained agent, and the greenway site selection scheme includes a plurality of selected line elements and a total amount of covered demand.
[0156] In an embodiment, the sampling module 50 includes:
[0157] The copying unit is configured to copy a preset number of agents and environments;
[0158] The sampling unit is configured to allocate a thread to each agent and environment, execute the Markov decision process by using the agent and the environment, and sample data in the loop execution of the Markov decision process until the total sampling number of each thread reaches a preset sampling number, to obtain the training data set.
[0159] In an embodiment, the sampling unit is specifically configured to:
[0160] The following steps are executed in a loop:
[0161] The agent requests the current state from the environment; the current state includes attributes of the to-be-selected line element, the area element, and the intersection element between the to-be-selected line elements;
[0162] The agent converts the current state fed back by the environment into a state tensor, and inputs the state tensor into the graph neural network for aggregation and encoding to obtain an edge-aggregated encoded tensor;
[0163] The agent inputs the edge-aggregated encoded tensor into the policy network to obtain probabilities of different actions, and masks the illegal actions to obtain a probability distribution; the action is to select a to-be-selected line element;
[0164] The agent samples a current action based on the probability distribution, and submits the current action to the environment;
[0165] The environment updates the state based on the current action, and feeds back a next state and a current reward to the agent;
[0166] The current state, the current action, the probability distribution, the next state, the current reward, and the completion state are packaged and stored as training data collected in the current cycle; the completion state is used to represent that there is no any candidate line element that meets the restriction condition.
[0167] In an embodiment, the sampling unit is specifically configured to:
[0168] The environment feeds back a negative reward as the current reward to the agent in the case that the current selected line element is a loop or all actions corresponding to the next state are illegal actions.
[0169] When the current selected line element reaches the maximum line element length, the environment randomly samples a target individual demand point from a plurality of individual demand points in each surface element, and feeds back a ratio of a number of target individual demand points covered by the current selected line element determined based on the covering relationship to a total number of target individual demand points to the agent as the current reward.
[0170] In an embodiment, the training module 60 is specifically configured to:
[0171] The following steps are cyclically executed:
[0172] Data sampling is performed from the training data set to obtain a plurality of target training data;
[0173] Each target training data is converted into a plurality of target tensors;
[0174] For each target tensor, the target tensor is input into the graph neural network, and the graph neural network is used to construct a target topological graph and generate a target encoding tensor of the target topological graph;
[0175] The target encoding tensor of the target topological graph is input into the value network to obtain a state estimation value;
[0176] The network parameters of the agent are adjusted based on the state estimation value.
[0177] In an embodiment, the graph neural network includes a graph generation layer and a plurality of convolution layers;
[0178] The graph neural network is specifically configured to:
[0179] The graph generation layer is used to extract the candidate line element and its attributes, the surface element and its attributes, and the intersection element and its attributes between the candidate line element and the surface element from the input tensor, and to construct a topological graph with the candidate line element as the edge, the surface element as the face, and the intersection element as the vertex.
[0180] The attributes of the edge, the face, and the vertex in the topological graph and the attributes of the environmental elements are respectively preliminarily encoded to obtain the attribute encoding of the edge, the face, and the vertex and the attribute encoding of the environmental elements.
[0181] The following steps are performed using the current convolutional layer:
[0182] For each edge, the attribute codes of the edge-adjacent edges, faces and vertices are aggregated respectively, and the attribute codes of the edge-adjacent edges, faces and vertices after aggregation are spliced to obtain the attribute codes of the edges after aggregation;
[0183] For each vertex, the attribute codes of the vertex-adjacent edges after aggregation are aggregated to the attribute codes of the vertex;
[0184] The attribute codes of the edges, faces and vertices finally obtained by the current convolutional layer are taken as inputs of the next convolutional layer;
[0185] Based on the attribute codes of the edges and vertices output by the last convolutional layer and the attribute codes of the environmental elements, an encoding tensor of the topological graph is generated.
[0186] In an embodiment, the distribution pattern of the several individual demand points generated within each face element includes at least one of a uniform distribution, an edge distribution, a center distribution and a multi-center distribution.
[0187] Figure 8 An example of an entity structure diagram of an electronic device is shown in FIG. 1. Figure 8As shown, the electronic device can include a processor 810, a communications interface 820, a memory 830, and a communications bus 840, wherein the processor 810, the communications interface 820, and the memory 830 complete mutual communication through the communications bus 840. The processor 810 can invoke the logic instructions in the memory 830 to execute the greenway site selection optimization method based on the graph neural network and reinforcement learning, which includes: acquiring a plurality of candidate line elements in a study area and a plurality of surface elements for organizing demand; generating a plurality of individual demand points in each surface element, and calculating the coverage relationship between the individual demand points and the candidate line elements; building an environment based on the candidate line elements and their attributes, the surface elements and their attributes, the intersection elements between the candidate line elements and their attributes, the individual demand points, and the coverage relationship; data sampling is performed in the cyclic execution of the Markov decision process to obtain a training data set; at each cycle, the agent aggregates and encodes the current state feedback from the environment using the graph neural network as the input of the policy network; when the current selected line element reaches the maximum line element length, the environment randomly samples a target individual demand point from a plurality of individual demand points in each surface element, and the ratio of the number of target individual demand points covered by the current selected line element based on the coverage relationship to the total number of target individual demand points is taken as the reward feedback to the agent; training the agent based on the training data set, and obtaining a greenway site selection scheme using the trained agent, wherein the greenway site selection scheme includes a plurality of selected line elements and a total amount of covered demand.
[0188] In addition, the logic instructions in the memory 830 described above can be implemented in the form of a software functional unit and sold or used as an independent product, which can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application or the part of the technical solutions that make essential contributions to the prior art or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0189] In another aspect, the present application also provides a computer program product comprising a computer program, which can be stored on a non-transitory computer-readable storage medium, and the computer program can be executed by a processor to enable a computer to perform the greenway site selection optimization method based on a graph neural network and reinforcement learning provided by the above-mentioned methods, which comprises: acquiring a plurality of candidate line elements and a plurality of surface elements for organizing demand in a study area; generating a plurality of individual demand points in each surface element and calculating the coverage relationship between the individual demand points and the candidate line elements; building an environment based on the candidate line elements and their attributes, the surface elements and their attributes, the intersection elements between the candidate line elements and their attributes, the individual demand points and the coverage relationship; performing data sampling in the Markov decision process in each cycle to obtain a training data set; in each cycle, the agent aggregates and encodes the current state fed back by the environment using the graph neural network as the input of the policy network; when the current selected line element reaches the maximum line element length, the environment randomly samples a target number of individual demand points from the plurality of individual demand points in each surface element, and takes the ratio of the number of target individual demand points covered by the current selected line element based on the coverage relationship to the total number of target individual demand points as the reward fed back to the agent; training the agent based on the training data set, and obtaining a greenway site selection scheme using the trained agent, wherein the greenway site selection scheme comprises a plurality of selected line elements and the total demand covered.
[0190] In another aspect, the present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and the computer program can be executed by a processor to implement the greenway site selection optimization method based on a graph neural network and reinforcement learning provided by the above-mentioned methods, which comprises: acquiring a plurality of candidate line elements and a plurality of surface elements for organizing demand in a study area; generating a plurality of individual demand points in each surface element and calculating the coverage relationship between the individual demand points and the candidate line elements; building an environment based on the candidate line elements and their attributes, the surface elements and their attributes, the intersection elements between the candidate line elements and their attributes, the individual demand points and the coverage relationship; performing data sampling in the Markov decision process in each cycle to obtain a training data set; in each cycle, the agent aggregates and encodes the current state fed back by the environment using the graph neural network as the input of the policy network; when the current selected line element reaches the maximum line element length, the environment randomly samples a target number of individual demand points from the plurality of individual demand points in each surface element, and takes the ratio of the number of target individual demand points covered by the current selected line element based on the coverage relationship to the total number of target individual demand points as the reward fed back to the agent; training the agent based on the training data set, and obtaining a greenway site selection scheme using the trained agent, wherein the greenway site selection scheme comprises a plurality of selected line elements and the total demand covered.
[0191] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected to achieve the purposes of the embodiments according to actual needs. Those skilled in the art can understand and implement without creative labor.
[0192] Through the description of the above embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software and the necessary general hardware platform, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.
[0193] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A greenway site selection optimization method based on a graph neural network and reinforcement learning, characterized in that, The method comprises the following steps: acquiring a plurality of candidate line elements and a plurality of surface elements for organizing demand in a research area; generating a plurality of individual demand points in each of the surface elements and calculating the covering relationship between the individual demand points and the candidate line elements; building an environment based on the candidate line elements and their attributes, the surface elements and their attributes, intersection elements between the candidate line elements and their attributes, the individual demand points and the covering relationship; performing data sampling in a loop to execute a Markov decision process to obtain a training data set; in each loop, an agent aggregates and encodes a current state fed back by the environment by using a graph neural network as an input of a policy network; when a current selected line element reaches a maximum line element length, the environment randomly samples a target number of individual demand points from the plurality of individual demand points in each of the surface elements, and takes the ratio of the number of the target individual demand points covered by the current selected line element determined based on the covering relationship to the total number of the target individual demand points as a reward fed back to the agent; training the agent based on the training data set, and obtaining a greenway site selection scheme by using the trained agent, the greenway site selection scheme comprising a plurality of selected line elements and a total amount of covered demand; the data sampling in the loop to execute the Markov decision process to obtain the training data set comprises: copying a preset number of agents and environments; allocating a thread to each of the agents and the environments, and performing a Markov decision process by using the agents and the environments in a loop, and performing data sampling in the loop to execute the Markov decision process until the total sampling number of each thread reaches a preset sampling number to obtain the training data set; the performing of the Markov decision process by using the agents and the environments in the loop and the performing of the data sampling in the loop to execute the Markov decision process comprise: performing the following steps in a loop: the agent requests a current state from the environment; the current state comprises the attributes of the candidate line elements, the surface elements and the intersection elements between the candidate line elements; the agent converts the current state fed back by the environment into a state tensor, and inputs the state tensor into the graph neural network to aggregate and encode, to obtain an edge-aggregated encoded tensor; the agent inputs the edge-aggregated encoded tensor into the policy network to obtain the probability of different actions, and shields illegal actions to obtain a probability distribution; the action is to select a candidate line element; the agent samples a current action based on the probability distribution, and submits the current action to the environment; the environment updates a next state based on the current action, and feeds back the next state and a current reward to the agent; the current state, the current action, the probability distribution, the next state, the current reward and a completion state are packaged and stored as training data collected in the current loop; the completion state is used to represent that there is no candidate line element meeting the restriction condition at present.
2. The greenway site selection optimization method based on a graph neural network and reinforcement learning according to claim 1, characterized in that, The environment updates a state based on the current action, and feeds a next state and a current reward back to the agent, including: The environment feeds a negative value reward as the current reward back to the agent in a case that the current selected line element is a loop or all actions corresponding to the next state are illegal actions; The environment randomly samples the actual demand quantity of target individual demand points from the plurality of individual demand points in each of the surface elements when the current selected line element reaches a maximum line element length, and feeds a ratio of a quantity of the target individual demand points covered by the current selected line element determined based on the covering relationship to a total quantity of the target individual demand points as the current reward back to the agent.
3. The greenway site selection optimization method based on a graph neural network and reinforcement learning according to claim 1, characterized in that, The training of the agent based on the training data set includes: The following steps are executed in a loop: data sampling is performed from the training data set to obtain a plurality of target training data; each of the target training data is converted into a plurality of target tensors; for each of the target tensors, the target tensor is input into the graph neural network, a target topological graph is constructed by using the graph neural network, and a target encoding tensor of the target topological graph is generated; the target encoding tensor of the target topological graph is input into a value network to obtain a state estimation value; the network parameters of the agent are adjusted based on the state estimation value.
4. The greenway site selection optimization method based on a graph neural network and reinforcement learning according to claim 1 or 3, characterized in that, The graph neural network includes a graph generation layer and a plurality of convolution layers; The graph neural network is specifically used for: extracting, by using the graph generation layer, candidate line elements and attributes thereof, surface elements and attributes thereof, and intersection elements and attributes thereof from an input tensor, constructing a topological graph with the candidate line elements as edges, the surface elements as faces, and the intersection elements as vertices; preliminarily encoding attributes of edges, faces, and vertices in the topological graph and attributes of environmental elements to obtain attribute encodings of the edges, faces, and vertices and attribute encodings of the environmental elements; the following steps are executed by using the current convolution layer: for each edge, attribute encodings of edges, faces, and vertices adjacent to the edge are aggregated respectively, and the attribute encodings of the edges, faces, and vertices adjacent to the edge after aggregation are spliced to obtain attribute encodings of the edges after aggregation; for each vertex, attribute encodings of edges adjacent to the vertex are aggregated onto attribute encodings of the vertex; attribute encodings of edges, faces, and vertices finally obtained by the current convolution layer are taken as inputs of a next convolution layer; an encoding tensor of the topological graph is generated based on attribute encodings of edges and vertices output by the last convolution layer and attribute encodings of the environmental elements.
5. The greenway site selection optimization method based on a graph neural network and reinforcement learning according to claim 1, characterized in that, The distribution mode of the plurality of individual demand points generated in each of the surface elements includes at least one of a uniform distribution, an edge distribution, a center distribution, and a multi-center distribution.
6. A greenway site selection optimization device based on a graph neural network and reinforcement learning, characterized in that, including: an acquisition module configured to acquire a plurality of candidate line elements in a study area and a plurality of surface elements for organizing demand; a generation module configured to generate a plurality of individual demand points in each of the surface elements; a calculation module configured to calculate a covering relationship between the individual demand points and the candidate line elements; The building module is configured to build an environment based on the candidate line elements and their attributes, the surface elements and their attributes, intersection elements between the candidate line elements and their attributes, the individual demand points, and the coverage relationship; The sampling module is configured to sample data in a loop to perform a Markov decision process to obtain a training data set; In each loop, the agent aggregates and encodes a current state fed back by the environment using a graph neural network as an input of a policy network; when the current selected line element reaches a maximum line element length, the environment randomly samples a target number of individual demand points from the individual demand points in each surface element, and takes a ratio of a number of the target individual demand points covered by the current selected line element determined based on the coverage relationship to a total number of the target individual demand points as a reward fed back to the agent; The training module is configured to train the agent based on the training data set; The optimization module is configured to obtain a greenway site selection scheme including a plurality of selected line elements and a total amount of coverage demand by using the trained agent. The sampling module includes: The copying unit is configured to copy a preset number of agents and environments; The sampling unit is configured to allocate a thread to each agent and environment, and perform a Markov decision process using the agent and the environment in a loop, and sample data in the loop until a total sampling number of the threads reaches a preset sampling number to obtain the training data set. The sampling unit is specifically configured to: The agent requests a current state from the environment; the current state includes attributes of the candidate line elements, the surface elements, and the intersection elements between the candidate line elements; The agent converts the current state fed back by the environment into a state tensor, and inputs the state tensor into a graph neural network to aggregate and encode to obtain an edge-aggregated encoded tensor; The agent inputs the edge-aggregated encoded tensor into a policy network to obtain probabilities of different actions, and masks illegal actions to obtain a probability distribution; the action is to select a candidate line element; The agent samples a current action based on the probability distribution, and submits the current action to the environment; The environment updates a next state based on the current action, and feeds back the next state and a current reward to the agent; The current state, the current action, the probability distribution, the next state, the current reward, and a completion state are packaged and stored as training data collected in the loop; the completion state is used to represent that there is no candidate line element that meets the restriction condition. The computer program is executed by the processor to implement the greenway site selection optimization method based on the graph neural network and the reinforcement learning.
7. An electronic device comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, The computer program is executed by the processor to implement the greenway site selection optimization method based on the graph neural network and the reinforcement learning.
8. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that,
Citation Information
Patent Citations
Green channel network identification method based on machine learning
CN115481699A
Greenway line selection method based on GIS software
CN116187638A