Evolutionary method for solving the maximum matching problem in bipartite graphs

CN122594882APending Publication Date: 2026-08-18XIAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610759912.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-29
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0010]本发明的目的是提供求解二部图最大匹配问题的进化方法,解决了现有求解大规模、复杂结构的二部图最大匹配问题时,存在的效率低、稳定性差、多样性不足等难以满足实际应用需求的问题

Benefits of technology

[0021] The beneficial effects of the present invention are: (A) The present invention establishes a connection relationship matrix of a bipartite graph, which reflects the relationship between nodes and edges in the bipartite graph and provides a unique numerical representation, providing a new method for subsequent algorithm processes and fitness function estimation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122594882A_ABST
    Figure CN122594882A_ABST
Patent Text Reader

Abstract

The application discloses a new evolutionary method for solving the maximum matching problem of a bipartite graph, and comprises the following steps: firstly, performing mathematical representation on the bipartite graph; then, defining double-sequence optimization variables and a fitness function; setting an alternative list for all nodes in a U set; generating an initial X population; generating an initial Y population according to the initial X population; iteratively updating the Y population; and finally, continuously iterating the Y population to improve the fitness and finally outputting. The application solves the problems of low efficiency, poor stability, insufficient diversity and other problems that cannot meet the actual application requirements when solving the maximum matching problem of a large-scale and complex-structure bipartite graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer science and technology, specifically relating to an evolutionary method for solving the maximum matching problem in a bipartite graph. Background Technology

[0002] The maximum matching problem in bipartite graphs is a classic combinatorial optimization problem in graph theory. Its core is to find the maximum number of edge subsets in a bipartite graph whose vertices can be partitioned into two disjoint subsets, such that no two edges in the subset share a common endpoint. This problem has significant theoretical research value and wide-ranging practical applications, serving as a core problem in many complex engineering problems: in resource allocation scenarios, it can achieve optimal pairing of tasks and executors, improving resource utilization; in the network domain, it can optimize communication link allocation, ensuring maximum effective connections between nodes; in bioinformatics, it can be used for protein-protein interaction network analysis, assisting in the identification of key interaction pairs and drug development; in image retrieval systems, it can quickly match feature information between target images and massive candidate images, improving retrieval efficiency. With the advent of the big data era, the scale and structure of bipartite graphs in practical applications are constantly expanding, placing higher demands on the efficiency, stability, and high-dimensional adaptability of solution algorithms.

[0003] For the maximum matching problem in bipartite graphs, existing technologies are mainly divided into two categories: classical exact algorithms and traditional intelligent optimization algorithms.

[0004] Classical exact algorithms guarantee optimality through rigorous mathematical logic and graph theory principles, forming the traditional core of this problem's solution. Among them, the Kuhn-Munkres algorithm is the most representative fundamental algorithm, which uses depth-first search to alternately find augmenting paths to expand the matching size, achieving a time complexity of O(n log n). V²E (V is the number of vertices, E is the number of edges), which has the advantages of simple implementation and easy understanding, and is suitable for small-scale bipartite graph matching problems. To optimize efficiency, the Hopcroft-Karp algorithm is based on the idea of ​​hierarchical graphs and uses breadth-first search to find the shortest augmenting path in batches, reducing the time complexity to O(V). In dense graphs, it exhibits superior performance and has become a common choice for medium to large-scale problems. Furthermore, the Ford-Fulkerson method based on the maximum flow minimum cut theorem and the Dinic algorithm can also be solved by transforming the matching problem into a flow network problem. The Dinic algorithm, in particular, optimizes augmenting path search through a hierarchical graph, achieving a time complexity of O(n log n). V²E It has good applicability under specific graph structures.

[0005] Currently, there are few traditional intelligent optimization algorithms for solving the maximum matching problem in bipartite graphs, largely due to the lack of suitable mathematical representations. (1+1)DE is one of the few intelligent optimization algorithms that can be used to solve the maximum matching problem. However, when the problem has a very high dimensionality, this method's efficiency is severely limited. With the development of intelligent optimization techniques, some researchers have attempted to apply traditional intelligent optimization algorithms to the maximum matching problem in bipartite graphs, but these methods are still in the early stages of exploration.

[0006] Although existing technologies have achieved solutions for maximum matching in bipartite graphs under certain scenarios, they still have significant shortcomings in practical applications and cannot meet the needs of complex high-dimensional scenarios. The specific problems are as follows: 1. The performance of classic exact algorithms is significantly constrained by the graph size: As the number of vertices and edges in a bipartite graph increases, the time complexity of classic algorithms grows exponentially, making it difficult to complete the solution in a finite time for large-scale sparse graphs or high-dimensional complex graphs. For example, the Hungarian algorithm's search space expands dramatically after the number of vertices exceeds a thousand, resulting in a significant decrease in the efficiency of augmenting path finding; although the Hopcroft-Karp algorithm has some optimizations, the overhead of hierarchical graph construction and dynamic augmenting path updates still leads to insufficient robustness in extreme-scale or irregular graph structures. Furthermore, the space complexity of classic algorithms is mostly O(n log n). V² It requires storing the complete adjacency matrix, which can easily lead to storage resource exhaustion in high-dimensional scenarios.

[0007] 2. Traditional intelligent optimization algorithms have shortcomings in adaptability and convergence: Candidate solutions for maximum matching in bipartite graphs have the sparse matrix characteristic of "each row and each column containing only one non-zero element." Their ordered even form is difficult to directly process by the evolutionary basis of traditional intelligent optimization algorithms, leading to inherent obstacles in algorithm application. Existing adaptation methods often lack a universal equivalent transformation mechanism for candidate solutions, failing to effectively eliminate strong constraints between evolutionary basis dimensions, easily generating invalid solutions and reducing search efficiency. Furthermore, traditional intelligent optimization algorithms generally suffer from a lack of heuristic information when dealing with matching problems, resulting in slow population convergence and a tendency to get trapped in local optima, especially in high-dimensional graphs, making it difficult to balance the contradiction between solution accuracy and convergence speed.

[0008] 3. Existing algorithms lack universality: Classical exact algorithms are mostly designed for specific graph structures (such as dense graphs and small-scale graphs), and their performance fluctuates greatly in complex scenarios such as sparse graphs and dynamically changing graphs; the evolution strategies of traditional intelligent optimization algorithms are mostly fixed designs, which do not take into account the structural differences of different matching problems, making it difficult to adaptively adjust the search strategy, resulting in limited adaptability to matching problems in different fields (such as service discovery and feature matching in anti-phishing systems).

[0009] In summary, existing technologies generally suffer from low efficiency, poor stability, and insufficient adaptability when solving the maximum matching problem in large-scale, complex bipartite graphs, making it difficult to meet the needs of practical applications. Therefore, developing a maximum matching algorithm for bipartite graphs that can balance solution accuracy, convergence speed, and scenario universality has become an important research direction in the field of combinatorial optimization. Summary of the Invention

[0010] The purpose of this invention is to provide an evolutionary method for solving the maximum matching problem of bipartite graphs, which solves the problems of low efficiency, poor stability, and insufficient diversity in existing methods for solving the maximum matching problem of large-scale and complex bipartite graphs, making it difficult to meet the needs of practical applications.

[0011] The technical solution adopted in this invention is an evolutionary method for solving the maximum matching problem in a bipartite graph, which is implemented according to the following steps: Step 1: Represent the bipartite graph mathematically; Step 2: Define the bi-sequence optimization variables and fitness function; Step 3: Set up a candidate list for all U set nodes; Step 4: Generate the initial X population; Step 5: Generate the initial population Y based on the initial population X; Step 6: Iteratively update the Y population; Step 7: Continuously iterate the Y population to improve fitness and finally output the results.

[0012] The invention is further characterized in that, Step 1 is implemented in the following steps: Step 1.1: A bipartite graph G=(U,V) consists of two sets of nodes. and Composition, in which set and Each contains and Each node will The nodes in the set are represented as , The nodes in the set are represented as The edge set of a bipartite graph G is used This indicates that the elements in the edge set Represents a node and There exists an edge connecting the two sets. and The number of nodes in the array is not equal, that is If the set has fewer nodes, then the isolated nodes are added to the set with fewer nodes. We will only discuss the case where the two sets have the same number of nodes in the following discussion. Step 1.2, Use and Construct a matrix Used to depict bipartite diagrams The connection relationship between the two parts of the nodes, set With sets The nodes in the set correspond to the rows and columns of the matrix, respectively. any node With sets any node If there exists a connecting edge, then the matrix elements ,otherwise ,Right now .

[0013] Step 2 is implemented in the following steps: Step 2.1: Since the positions of the nodes in set U are variable, it can be represented as... or or Etc. Construct two solution sequences. and , respectively corresponding Sets and A random arrangement of set nodes, for example: Permutations of the corresponding set U ,Right now Representative node Representative node , Representative node And so on. Similarly, sequence Y corresponds to a sorting of set V; The matching relationship of a bipartite graph is represented by combining two sequences. It is assumed that nodes corresponding to the same position in the two sequences are connected by edges, that is, nodes corresponding to the same position in the two sequences ( ) corresponding variables and There exists an edge to be determined. An edge is called an undetermined edge, and all undetermined edges are represented by a set. express; Step 2.2: Establish fitness values Connection matrix with bipartite graph The relationships between them are verified by the algorithm to identify all undetermined edges. In real edge set The corresponding element Does it exist, that is, in the matrix? The corresponding element If the value is 1, increment the fitness value by 1; otherwise, leave the fitness value unchanged. Repeat this process to traverse the set of edges to be determined. The fitness value of the current solution set is obtained. The formula is: .

[0014] Step 3 is implemented in the following steps: For all Set the candidate list for the set nodes, where the nodes The alternative list refers to the points in the bipartite diagram. All of the connected edges The set of nodes in the middle, denoted as The formula is as follows:

[0015] By retrieving the connection matrix , obtain A shortlist of candidate nodes.

[0016] Step 4 is implemented in the following steps: Step 4.1, All nodes in the set according to Sort in ascending order ( Represents a node (The number of nodes in the candidate list), the smallest number corresponding nodes The node with the most candidates is placed at the beginning, and so on, with the node having the most candidates at the end. Following this sorting method, we obtain... The sequence, that is, the corresponding prior sequence. ; Step 4.2, Set There may be multiple nodes with the same number of candidate lists. Group the nodes with the same number of candidate lists into one group, and within each group... The positions of the nodes in the set are randomly arranged to form several The sequence is subsequenced, and then these subsequences are combined to produce different complete sequences. Sequences are generated in this way. a priori solution ( Less than The total number of all possible combinations of the sequence). Step 4.3, Another type The sequence is obtained through a completely random method, that is... The nodes in the set are generated by random sorting. Each individual increases population diversity, at which point the population contains a total of [number] individuals. indivual sequence.

[0017] Step 5 is implemented in the following steps: Step 5.1, for all Collection nodes introduce the number of connections Number of connections Representative in the original two-part diagram Middle node and The number of edges connected to nodes in a set corresponds to the connectivity matrix. middle The sum of the elements in the column, i.e.: ; Step 5.2, for nodes The shortlist Each node in the network is based on the number of connections. Sort the nodes in ascending order, placing those with fewer connections at the front, to obtain the initial candidate list. ; Step 5.3: For any sequence The first node in the list of candidate nodes is selected. , place The first position of the sequence; The second node in the list of candidates is selected and placed in the first position. The second position of the sequence; in this way, the sequence The nodes are arranged in a forward-to-back order to determine the sequence. The element at the corresponding position. During this process, for any node in the set Once placed In the sequence, all subsequent nodes will be removed from the candidate list. .when After all nodes in the sequence have been selected in turn, a path is obtained. Matching sequence; The removed candidate list may contain no nodes, i.e., if ,but Sequence Points Only one empty node can be selected at a time. This continues until all nodes in the population are considered empty. Each sequence finds an initial sequence that matches it, denoted as... .

[0018] Step 6 is implemented in the following steps: Step 6.1, Subsequent updates will only be made. Sequence. In calculating the next generation. When sequencing, give Introducing preference values ​​into set nodes Its initial value is 0, in the individual Before iteration, it is necessary to... Node preference value Reset. The sequence may contain some empty nodes, which also means that some... The node did not appear Therefore, all of them The nodes are divided into a set of selected nodes. and the set of unselected nodes ,Will Increment the preference value of all nodes by 1, while The node preference values ​​remain unchanged.

[0019] Step 6.2, for the already generated (in The sequence (representing the maximum number of iterations) is used to generate the next generation. Before the sequence, each candidate list The nodes are sorted in ascending order by preference value and number of connections. First, the preference values ​​are updated for those already generated. The sequence may contain some empty nodes, that is, some... The node did not appear In the sequence, therefore, all The nodes are divided into a set of selected nodes. and the set of unselected nodes ,Will Increment the preference value of all nodes by 1, while The node preference values ​​remain unchanged for individuals. Regarding nodes Preference value The value is

[0020] in, satisfy: ; Then, the nodes in the candidate list are sorted in ascending order according to their preference values. If some nodes have the same preference value, these nodes with the same preference value are then sorted a second time (in ascending order) according to their connection count. After sorting, an updated candidate list is obtained. ; Step 6.3: Based on the updated candidate list Each sequence The nodes in the middle select the first node in their candidate list in order from front to back. , place The corresponding position in the sequence is removed from the candidate list of subsequent nodes. Furthermore, incrementing its preference value by 1, the remaining candidate list may contain no nodes; that is, if If so, only one empty node can be selected at that location. This continues until all members of the population... A population is formed when all sequences find a matching sequence. ; Step 7 is implemented in the following steps: Continuous iteration To improve fitness, the population repeats step 6, producing multiple generations. , combined By calculating their fitness separately The current sequence is obtained through comparison. The local maximum matching sequence is denoted as At this point, the fitness is the fitness of the local maximum matching in the bipartite graph, denoted as . ; when The number of iterations of the sequence within the population reaches the preset maximum number of iterations. Afterwards, check all Fitness of the current maximum match in the population All corresponding bisequence optimization variables Verify its correctness and output it.

[0021] The beneficial effects of the present invention are: (A) The present invention establishes a connection relationship matrix of a bipartite graph, which reflects the relationship between nodes and edges in the bipartite graph and provides a unique numerical representation, providing a new method for subsequent algorithm processes and fitness function estimation.

[0022] (B) Adopt a new problem encoding method: two vectors X and Y correspond to two disjoint sets of a bipartite graph, which overcomes the problem that using the "position" of the unknown vector to correspond to the node is easy to confuse the set during the algorithm process, or that using the "position" of the unknown vector to correspond to the edge connection is easy to increase the dimension.

[0023] (C) A new fitness value estimation method is established, avoiding the cumbersome problem of evaluation using augmenting paths. More importantly, augmenting paths cannot determine the quality of solutions in intermediate processes where the optimal solution has not been reached, while the new fitness value estimation method can.

[0024] (D) This invention makes full use of existing knowledge about the problem, fully utilizes the characteristics and implicit information of the problem in the selection of the initial solution, constructs a candidate list of nodes in the initial stage, quickly generates the initial population X, and sorts the candidate list by the number of connections of the nodes to generate the initial population Y.

[0025] (E) The update process of this invention keeps the individuals in population X unchanged and only iteratively updates the individuals in population Y, which not only completes the update search of understanding, but also reduces the amount of computation and avoids blind pairing.

[0026] Experiments have shown that the estimation method can find the maximum matching in multiple bipartite graphs, and the method runs faster and uses less memory when the number of nodes is large. Attached Figure Description

[0027] Figure 1 This is a flowchart illustrating the overall implementation of the present invention; Figure 2 This is a schematic diagram of transforming a bipartite graph into a connectivity matrix; Figure 3 It optimizes the correspondence between variables and set nodes; Figure 4 This is the process of constructing the candidate list of nodes in set U; Figure 5 It is the process of generating the initial X sequence population; Figure 6 This is the process of generating the initial Y population; Figure 7 It is the iterative process of the Y population sequence; Figure 8 yes Two-part diagram; Figure 9 This is an illustration of the maximum match found by the standard algorithm; Figure 10 This is a schematic diagram of the match (1) found by the method of the present invention; Figure 11 This is a schematic diagram of the match (2) found by the method of the present invention; Figure 12 This is a schematic diagram of the match (3) found by the method of the present invention. Detailed Implementation

[0028] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.

[0029] Example 1 This invention presents an evolutionary method for solving the bipartite graph maximum matching problem, combining... Figure 1 The specific steps are as follows: Step 1, refer to Figure 2 To mathematically represent the bipartite graph; Step 1 is implemented in the following steps: Step 1.1: A bipartite graph G=(U,V) consists of two sets of nodes. and Composition, in which set and Each contains and Each node will The nodes in the set are represented as , The nodes in the set are represented as The edge set of a bipartite graph G is used This indicates that the elements in the edge set Represents a node and There exists an edge connecting the two sets. and The number of nodes in the array is not equal, that is This would supplement isolated nodes for sets with fewer nodes (e.g., Then in the set Add a node This part of the nodes and sets (The nodes in the set have no connected edges). The following discussion will only cover the case where the nodes of the two sets are identical. Step 1.2, Use and Construct a matrix Used to depict bipartite diagrams The connection relationship between the two parts of the nodes, set With sets The nodes in the set correspond to the rows and columns of the matrix, respectively. any node With sets any node If there exists a connecting edge, then the matrix elements ,otherwise ,Right now .

[0030] Step 2, refer to Figure 3 Define the bi-sequence optimization variables and fitness function; Step 2 is implemented in the following steps: Step 2.1: Since U and V are both sets, and the nodes in a set can be rearranged arbitrarily, let U be represented as set U. or or Etc. Construct two solution sequences. and , respectively corresponding Sets and A random arrangement of the nodes in a set. For example: Permutations of the corresponding set U ,Right now Representative node Representative node , Representative node And so on. Similarly, sequence Y corresponds to a sorting of set V; The matching relationship of a bipartite graph is represented by combining two sequences. It is assumed that nodes corresponding to the same position in the two sequences are connected by edges, that is, nodes corresponding to the same position in the two sequences ( ) corresponding variables and There exists an edge to be determined. An edge is called an undetermined edge, and all undetermined edges are represented by a set. express; Step 2.2: Establish fitness values Connection matrix with bipartite graph The relationships between them are verified by the algorithm to identify all undetermined edges. In real edge set The corresponding element Does it exist, that is, in the matrix? The corresponding element If the value is 1, increment the fitness value by 1; otherwise, leave the fitness value unchanged. Repeat this process to traverse the set of edges to be determined. The fitness value of the current solution set is obtained. The formula is: .

[0031] Step 3, refer to Figure 4 Set a candidate list for all U set nodes; Step 3 is implemented in the following steps: For all Set the candidate list for the set nodes, where the nodes The alternative list refers to the points in the bipartite diagram. All of the connected edges The set of nodes in the middle, denoted as The formula is as follows:

[0032] By retrieving the connection matrix , obtain A shortlist of candidate nodes.

[0033] Step 4: Generate the initial X population; Step 4 is implemented in the following steps: Step 4.1, refer to Figure 5 ,Will All nodes in the set according to Sort in ascending order. Represents a node The candidate list has the fewest nodes. corresponding nodes The node with the most candidates is placed at the beginning, and so on, with the node having the most candidates at the end. Following this sorting method, we obtain... The sequence, that is, the corresponding prior sequence. ; Step 4.2, Set There may be multiple nodes with the same number of candidate lists. Group the nodes with the same number of candidate lists into one group, and within each group... The positions of the nodes in the set are randomly arranged to form several The sequence is subsequenced, and then these subsequences are combined to produce different complete sequences. Sequences are generated in this way. a priori solution ( Less than The total number of all possible combinations of the sequence). Step 4.3, Another type The sequence is obtained through a completely random method, that is... The nodes in the set are generated by random sorting. Each individual increases population diversity, at which point the population contains a total of [number] individuals. indivual sequence.

[0034] Step 5: Generate the initial population Y based on the initial population X; Step 5 is implemented in the following steps: Step 5.1, for all Collection nodes introduce the number of connections Number of connections Representative in the original two-part diagram Middle node and The number of edges connected to nodes in a set corresponds to the connectivity matrix. middle The sum of the elements in the column, i.e.: ; Step 5.2, refer to Figure 6 For nodes The shortlist Each node in the network is based on the number of connections. Sort the nodes in ascending order, placing those with fewer connections at the front, to obtain the initial candidate list. ; Step 5.3: For any sequence The first node in the list of candidate nodes is selected. , place The first position of the sequence; The second node in the list of candidates is selected and placed in the first position. The second position of the sequence; in this way, the sequence The nodes are arranged in a forward-to-back order to determine the sequence. The element at the corresponding position. During this process, for any node in the set Once placed In the sequence, all subsequent nodes will be removed from the candidate list. ,when After all nodes in the sequence have been selected in turn, a path is obtained. Matching sequence; It is worth noting that the candidate list after elimination may not contain any nodes, that is, if ,but Sequence Points Only one empty node can be selected at a time, until all nodes in the population are empty. Each sequence finds an initial sequence that matches it, denoted as... .

[0035] Step 6, refer to Figure 7 The Y population is iteratively updated. Step 6 is implemented in the following steps: Step 6.1, Subsequent updates will only be made. Sequence. In calculating the next generation. When sequencing, give Introducing preference values ​​into set nodes Its initial value is 0 (different) Preference values ​​during individual iteration Each will be calculated independently starting from 0 and will not affect the others. Before iteration, it is necessary to... Node preference value Reset. The sequence may contain some empty nodes, which also means that some... The node did not appear Therefore, all of them The nodes are divided into a set of selected nodes. and the set of unselected nodes ,Will Increment the preference value of all nodes by 1, while The node preference values ​​remain unchanged.

[0036] Step 6.2, for the already generated (in The sequence (representing the maximum number of iterations) is used to generate the next generation. Before the sequence, each candidate list The nodes are sorted in ascending order by preference value and number of connections. First, the preference values ​​are updated for those already generated. The sequence may contain some empty nodes, that is, some... The node did not appear In the sequence, therefore, all The nodes are divided into a set of selected nodes. and the set of unselected nodes ,Will Increment the preference value of all nodes by 1, while The node preference values ​​remain unchanged for individuals. Regarding nodes Preference value The value is

[0037] in, satisfy: ; Then, the nodes in the candidate list are sorted in ascending order according to their preference values. If some nodes have the same preference value, these nodes with the same preference value are then sorted a second time (in ascending order) according to their connection count. After sorting, an updated candidate list is obtained. ; Step 6.3: Based on the updated candidate list Each sequence The nodes in the middle select the first node in their candidate list in order from front to back. , place The corresponding position in the sequence is removed from the candidate list of subsequent nodes. Furthermore, incrementing its preference value by 1, the remaining candidate list may contain no nodes; that is, if Then, only one empty node can be selected at the point, until all nodes in the population are empty. A population is formed when all sequences find a matching sequence. ; Step 7: Continuously iterate through the Y population to improve fitness and finally output the results; Step 7 is implemented in the following steps: Continuous iteration To improve fitness, the population repeats step 6, producing multiple generations. , combined By calculating their fitness separately The current sequence is obtained through comparison. The local maximum matching sequence is denoted as At this point, the fitness is the fitness of the local maximum matching in the bipartite graph, denoted as . ; when The number of iterations of the sequence within the population reaches the preset maximum number of iterations. Afterwards, check all Fitness of the current maximum match in the population All corresponding bisequence optimization variables Verify its correctness and output it.

[0038] Example 2 First, construct a bipartite graph. The corresponding connection matrix accurately depicts the edge relationships between two node sets in matrix form; secondly, dual-sequence optimization variables are set ( and fitness function, where Corresponding to the two parts of the diagram respectively The order of nodes in the set is used to define the potential matching edge set through the sequential positional relationship, and the matching quality is quantified by the fitness function, which combines matrix elements for evaluation. The core idea of ​​the iterative process is to "fix the population within..." Sequence, only for The fitness of the solution is improved by using the "sequence continuous iterative optimization" method. The specific steps are as follows: First, ... Construct a candidate list for each node in the set. According to the size of the candidate list right Sort the nodes in the set (this sorting can be varied) to generate the initial set. Sequence population, simultaneously adding completely randomly sorted... Sequences are used to maintain population diversity; then corresponding The initial population is used to generate one-to-one matches based on the candidate list. The initial sequence is used and iterated continuously. In each subsequent iteration, only the sequence is considered. Sequence optimization, combined with Number of connections between nodes in a set With dynamically updated preference values, each The candidate list of nodes is reordered and then... The nodes of the sequence are selected sequentially. Node composition The sequence, during which the selected ones are simultaneously removed. The node is then incremented and its preference value is increased. This iterative process is repeated to gradually optimize the matching effect and improve fitness until the maximum matching result is obtained.

[0039] Example 3 (1) Construction and Part Two Figure 1 One-to-one connection matrix ,Will The set node corresponds to the row of the matrix, The set of nodes corresponds to the columns of the matrix. The matrix elements represent the edge relationships between nodes, with 1 indicating that there is an edge between nodes and 0 indicating that there is no edge. (2) Define optimization variables ( The sequence is used to represent the matching relationship between nodes in the bipartite graph, and a fitness function is established through the connection relationship matrix to evaluate the quality of the solution sequence found by the algorithm. (3) for each The set of nodes establishes a candidate list, for each node All nodes connected to this node All nodes are included in their corresponding candidate lists. ; (4) Generate initial Population: Based on the number of nodes in the candidate list, for all The nodes in the set are sorted; if the number of nodes is the same, the order can be randomly adjusted within the same group, and so on. Individuals form the initial Sequence population; simultaneously added A completely randomized sort Sequences are used to maintain population diversity, ultimately containing [a certain number of species] in the population. indivual sequence; (5) Based on the initial Population, initial generation Population: for all Set the number of connections for a collection node Then, for all the candidate lists The nodes in the list (all nodes in the candidate list are nodes of set V) are sorted in ascending order of their connection count to obtain... ,sequence All nodes in the middle are sequentially based on their own Select the corresponding node in the V set and generate an initial sequence that matches it. Each in the population The sequences are all generated using this method. , obtain initial population; (6) Iterative updates to the population: for all The set node introduces a preference value as a new parameter, initially set to 0, for the sequence. ( The first of the sequence (In each iteration) the preference value needs to be updated, and then all candidate lists need to be updated. The node comprehensive preference value and the number of connections in the data are reordered to obtain the following result. According to the updated candidate list, All nodes in the sequence select their corresponding positions in turn to generate the next generation sequence. ; (7) Conduct iterative optimization, repeating step (6). Before each iteration, update the preference values ​​and reorder the candidate list. Only for The sequence is iteratively updated to gradually improve the fitness of the solution; (8) Reach the preset maximum number of iterations Finally, output the final maximum matching result.

[0040] Example 4 An evolutionary method for solving the maximum matching problem in a bipartite graph is characterized by the following steps: Step 1, refer to Figure 2 To mathematically represent the bipartite graph; Step 1 is implemented in the following steps: Step 1.1: A bipartite graph G=(U,V) consists of two sets of nodes. and Composition, in which set and Each contains and Each node will The nodes in the set are represented as , The nodes in the set are represented as The edge set of a bipartite graph G is used This indicates that the elements in the edge set Represents a node and There exists an edge connecting the two sets. and The number of nodes in the array is not equal, that is This would supplement isolated nodes for sets with fewer nodes (e.g., Then in the set Add a node This part of the nodes and sets (The nodes in the set have no connected edges). The following discussion will only cover the case where the nodes of the two sets are identical. Step 1.2, Use and Construct a matrix Used to depict bipartite diagrams The connection relationship between the two parts of the nodes, set With sets The nodes in the set correspond to the rows and columns of the matrix, respectively. any node With sets any node If there exists a connecting edge, then the matrix elements ,otherwise ,Right now .

[0041] Step 2, refer to Figure 3 Define the bi-sequence optimization variables and fitness function; Step 2 is implemented in the following steps: Step 2.1: Since U and V are both sets, and the nodes in a set can be rearranged arbitrarily, let U be represented as set U. or or Construct two solution sequences and , respectively corresponding Sets and Random arrangement of set nodes, Permutations of the corresponding set U ,Right now Representative node Representative node , Representative node And so on. Similarly, sequence Y corresponds to a sorting of set V; The matching relationship of a bipartite graph is represented by combining two sequences. It is assumed that nodes corresponding to the same position in the two sequences are connected by edges, that is, nodes corresponding to the same position in the two sequences ( ) corresponding variables and There exists an edge to be determined. An edge is called an undetermined edge, and all undetermined edges are represented by a set. express; Step 2.2: Establish fitness values Connection matrix with bipartite graph The relationships between them are verified by the algorithm to identify all undetermined edges. In real edge set The corresponding element Does it exist, that is, in the matrix? The corresponding element If the value is 1, increment the fitness value by 1; otherwise, leave the fitness value unchanged. Repeat this process to traverse the set of edges to be determined. The fitness value of the current solution set is obtained. The formula is: .

[0042] Step 3, refer to Figure 4 Set a candidate list for all U set nodes; Step 4: Generate the initial X population; Step 5: Generate the initial population Y based on the initial population X; Step 6, refer to Figure 7 The Y population is iteratively updated. Step 7: Continuously iterate the Y population to improve fitness and finally output the results.

[0043] Example 5 This invention presents an evolutionary method for solving the bipartite graph maximum matching problem, combining... Figure 1 The specific steps are as follows: Step 1, refer to Figure 2 To mathematically represent the bipartite graph; Step 1 is implemented in the following steps: Step 1.1: A bipartite graph G=(U,V) consists of two sets of nodes. and Composition, in which set and Each contains and Each node will The nodes in the set are represented as , The nodes in the set are represented as The edge set of a bipartite graph G is used This indicates that the elements in the edge set Represents a node and There exists an edge connecting the two sets. and The number of nodes in the array is not equal, that is This would supplement isolated nodes for sets with fewer nodes (e.g., Then in the set Add a node This part of the nodes and sets (The nodes in the set have no connected edges). The following discussion will only cover the case where the nodes of the two sets are identical. Step 1.2, Use and Construct a matrix Used to depict bipartite diagrams The connection relationship between the two parts of the nodes, set With sets The nodes in the set correspond to the rows and columns of the matrix, respectively. any node With sets any node If there exists a connecting edge, then the matrix elements ,otherwise ,Right now .

[0044] Step 2, refer to Figure 3 Define the bi-sequence optimization variables and fitness function; Step 2 is implemented in the following steps: Step 2.1: Since U and V are both sets, and the nodes in a set can be rearranged arbitrarily, let U be represented as set U. or or Construct two solution sequences and , respectively corresponding Sets and Random arrangement of set nodes, Permutations of the corresponding set U ,Right now Representative node Representative node , Representative node Similarly, sequence Y corresponds to a sorting of set V; The matching relationship of a bipartite graph is represented by combining two sequences. It is assumed that nodes corresponding to the same position in the two sequences are connected by edges, that is, nodes corresponding to the same position in the two sequences ( ) corresponding variables and There exists an edge to be determined. An edge is called an undetermined edge, and all undetermined edges are represented by a set. express; Step 2.2: Establish fitness values Connection matrix with bipartite graph The relationships between them are verified by the algorithm to identify all undetermined edges. In real edge set The corresponding element Does it exist, that is, in the matrix? The corresponding element If the value is 1, increment the fitness value by 1; otherwise, leave the fitness value unchanged. Repeat this process to traverse the set of edges to be determined. The fitness value of the current solution set is obtained. The formula is: .

[0045] Step 3, refer to Figure 4 Set a candidate list for all U set nodes; Step 3 is implemented in the following steps: For all Set the candidate list for the set nodes, where the nodes The alternative list refers to the points in the bipartite diagram. All of the connected edges The set of nodes in the middle, denoted as The formula is as follows:

[0046] By retrieving the connection matrix , obtain A shortlist of candidate nodes.

[0047] Step 4: Generate the initial X population; Step 4 is implemented in the following steps: Step 4.1, refer to Figure 5 ,Will All nodes in the set according to Sort in ascending order. Represents a node The candidate list has the fewest nodes. corresponding nodes The node with the most candidates is placed at the beginning, and so on, with the node having the most candidates at the end. Following this sorting method, we obtain... The sequence, that is, the corresponding prior sequence. ; Step 4.2, Set There may be multiple nodes with the same number of candidate lists. Group the nodes with the same number of candidate lists into one group, and within each group... The positions of the nodes in the set are randomly arranged to form several The sequence is subsequenced, and then these subsequences are combined to produce different complete sequences. Sequences are generated in this way. a priori solution ( Less than The total number of all possible combinations of the sequence). Step 4.3, Another type The sequence is obtained through a completely random method, that is... The nodes in the set are generated by random sorting. Each individual increases population diversity, at which point the population contains a total of [number] individuals. indivual sequence.

[0048] Step 5: Generate the initial population Y based on the initial population X; Step 6, refer to Figure 7 The Y population is iteratively updated. Step 7: Continuously iterate the Y population to improve fitness and finally output the results.

[0049] Example 6 The effects of this invention can be specifically illustrated through simulation experiments: 1. Experimental conditions This experiment was conducted using a CPU R9-5900HX processor and a Windows 10 operating system. Algorithm coding, data processing, and result output were all performed using Jupyter Notebook version 7.3.2. The stable hardware and software environment provided a solid foundation for the smooth operation of the experiment and the accuracy of the data. The experimental test focused on bipartite graphs of different sizes, specifically selecting node sizes of [missing information]. Four bipartite graph models were tested, and the core objective of the experiment was to compare the performance of two algorithms, i.e., the more classic ones. Hopcroft-Karp The algorithm and the algorithm proposed in this patent can find the maximum matching results in the above four different sizes of bipartite graph networks to prove the accuracy, stability and diversity of the maximum matching sought by the algorithm in this patent.

[0050] 2. Experimental Data The experimental data were generated using a common randomization method to create a bipartite graph: first, two independent sets of nodes in the bipartite graph were input. and Count the number of possibilities, then iterate through all possible ones. Node combinations, with given probabilities The number of edges determines whether to add an edge between each pair of nodes, thus forming a probabilistically connected random bipartite graph structure. The general information of the bipartite graph is shown in the table below. A schematic diagram of B1 is shown in the figure. Since the bipartite graphs of B2, B3, and B4 have a large number of nodes, their properties are recorded in a table.

[0051] 3. Experiment Content For four bipartite graphs of different sizes, the evolutionary algorithm of this patent was used to solve for maximum matching. Key data during the algorithm's operation (focusing on the number of maximum matchings, mutually matching nodes, and time and memory usage for large-scale bipartite graphs) were recorded and the correctness was verified. In the comparison group, the classic bipartite graph maximum matching algorithm Hopcroft-Karp was called, and relevant data was recorded. Finally, the matchings found by the two algorithms in the case of running only once were compared to demonstrate the accuracy, versatility, and time and memory advantages of the algorithm of this patent in solving the maximum matching problem of bipartite graphs.

[0052] 4. Experimental Results (1) B1: Bipartite diagram In this graph, sets U and V each contain 15 nodes, and any node... and With probability Generate connecting edges, with the connection relationships as follows: Figure 8 There are a total of 25 connecting edges.

[0053] The maximum matching found by the standard algorithm, such as Figure 9 As shown; the maximum number of matches is 12, the matching edges are shown by the red lines in the figure, and the unmatched nodes are... and .

[0054] The matching found by the method of this invention (1), such as Figure 10 As shown in the figure; it can be seen from the figure that the maximum number of matches is still 12, of which the unmatched nodes are and This demonstrates that the method of the present invention can accurately find the maximum match.

[0055] The matching (2) found by the method of this invention, such as Figure 11 As shown in the figure; it can be seen from the figure that the maximum number of matches is still 12, of which the unmatched nodes are and .

[0056] The matching found by the method of this invention (3), such as Figure 12 As shown in the figure; it can be seen from the figure that the maximum number of matches is still 12, of which the unmatched nodes are and This demonstrates that the method of the present invention can not only accurately find the maximum match, but also find multiple different matches.

[0057] (2) B2: A bipartite graph of 50×50, in which set U and set V each contain 50 nodes, and any node and With probability Generate connecting edges.

[0058] The matching edges found by the standard algorithm and the present invention are shown in the following table (edges marked with "*" are unique matching edges found by the algorithm of the present invention):

[0059] The similarity table between the method of this invention and the standard algorithm is as follows: This shows that the method of this invention can accurately identify the maximum match and can find multiple different maximum matches.

[0060]

[0061] (3) B3: A bipartite graph of 100×100, in which set U and set V each contain 100 nodes, and any node and With probability Generate connecting edges.

[0062] The following table compares the matchings found by the algorithm of this invention with those found by the standard algorithm. Matches marked with "*" are unique matching edges found by the method of this invention:

[0063] The similarity table between the method of this invention and the standard algorithm is as follows: This shows that the method of this invention can accurately identify the maximum match and can find multiple different maximum matches.

[0064]

[0065] (4) B4: A bipartite graph of 5000×5000, in which set U and set V each contain 5000 nodes, and any node and Generate a series of random (2,3) edges. (Classic Hopcroft-Karp) The following data shows the maximum number of matching edges, the maximum number of matching groups, the running time, and the memory usage of the method described in this invention:

[0066] As can be seen from the table above, the method of this invention outperforms the classic Hopcroft-Karp in both peak memory usage and runtime. The biggest advantage of this method is its faster computation time and smaller memory footprint in large-scale networks, which is crucial for solving large-scale problems.

[0067] The experimental data above demonstrates that the method described in this patent can stably solve for the maximum matching of bipartite graphs of varying sizes, ensuring the correctness and validity of the results. Compared to the classic Hopcroft-Karp algorithm, this patent method is more flexible in solving the maximum matching problem in bipartite graphs, generating multiple sets of different maximum matching results and bringing diversity to the outcome. In solving large-scale problems, the method of this invention has advantages in both running time and memory usage compared to mainstream standard algorithms, further illustrating the superior performance of the algorithm.

Claims

1. An evolutionary method for solving the maximum matching problem in a bipartite graph, characterized in that, The specific steps are as follows: Step 1: Represent the bipartite graph mathematically; Step 2: Define the bi-sequence optimization variables and fitness function; Step 3: Set up a candidate list for all U set nodes; Step 4: Generate the initial X population; Step 5: Generate the initial population Y based on the initial population X; Step 6: Iteratively update the Y population; Step 7: Continuously iterate the Y population to improve fitness and finally output the results.

2. The evolutionary method for solving the bipartite graph maximum matching problem according to claim 1, characterized in that, Step 1 is implemented in the following steps: Step 1.1: A bipartite graph G=(U,V) consists of two sets of nodes. and Composition, in which set and Each contains and Each node will The nodes in the set are represented as , The nodes in the set are represented as The edge set of a bipartite graph G is used This indicates that the elements in the edge set Represents a node and There exists an edge connecting the two sets. and The number of nodes in the array is not equal, that is If the set has fewer nodes, then the isolated nodes are added to the set with fewer nodes. We will only discuss the case where the two sets have the same number of nodes in the following discussion. Step 1.2, Use and Construct a matrix Used to depict bipartite diagrams The connection relationship between the two parts of the nodes, set With sets The nodes in the set correspond to the rows and columns of the matrix, respectively. any node With sets any node If there exists a connecting edge, then the matrix elements ,otherwise ,Right now 。 3. The evolutionary method for solving the bipartite graph maximum matching problem according to claim 2, characterized in that, Step 2 is implemented in the following steps: Step 2.1: Since the positions of nodes in set U are variable, it can be represented as... or or Construct two solution sequences. and , respectively corresponding Sets and Random arrangement of set nodes, Permutations of the corresponding set U ,Right now Representative node Representative node , Representative node Similarly, the Y sequence corresponds to a sorting of the set V; The matching relationship of a bipartite graph is represented by combining two sequences. It is assumed that nodes corresponding to the same position in the two sequences are connected by edges, that is, nodes corresponding to the same position in the two sequences ( ) corresponding variables and There exists an edge to be determined. An edge is called an undetermined edge, and all undetermined edges are represented by a set. express; Step 2.2: Establish fitness values Connection matrix with bipartite graph The relationships between them are verified by the algorithm to identify all undetermined edges. In real edge set The corresponding element Does it exist, that is, in the matrix? The corresponding element If the value is 1, increment the fitness value by 1; otherwise, leave the fitness value unchanged. Repeat this process to traverse the set of edges to be determined. The fitness value of the current solution set is obtained. The formula is: 。 4. The evolutionary method for solving the bipartite graph maximum matching problem according to claim 3, characterized in that, Step 3 is implemented in the following steps: For all Set the candidate list for the set nodes, where the nodes The alternative list refers to the points in the bipartite diagram. All of the connected edges The set of nodes in the middle, denoted as The formula is as follows: By retrieving the connection matrix , obtain A shortlist of candidate nodes.

5. The evolutionary method for solving the bipartite graph maximum matching problem according to claim 4, characterized in that, Step 4 is implemented in the following steps: Step 4.1, All nodes in the set according to Sort in ascending order. Represents a node The candidate list has the fewest nodes. corresponding nodes The node with the most candidates is placed at the beginning, and so on, with the node having the most candidates at the end. Following this sorting method, we obtain... The sequence, that is, the corresponding prior sequence. ; Step 4.2, Set There may be multiple nodes with the same number of candidate lists. Group the nodes with the same number of candidate lists into one group, and within each group... The positions of the nodes in the set are randomly arranged to form several The sequence is subsequenced, and then these subsequences are combined to produce different complete sequences. Sequences are generated in this way. A priori solution Less than The total number of all possible combinations of the sequence; Step 4.3, Another type The sequence is obtained through a completely random method, that is... The nodes in the set are generated by random sorting. Each individual increases population diversity, at which point the population contains a total of [number] individuals. indivual sequence.

6. The evolutionary method for solving the bipartite graph maximum matching problem according to claim 5, characterized in that, Step 5 is implemented in the following steps: Step 5.1, for all Collection nodes introduce the number of connections Number of connections Representative in the original two-part diagram Middle node and The number of edges connected to nodes in a set corresponds to the connectivity matrix. middle The sum of the elements in the column, i.e.: ; Step 5.2, for nodes The shortlist Each node in the network is based on the number of connections. Sort the nodes in ascending order, placing those with fewer connections at the front, to obtain the initial candidate list. ; Step 5.3: For any sequence The first node in the list of candidate nodes is selected. , place The first position of the sequence; The second node in the list of candidates is selected and placed in the first position. The second position of the sequence; in this way, the sequence The nodes are arranged in a forward-to-back order to determine the sequence. The element at the corresponding position, in this process, for any node in the set Once placed In the sequence, all subsequent nodes will be removed from the candidate list. ,when After all nodes in the sequence have been selected in turn, a path is obtained. Matching sequence; The removed candidate list may contain no nodes, i.e., if ,but Sequence Points Only one empty node can be selected at a time, until all nodes in the population are empty. Each sequence finds an initial sequence that matches it, denoted as... .

7. The evolutionary method for solving the bipartite graph maximum matching problem according to claim 6, characterized in that, Step 6 is implemented in the following steps: Step 6.1, Subsequent updates will only be made. Sequence, in computing the next generation When sequencing, give Introducing preference values ​​into set nodes Its initial value is 0, in the individual Before iteration, it is necessary to... Node preference value Reset. The sequence may contain some empty nodes, which also means that some... The node did not appear Therefore, all of them The nodes are divided into a set of selected nodes. and the set of unselected nodes ,Will Increment the preference value of all nodes by 1, while The node preference values ​​remain unchanged; Step 6.2, for the already generated Sequence, where Indicates the maximum number of iterations to generate the next generation. Before the sequence, each candidate list The nodes in the algorithm are sorted in ascending order by preference value and number of connections. First, the preference values ​​are updated for the nodes that have already been generated. The sequence may contain some empty nodes, that is, some... The node did not appear In the sequence, therefore, all The nodes are divided into a set of selected nodes. and the set of unselected nodes ,Will Increment the preference value of all nodes by 1, while The node preference values ​​remain unchanged for individuals. Regarding nodes Preference value The value is in, satisfy: ; Then, the nodes in the candidate list are sorted in ascending order of preference value. If some nodes have the same preference value, these nodes with the same preference value are then sorted a second time according to the number of connections. After sorting, an updated candidate list is obtained. ; Step 6.3: Based on the updated candidate list Each sequence The nodes in the middle select the first node in their candidate list in order from front to back. , place The corresponding position in the sequence is removed from the candidate list of subsequent nodes. Furthermore, incrementing its preference value by 1, the remaining candidate list may contain no nodes; that is, if Then, only one empty node can be selected at the point, until all nodes in the population are empty. A population is formed when all sequences find a matching sequence. .

8. The evolutionary method for solving the bipartite graph maximum matching problem according to claim 7, characterized in that, Step 7 is implemented in the following steps: Continuous iteration To improve fitness, the population repeats step 6, producing multiple generations. , combined By calculating their fitness separately The current sequence is obtained through comparison. The local maximum matching sequence is denoted as At this point, the fitness is the fitness of the local maximum matching in the bipartite graph, denoted as . ; when The number of iterations of the sequence within the population reaches the preset maximum number of iterations. Afterwards, check all Fitness of the current maximum match in the population All corresponding bisequence optimization variables Verify its correctness and output it.