Method, apparatus and system for solving combinatorial optimization problem
Through the multi -directional splitter inspiration algorithm encoded in phase, the combination optimization problem is mapped into a spin model, which solves the problem of the existing technology that is difficult to efficiently solve the problem of combination optimization under large -scale variables. Essence
Patent Information
- Application Number
- PCT/CN2024/105388
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-07-20
- Filing Date
- 2024-07-15
- Publication Date
- 2025-01-23
AI Technical Summary
The existing technology is difficult to efficiently solve the combination optimization problem under large-scale variables, resulting in slow computing speed, high resource energy consumption, and inability to meet computing power requirements.
The phase-encoded multi-directional bifurcation quantum heuristic algorithm is used to map the combinatorial optimization problem into a spin model, drive the complex variables to bifurcate in multiple directions through dynamic equations, and obtain the phase angle of the complex variables as the result output.
Under large -scale variables, it significantly improves the speed of solution and the quality of the combination optimization problem, reduces the energy consumption of resources, meets the needs of computing power, and improves the satisfaction of user use.
Smart Images

Figure CN2024105388_23012025_PF_FP_ABST
Abstract
Description
A method, device and system for solving combinatorial optimization problems
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on July 20, 2023, with application number 202310898465.2 and application name “A method, device and system for solving combinatorial optimization problems”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of artificial intelligence, and in particular to a method, device, and system for solving combinatorial optimization problems. Background Art
[0003] In society and industry, we often encounter the problem of finding the optimal combination among a large number of variables. Common problems include the traveling salesman problem and the minimum spanning tree problem. Industry-specific problems include very large-scale integrated circuit design, drug design, and financial portfolio management. These combinatorial optimization problems are often mathematically formulated as minimization or maximization problems of objective functions based on discrete variables.
[0004] Combinatorial optimization problems involve finding the best arrangement or combination of certain items under given constraints. A characteristic of combinatorial optimization problems is that the decision space of the decision variables is a finite set of points, allowing for an exhaustive search to find the optimal solution. However, exhaustive and enumerable methods are often impractical, as the number of feasible solutions increases exponentially with the size of the problem. Each additional decision variable requires a doubling of the solution speed. Take the traveling salesman problem, first proposed by Dantzig et al. in 1959, as an example. It is the most basic shortest path problem. A traveling salesman has to travel to several cities with known distances between them. To save money, he decides to start from his current city, visit each city once, and then return to the starting city. So, what route should he choose to minimize distance and cost? As the number of cities increases, the complexity of the problem rapidly increases exponentially. For example, if there are 30 cities, exhaustively searching all possible routes using the fastest supercomputers available today would take hundreds of thousands of years. While parallel computing using hundreds of thousands of supercomputers can shorten the solution time, it consumes enormous resources and energy, requiring significant capital investment from application developers. The computing power of current computing equipment cannot meet both capital and efficiency requirements. Therefore, there is a need for a method, device, and system for solving combinatorial optimization problems that can improve the speed and quality of solving combinatorial optimization problems under large-scale variables.
[0005] Summary of the Invention
[0006] In order to solve the above problems, the embodiments of the present application provide a method, device and system for solving combinatorial optimization problems, which realizes the solution of combinatorial optimization problems based on a phase-coded multi-directional bifurcation quantum heuristic algorithm. It can improve the solution speed and quality of combinatorial optimization problems under large-scale variables, reduce resource and energy consumption, meet computing power requirements, and improve user satisfaction.
[0007] In a first aspect, an embodiment of the present application provides a method for solving a combinatorial optimization problem. The method includes: receiving a combinatorial optimization problem input by a user; the combinatorial optimization problem refers to finding a solution in which the permutations and combinations of multiple objects meet the requirements under the constraints given by the user; mapping the combinatorial optimization problem into a spin model; the spin model includes complex variables to be solved and an objective function; the complex variables to be solved are used to describe the solution in which the permutations and combinations of objects meet the requirements as discrete variables in a complex domain; the objective function is used to describe the permutations and combinations of multiple objects under given constraints; determining a dynamic equation of the complex variables to be solved in the complex domain, the dynamic equation is used to describe the time-based evolution process of the complex variables to be solved; the dynamic equation includes at least a control variable, a multi-bifurcation parameter and an action parameter; the control variable is used to control the bifurcation speed of the complex variable to be solved; the multi-bifurcation parameter is used to express the number of phases of the complex variable to be solved; the action parameter is used to describe the interaction of the complex variables to be solved; solving the dynamic equation, and obtaining q stable phases of the complex variable to be solved by changing the value of the control variable; the value of q is determined by the multi-bifurcation parameter; determining the spin orientation of the spin model based on the q stable phases to obtain a solution to the combinatorial optimization problem.
[0008] In this way, the embodiment of the present application maps the problem abstracted from the combinatorial optimization problem in actual production life into a Potts model, determines the bifurcation parameters according to the actual problem, initializes the control variables and the complex variables to be solved, and then drives the complex variables to be solved to bifurcate in multiple directions according to the dynamic equation. The phase angle of the complex variable is taken as the result output to achieve the solution of the combinatorial optimization problem. The abstracted problem is mathematically expressed as a problem of minimizing or maximizing the objective function based on discrete variables. By driving the complex variables to be solved to bifurcate in multiple directions according to the dynamic equation through the control variables, it is possible to improve the solution speed and solution quality of the combinatorial optimization problem under large-scale variables, greatly reduce the spin scale required to solve the problem, reduce the computing power demand, and shorten the solution time.
[0009] In a feasible implementation, the dynamic equation further includes an external field description term, which is used to describe additional constraints.
[0010] In this way, the embodiments of the present application can add additional constraints in many application scenarios, such as limited resources or time windows, and introduce external field description items to solve combinatorial optimization problems.
[0011] In one possible implementation, the method further includes: determining a multi-bifurcation parameter according to given constraints.
[0012] In this way, the embodiment of the present application can use the multi-bifurcation parameter q to control the spatial dimension of the solution to the actual problem under given constraints, realize the annealing mechanism of multi-bifurcation solution, and directly solve the XY model and Potts model.
[0013] In an achievable embodiment, the method further includes: determining the spatial dimension of the solution according to the multiple bifurcation parameters; or determining the number of bifurcations of the complex variable according to the multiple bifurcation parameters.
[0014] Therefore, for solving the same problem, compared with the Ising model, the embodiment of the present application requires a smaller scale of variables and less calculation, and the overall calculation amount can be reduced exponentially when solving large-scale combinatorial optimization problems.
[0015] In one possible implementation, the method further includes: setting a control variable, including setting a value range and a control step size of the control variable.
[0016] In this way, the embodiment of the present application can control the speed of multiple bifurcations by controlling variables, and realize the time-based evolution solution of the complex variables to be solved under the conditions of smaller variable scale and less calculation amount.
[0017] In one feasible implementation, changing the value of the control variable includes: changing the value of the control variable according to a set control step size.
[0018] In this way, the embodiments of the present application can adjust and change the speed and accuracy of complex variable bifurcation solution by changing the value of the control variable.
[0019] In one possible implementation, a time parameter is included, and changing the value of the control variable includes gradually changing the value of the control variable based on an increase in the time parameter.
[0020] In this way, the embodiment of the present application can change the value of the control variable by changing the time parameter, thereby accelerating the speed of solving the complex variable bifurcation.
[0021] In one feasible implementation, q stable phases of the complex variable to be solved are obtained by changing the value of the control variable, including: when the number of bifurcations in the stable state is greater than q, changing the value of the control variable so that the complex variable to be solved bifurcates from a single stable state to multiple stable phases; until the number of stable phases is equal to q.
[0022] In this way, the embodiments of the present application can obtain the solution to the combinatorial optimization problem in the complex domain based on the steady state of the amplitude and phase of the complex variables, reduce the spin scale required to solve the problem, reduce the computing power requirements, and shorten the solution time.
[0023] In one possible implementation, the combinatorial optimization problem is a graph coloring problem, the constraint condition is K colors, and the solution under the constraint condition is to assign a color to each vertex so that no two adjacent vertices have the same color; mapping the combinatorial optimization problem to a Potts model includes: determining the Potts model of the graph coloring problem as:
[0024] Where CN is the number of color conflicts; suppose n complex variables to be solved v,u represent vertices, phase θ v The value of represents the color of vertex v; is the objective function, which is used to compare whether the colors of two connected vertices v and u conflict; the value of the number of colors K is used as the multi-bifurcation parameter; the connecting edge e between vertex u and vertex v uv As the interaction parameter, e uv Indicates whether vertex u and vertex v are connected.
[0025] Thus, the method for solving combinatorial optimization problems provided in the embodiments of this application can significantly reduce the number of variables in solving large-scale graph coloring combinatorial optimization problems, reducing the overall computational complexity by a factor of n*q. It can also solve combinatorial optimization problems in scenarios such as timetable creation, mobile radio frequency allocation, register allocation, and server scheduling.
[0026] In one feasible implementation, the combinatorial optimization problem is a traveling salesman problem, and the constraints are m cities and the distances between each pair of cities. Under the constraints, the solution of the shortest path that visits each city once and returns to the starting city is sought. The combinatorial optimization problem is mapped to a Potts model, including: determining the Potts model of the traveling salesman problem as:
[0027] Where D(x) is the distance of the shortest circuit; suppose there are m complex variables to be solved v represents the city, phase θ v represents the order of visiting city v, w uv represents the distance between city u and city v; is the objective function, which is used to describe the next possible city to visit; Indicates that city u is visited first; q is a multi-bifurcation parameter, e i2π / q Add 1 to the sequence number of the visited city to indicate the next visited city. When , the objective function δ=1, indicating that the next city to be visited is city v; when When , the objective function δ = 0, indicating that the next city to be visited is not city v; the number of cities m is used as the multi-bifurcation parameter.
[0028] Thus, the embodiment of the present application can greatly reduce the variable scale of the combinatorial optimization problem when solving the traveling salesman problem of large-scale combinatorial optimization, and the overall computational complexity can be reduced by m 2 times. Solving the traveling salesman problem using the combinatorial optimization problem solving method provided in the embodiments of this application can be applied to many fields such as planning, logistics, chip manufacturing, and DNA sequencing. In these applications, the concept of "city" is used to represent customers, welding points, or DNA fragments, while the concept of "distance" represents travel time, travel cost, or a similarity measure between DNA fragments.
[0029] In one possible implementation, the spin model includes a Potts model or an XY model.
[0030] In this way, the XY model and Potts model can be solved directly without converting to the Ising model. Compared with the Ising model, this application requires a smaller number of variables and less calculation for solving the same problem.
[0031] In a second aspect, embodiments of the present application provide an electronic device comprising: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory. When the programs stored in the memory are executed, the processor is configured to perform the method according to any embodiment of the first aspect. The beneficial effects thereof are as described in the first aspect and are not further elaborated here.
[0032] In a third aspect, embodiments of the present application provide a computer storage medium having instructions stored therein. When the instructions are executed on a computer, the computer executes the method according to any embodiment of the first aspect. The beneficial effects thereof are as described in the first aspect and are not further elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions of the multiple embodiments disclosed in this specification, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings described below are only the multiple embodiments disclosed in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0034] The following is a brief introduction to the drawings required for describing the embodiments or prior art.
[0035] FIG1 is a flow chart of a method for solving a combinatorial optimization problem provided by an embodiment of the present application;
[0036] FIG2a is a schematic diagram of phase bifurcation of complex variables in the method for solving the combinatorial optimization problem provided by an embodiment of the present application;
[0037] FIG2 b is a schematic diagram of amplitude bifurcation of complex variables in the method for solving the combinatorial optimization problem provided by an embodiment of the present application;
[0038] FIG3 is an algorithm flow chart of the method for solving the combinatorial optimization problem provided in Example 1 of the present application;
[0039] FIG4a is a schematic diagram of a graph coloring problem provided in Example 2 of the present application;
[0040] FIG4b is a flowchart of solving the graph coloring problem provided in Example 2 of the present application;
[0041] FIG5a is a schematic diagram of the traveling salesman problem provided in Example 3 of the present application;
[0042] FIG5 b is a flowchart of solving the traveling salesman problem provided in Example 3 of the present application;
[0043] FIG6 is a schematic diagram of a device for solving a combinatorial optimization problem provided by an embodiment of the present application;
[0044] FIG7 is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] In the description of the embodiments of the present application, words such as "exemplary," "for example," or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary," "for example," or "for example" in the embodiments of the present application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "for example," or "for example" is intended to present the relevant concepts in a concrete manner.
[0046] In the description of the embodiments of this application, the term "and / or" is simply a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "plurality" means two or more. For example, "multiple systems" refers to two or more systems, and "multiple terminals" refers to two or more terminals.
[0047] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly identifying the technical features being referred to. Thus, features specified as "first" or "second" may explicitly or implicitly include one or more of such features. The terms "include," "comprising," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.
[0048] In the description of the embodiments of the present application, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
[0049] In the description of the embodiments of the present application, the terms "first\second\third, etc." or module A, module B, module C, etc. are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that the specific order or sequence can be interchanged where permitted so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0050] In the description of the embodiments of the present application, the numbers representing the steps, such as S110, S120, etc., do not necessarily mean that the steps must be executed in this manner. If permitted, the order of the previous and next steps can be interchanged, or they can be executed simultaneously.
[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0052] The relevant terms involved in the embodiments of this application include:
[0053] A polynomial (P) problem is a problem that can be solved by a deterministic machine (a computer in the usual sense) in polynomial time.
[0054] Polynomial time means that there is a polynomial relationship between the time (complexity) required for the problem and the size of the problem.
[0055] Non-deterministic polynomial (NP) problems refer to problems that can be solved by non-deterministic machines in polynomial time.
[0056] The Ising model is used to describe the ferromagnetism of materials. It includes parameters that describe the magnetic moments of individual atoms, where the parameters are +1 or -1, representing spins pointing up or down, respectively. These magnetic moments are typically arranged according to a certain rule, forming a lattice. Specific interaction parameters are also introduced into the model, allowing adjacent spins to influence each other.
[0057] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
[0058] While studying the properties of magnetic materials, scientists proposed the spin model and gradually discovered that many combinatorial optimization problems can be mapped to it. The spin model has been widely used in combinatorial optimization, providing new solutions to these problems.
[0059] Spin models are primarily used in physics to explain mathematical models of magnetism. Because the state of spins in the lowest energy state of spin models can be directly mapped to the solution of combinatorial optimization problems, solvers designed to find the ground state of spin models have attracted widespread attention.
[0060] In the earliest proposed Ising model, the spin orientation can only be upward or downward, and the Hamiltonian expression of the system is as follows: H(σ) = -∑ ij J ij σ i σ j -∑ j h j σ j (1)
[0061] In formula (1), σ i , σ j Indicates the orientation of the spin, representing two opposite directions, such as up and down; J ij represents the interaction between spins; h j Indicates the outfield.
[0062] The H density quantitative expression of the XY model is as follows: H(s) = -∑ ij J ij s i ·s j -∑ j h j ·s j =-∑ ij J ij cos(θ i -θ j )-∑ j hj cosθ j (2)
[0063] In formula (2), s i Represents the orientation of the spin, which can take continuous values in the two-dimensional surface, J ij represents the interaction between spins, h j Indicates the outfield.
[0064] The Potts model is a generalization of the Ising model. The Potts model is a model of interacting spins on a lattice. In the Potts model, the spin orientations take discrete values in a two-dimensional plane.
[0065] In formula (2), θ i =i*2πn / q,θ i is the phase of the i-th spin, θ j =j*2πn / q,θ j is the phase of the jth spin; the phase of the spin can take discrete values in the two-dimensional surface, J ij represents the interaction between the two spins, h j Indicates the outfield.
[0066] Compared with the Ising model, the Potts model has more states, can represent more information, and can solve combinatorial optimization problems with a smaller number of spins.
[0067] Solution 1 for solving the Ising model is to use a simulated bifurcation algorithm. By changing the control variable μ, the continuous variable x is driven to randomly change from a single stable state to one of two stable states. The positive and negative signs of the variable x after bifurcation are used as the orientation of the spin, turning the continuous variable into a discrete variable. Multiple continuous variables undergo bifurcation through interaction J ij The two variables interact with each other and transform into two stable states, namely, steady state 1 and steady state 2. The combination of positive and negative signs of multiple continuous variables is the solution of the Ising model. The Hamiltonian expression of the Ising model is as follows: f(x) = -∑ ij J ij x i x j -∑ j h j x j (3)
[0068] In formula (3), x is a continuous variable, x i represents a spin, x j represents another spin.
[0069] Scheme 1 is based on the bifurcation phenomenon. By calculating the dynamic equation of variable x, the optimal solution of the Ising model shown in formula (3) is obtained. The dynamic equation of variable x is:
[0070] In formula (5), μ is the control variable used to change the bifurcation speed; J ij To represent two spins x i and x j The interaction between them, η is the first factor.
[0071] Using a simulated bifurcation algorithm to achieve the transition of a continuous variable from one steady state to two steady states can be used to solve the Ising model, which has only two spin orientations. However, the spin scale and computational complexity required for continuously varying XY models or Potts models with multiple discrete spin orientations in a two-dimensional plane increase exponentially, and Solution 1 cannot meet the computing power requirements.
[0072] The present application provides a device for solving combinatorial optimization problems, which is used to map the problems abstracted from combinatorial optimization problems in real production and life into a Potts model and find the optimal solution. Combinatorial optimization problems involve the fields of very large-scale integrated circuit design, drug design, and financial portfolio management, among others. The abstracted problems include the maximum k-cut problem, graph partitioning problem, graph coloring problem, N-queens problem, and traveling salesman problem. These abstracted problems are mathematically expressed as minimization or maximization problems of objective functions based on discrete variables.
[0073] For the problem of minimizing or maximizing the objective function of discrete variables, an embodiment of the present application proposes a method for solving combinatorial optimization problems, which uses a phase-encoded multi-directional bifurcation heuristic algorithm to solve the Potts model. When solving large-scale combinatorial optimization problems, it can greatly reduce the spin scale required to solve the problem, reduce computing power requirements, and shorten the solution time.
[0074] The embodiment of the present application determines the bifurcation parameters according to the actual problem. After initializing the control variable and the complex variable to be solved, the control variable drives the complex variable to be solved to bifurcate in multiple directions according to the dynamic equation, and takes the phase angle of the complex variable as the result output.
[0075] FIG1 is a flow chart of a method for solving a combinatorial optimization problem provided by an embodiment of the present application. As shown in FIG1 , the method includes the following steps:
[0076] S11, determine the spin model according to the combinatorial optimization problem. The spin model is the Potts model based on multi-directional bifurcation of complex variables, and the Hamiltonian form of the Potts model is: f(x) = -∑ ij J ij x i ·x j -∑j h j x j (5)
[0077] In some embodiments, the effect of the external field is not considered, and the external field description term ∑ j h j x j =0.
[0078] In some embodiments, the spin model may be an XY model based on multi-directional bifurcation of complex variables.
[0079] S12, determine the dynamic equations of the optimal solution of the spin model, including the multi-bifurcation parameter q, the control variable μ for initializing the bifurcation speed, and the complex variable x to be solved. The dynamic equation describes the complex variable x to be solved. i Based on the time evolution process, the following equation:
[0080] or
[0081] in is a complex variable, is x i , q is the multi-bifurcation parameter, η is the first factor, r is the second factor, and the values of η and r are determined or adjusted according to experience.
[0082] Set a complex variable x i Represent a spin, solve the dynamic equation with complex variables in the complex domain, the dynamic equation formula (6) or formula (7) includes bifurcation description terms and complex variable interaction description terms, and in some scenarios may also include external field description terms ∑ j h j x j The bifurcation description term includes the control variable μ of the bifurcation speed and the variable q that controls the number of bifurcations; the interaction description term is J ij .
[0083] S13, change the control variable μ to drive the complex variable x i Transition from a single stable state to multiple stable states.
[0084] In some embodiments, the value of the control variable μ can be changed as the time parameter t changes, thereby changing the complex variable x to be solved. i The speed of branching in multiple directions.
[0085] For example, the value of the control variable μ can be gradually increased with the time parameter t, so that the complex variable x to be solved i Speed up the bifurcation in multiple directions, the complex variable x iis a discrete variable, multiple complex variables x i In the process of bifurcation, through the interaction J ij They influence each other and transform into multiple stable states respectively, and the phase after the complex variable bifurcation is used as the orientation of the spin.
[0086] Figure 2a shows a schematic diagram of the phase bifurcation of a complex variable; Figure 2b shows a schematic diagram of the amplitude bifurcation of a complex variable; As shown in Figures 2a and 2b, based on the change of the time parameter t=0,1,2,3,…,N, the corresponding μ t =-0.2,-0.1,0.0,0.08,….,0.7; when the control variable μ is at a certain moment t After reaching a certain value, such as μ3 = 0.08 at t = 3, the complex variable x i The amplitude changes from 0 to 0.3, and the phase bifurcates from a single direction to multiple directions. The interaction parameter of multiple complex variables influencing each other during the bifurcation process is J ij ; When the control variable μ t After reaching a certain value such as 0.36, the complex variable x i It starts to branch in 6 directions, and the control variable μ t After reaching 0.7, each complex variable x i The amplitude tends to a stable value such as 0.9, and bifurcates into 6 stable states.
[0087] S14, determining q phases of the complex variable according to the q stable states, determining the spin orientation of the spin model according to the q stable phases, and obtaining a solution to the combinatorial optimization problem.
[0088] For example, the complex variable x i The number of stable bifurcations is 6, corresponding to 6 stable phases θ. The 6 spin orientations of the spin model are determined according to the 6 stable phases.
[0089] In the implementation example of this application, the complex variable x i Corresponding multiple phase angles θ i The combination of is the solution of Potts model.
[0090] Example 1
[0091] FIG3 is a flow chart of the algorithm for solving the combinatorial optimization problem provided in Example 1 of the present application. As shown in FIG3 , the implementation process of each step is described in detail in conjunction with the algorithm flow chart. The steps are as follows:
[0092] S201, describe the item ∑ in the external field j h j x j = 0, the spin model of the combinatorial optimization problem is determined by the actual problem, and the variable x to be solved is set i and action parameter Jij f(x)=-∑ ij J ij x i ·x j (8)
[0093] S202, set the multi-bifurcation parameter q and initialize the control variable μ.
[0094] The multi-bifurcation parameter is used to describe the spatial dimension of the solution and / or the number of bifurcations in the spin orientation. The multi-bifurcation parameter can be determined based on given constraints.
[0095] For example, in an actual traveling salesman problem, if 30 cities are visited, the multi-bifurcation parameter q is set to 30, and the control variable μ is initialized. The initial value of μ can be set, and the variable x to be solved is i Find the shortest route to visit 30 cities.
[0096] In some implementations, the control variable μ is set, including the control step size and value range of μ.
[0097] In some embodiments, the value of the control variable μ can be changed as the time parameter t increases, and the value of the control variable μ is set to a natural number sequence, such as μ shown in Figure 2a / 2b. t =-0.2,-0.1,0.0,0.08,….,0.7, the initial value of μ is μ0, and the value of t increases by 1 each time.
[0098] In some embodiments, the traversal controls the variable μ within the current setting range. t If no satisfactory solution is obtained, the control step size and value range of the control variable μ are reset.
[0099] S203, determine the intermediate value f of the interaction variable i .
[0100] In some embodiments, the intermediate value x of the complex variable to be solved can be j and the interaction matrix J ij Calculate the median value of the interaction variable f i :
[0101] S204, set the initial value of the loop variable i to 0.
[0102] S205, based on the complex variable x to be solved i and the median value of the interaction variable f i Calculate the dynamic equation (6) or (7) and get the optimal solution polynomial:
[0103] In formula (10), α is the third factor, and the values of α, r, and η are determined or adjusted based on experience.
[0104] S206, add 1 to the value of i; when the value of i is less than the set value N, return to step S205; when the value of i is equal to the set value N, terminate the loop and execute S207. The values of i and j are positive integers.
[0105] S207, change the value of the control variable μ according to the set step size, and return to step S204 if the value of the control variable μ is less than or equal to the set threshold; terminate the loop and execute S208 if the value of the control variable μ exceeds the set threshold.
[0106] S208, set the initial value of the loop variable i to 0.
[0107] S209, calculate the complex variable x i Phase θ i : θ i =angle(x i ) (11)
[0108] S210, add 1 to the value of i; when the value of i is less than the set value N, return to step S209; when the value of i is greater than or equal to the set value N, terminate the loop and execute S211.
[0109] S211, statistical phase θ i , determine the phase θ i Whether the value of converges to q stable states.
[0110] In phase θ i The value of is in the stable numerical region and the number of stable numerical regions converges to the setting of the multi-bifurcation parameter q, and the phase θ i As a result of the solution, S212 is executed; otherwise, at the phase θ i If the value of is unstable and the number of regions in the numerical region is greater than the set multi-bifurcation parameter q, return to step S202 and reset the control step size and value range of the control variable μ.
[0111] S212, output phase θ i value.
[0112] In Example 1 of the present application, the multi-bifurcation parameter q is a variable that controls the size of the spatial dimension of the solution to the actual problem. Compared with the prior art in which the variable can only bifurcate in two steps during the solution process, the embodiment of the present application can implement an annealing mechanism for multi-bifurcation solution, and can directly solve the XY model and the Potts model without converting into an Ising model.
[0113] For solving the same problem, compared with the Ising model, the variable scale required by this application is smaller and the amount of calculation is less. Therefore, the overall amount of calculation in the embodiment of this application can be reduced exponentially when solving large-scale combinatorial optimization problems.
[0114] Example 1 of the present application is based on a multi-bifurcation coding scheme, which can achieve the purpose of searching for the optimal solution to a certain problem and ensure accuracy.
[0115] The first embodiment of the present application can realize the annealing mechanism of multi-bifurcation solution, and the number of spin directions is determined by the multi-bifurcation parameter. Therefore, the first embodiment of the present application can directly solve the XY model and the Potts model.
[0116] Many combinatorial optimization problems, including the maximum k-cut problem, graph coloring problem, N-queens problem, and traveling salesman problem, can be solved using the algorithm of Example 1 of this application. The following uses the graph coloring problem and the traveling salesman problem as examples.
[0117] Example 2
[0118] Figure 4a is a schematic diagram of the graph coloring problem provided in Example 2 of the present application. As shown in Figure 4a, the graph coloring problem is an NP problem. The user inputs a given undirected graph G = (V, E), where V is a vertex and E is an edge connecting two vertices. The computing device of the present application is used to solve whether it is possible to assign a color to each vertex using K colors so that no two adjacent vertices have the same color. Two adjacent vertices with the same color constitute a conflict.
[0119] FIG4b is a flowchart of the graph coloring problem solution provided by Example 2 of the present application. As shown in FIG4b, for the graph coloring problem, the method for solving the combinatorial optimization problem provided by Example 2 of the present application includes the following steps:
[0120] S301, determining a spin model based on a graph coloring problem. The spin model is a Potts model based on multi-directional bifurcation of complex variables. The Hamiltonian form of the Potts model is:
[0121] Where CN is the color conflict number (CN), ignoring the effect of the external field. The external field description term ∑ j h j x j =0.
[0122] In the second embodiment of the present application, according to the undirected graph G = (V, E), the computing device obtains the value of the number of vertices V of the undirected graph G as the number of complex variables (or spins) n, then n = V; suppose n complex variables to be solved v represents the vertex, phase θ vThe value of represents the color of vertex v. e uv Indicates whether vertex u and vertex v are connected. If vertex u and vertex v are connected, then e uv = 1, if vertex u and vertex v are not connected, e uv =0.
[0123] in, Used to compare whether the colors of two connected vertices v and u conflict. Specifically, compare the phase angle θ v and θ u Are they the same? If the angle θ v and θ u If the same, then the colors of vertices v and u are the same and become a conflict, δ=1; if the angle θ v and θ u If they are different, the colors of vertices v and u satisfy the coloring requirements, and δ = 0.
[0124] For example, as shown in FIG4a, there are vertices 1-10, then n=10, and the 10 vertices to be colored are the complex variables to be solved e 12 is the edge connecting vertex 1 and vertex 2, e 12 =1; Vertex 1 and Vertex 3 are not connected, then e 13 = 0; if vertex 1 is red and vertex 5 is green, then
[0125] Furthermore, if CN=0, it means that the Potts model of formula (12) has a solution, and each of the 10 vertices can be assigned a color using 3 colors, and no two connected vertices have the same color.
[0126] S302, determining initial parameters, including the multi-bifurcation parameter q, the control variable μ and the complex variable to be solved.
[0127] The value of the number of colors K is set as the multi-bifurcation parameter q, then q=K; as shown in FIG4a , the number of colors K is 3, namely K1 red, K2 green and K3 yellow, then the multi-bifurcation parameter q=3.
[0128] Set the edge e connecting vertex u and vertex v uv As the interaction parameter, J ij =e uv , complex variable x v Represents a spin Complex variable x u Represents another spin
[0129] The initial value of the control variable μ can be selected based on experience. For example, the bifurcation critical point can be calculated based on the dynamic equation, and the initial value of the control variable μ is set to be smaller than the bifurcation critical point.
[0130] S303, solving the kinetic equation of the complex variable according to formula (12) of the spin model.
[0131] The kinetic equation calculated by formula (12) is:
[0132] or
[0133] S304, change the control variable μ so that the complex variable x v The transition from a single stable state to multiple stable states can be made. For the specific implementation, reference can be made to steps S202 to S212 in Example 1, which will not be repeated here.
[0134] For example, for the graph coloring shown in FIG4a, the control variable μ is changed so that the complex variable x v It transitions from a single stable state to three stable states, and the phases corresponding to the three stable states are 0, 2π / 3, and -2π / 3 respectively.
[0135] S305, output multiple complex variables x i Phase θ i , multiple complex variables x i The corresponding phase combination is the solution of the Potts model.
[0136] For example, for the graph coloring shown in FIG4a, multiple complex variables x are output. i Phase θ i , the color of the corresponding vertex is determined according to the phase angle value of the output complex variable.
[0137] Example 2 of the present application can greatly reduce the variable scale of the combinatorial optimization problem when solving the combinatorial optimization problem of large-scale graph coloring, and the overall computational complexity can be reduced by n*q times.
[0138] The method for solving a combinatorial optimization problem provided by an embodiment of the present application can be applied to scenarios such as timetable formulation, mobile radio frequency allocation, register allocation, and server scheduling.
[0139] Example 3
[0140] Figure 5a is a schematic diagram of the traveling salesman problem provided in Example 3 of this application. As shown in Figure 5a, the traveling salesman problem is an NP-hard problem in combinatorial optimization. Given a series of m cities and the distances between each pair of cities, find the shortest possible path that visits each city once and returns to the starting city.
[0141] FIG5b is a flowchart of the traveling salesman problem solution provided in Example 3 of the present application. As shown in FIG5b , for the traveling salesman problem, the method for solving the combinatorial optimization problem provided in Example 3 of the present application includes the following steps:
[0142] S401, determining a spin model based on the traveling salesman problem. The spin model is a Potts model based on multi-directional bifurcation of complex variables. The Hamiltonian form of the Potts model is:
[0143] Among them, D(x v ) is the distance to be minimized; without considering the effect of the external field, the external field description term ∑ j h j x j =0.
[0144] In Example 3 of the present application, the computing device obtains the distances between m cities and each pair of cities provided by the user, where the value of m is used as the number of complex variables (or spins), v represents the city, and the phase θ v represents the order of visiting city v, w uv Represents the distance between city u and city v.
[0145] δ(,) is used to describe the next possible city to visit: Indicates that city u is visited first; q is a multi-bifurcation parameter, e i2π / q The sequence number of the visited city is increased by 1, indicating the next visited city. When , δ = 1, indicating that the next city to be visited is city v; When δ=0, it means the next city to be visited is not city v. Calculate D(x v ) value, visit each city once and return to the starting city, solve D(x v ) is accessed in the order of minimum value.
[0146] S402, determining initial parameters, including multi-bifurcation parameters, control variables μ and complex variables to be solved.
[0147] Let the number of cities m be the number of complex variables (or spins), the number of cities m be the multi-bifurcation parameter q, and the distance between cities w uv As an interaction. Let the complex variable x v Represents a spin where |x v | is the complex variable x v The amplitude changes from small to large during the evolution process.
[0148] Complex variable x u Represents another spin Set the initial value of the control variable μ.
[0149] For example, referring to FIG5 a , the number of cities m=35, each city is visited once and then returns to the starting city, and the multi-bifurcation parameter q=35.
[0150] S403, calculate the kinetic equation according to formula (15) and find the solution with the minimum value of D(r).
[0151] The kinetic equation calculated by formula (15) is:
[0152] or
[0153] S404, change the control variable μ so that the complex variable x v The transition from a single stable state to multiple stable states can be made. For the specific implementation, reference can be made to steps S202 to S212 in Example 1, which will not be repeated here.
[0154] S405, output multiple complex variables x i Phase θ i , multiple complex variables x i The corresponding phase θ i The combination of is the solution of Potts model. The order of city visits is obtained according to the phase angle of the complex variable.
[0155] In solving the large-scale combinatorial optimization traveling salesman problem, the embodiment 3 of the present application can greatly reduce the variable scale of the combinatorial optimization problem, and the overall computational complexity can be reduced by m 2 times.
[0156] Solving the traveling salesman problem using the combinatorial optimization method provided in Example 3 of this application can be applied to many fields, including planning, logistics, chip manufacturing, and DNA sequencing. In these applications, the concept of "city" is used to represent customers, welding points, or DNA fragments, while the concept of "distance" represents travel time, travel cost, or a similarity measure between DNA fragments.
[0157] In many application scenarios, such as limited resources or time windows, it may be necessary to add additional constraints and introduce external field description items.
[0158] The method for solving combinatorial optimization problems provided in this application embodiment simulates a multi-bifurcation solution process using a classical computer. This multi-bifurcation solution is performed entirely in the complex domain. The multi-directional bifurcation parameter q controls the number of bifurcations of the variable being solved, and its value is selectable. The phase of the output complex variable is the solution to the problem.
[0159] The method for solving the combinatorial optimization problem provided in the embodiment of the present application is based on a multi-bifurcation coding scheme, which can achieve the purpose of searching for the optimal solution to a problem and ensure accuracy.
[0160] FIG6 is a schematic diagram of a device for solving a combinatorial optimization problem provided by an embodiment of the present application. As shown in FIG6 , the device includes: a problem acquisition module 91 that receives a combinatorial optimization problem input by a user; a combinatorial optimization problem refers to finding a solution that satisfies the requirements of the arrangement and combination of multiple things under the constraints given by the user; a model conversion module 92 maps the combinatorial optimization problem to a Potts model; the Potts model includes complex variables to be solved and an objective function; the complex variables to be solved are used to describe the solution of the arrangement and combination of things as discrete variables under the complex domain; the objective function is used to describe the arrangement and combination of multiple things under given constraints; a dynamic equation determination module 93 determines the dynamic equation of the Potts model in the complex domain, and the dynamic equation is used to describe the solution to be solved. The complex variable to be solved is based on the time evolution process; the dynamic equation includes at least a control variable, a multi-bifurcation parameter and an action parameter; the control variable is used to control the bifurcation speed of the spin orientation of the complex variable to be solved; the multi-bifurcation parameter is used to express the spatial dimension of the solution and / or the number of spin orientations; the action parameter is used to describe the interaction between two spin orientations of the complex variable to be solved; the equation solving module 94 solves the dynamic equation, and obtains q stable spin orientations of the complex variable to be solved by changing the value of the control variable; the value of q is determined by the multi-bifurcation parameter; q phase angles of the complex variable to be solved are determined according to the q stable spin orientations to obtain the solution of the combinatorial optimization problem.
[0161] Figure 7 is a schematic diagram of an electronic device according to an embodiment of the present application. As shown in Figure 7, electronic device 1000 includes: at least one memory 1001 for storing programs; and at least one processor 1002 for executing the programs stored in memory 1001. When the programs stored in the memory are executed, processor 1002 is configured to execute the method for solving the combinatorial optimization problem described in any of the above embodiments.
[0162] The embodiment of the present application provides a computer storage medium 1003, in which instructions are stored. When the instructions are executed on a computer, the computer executes the anomaly detection method as described in any one of the above embodiments.
[0163] It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0164] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0165] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted via the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)).
[0166] It will be understood that the various numerical numbers involved in the embodiments of the present application are merely distinctions for the convenience of description and are not intended to limit the scope of the embodiments of the present application.
[0167] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A method for solving combinatorial optimization problems, characterized in that: The method comprises: Receive a combinatorial optimization problem input by a user; the combinatorial optimization problem refers to finding a solution that satisfies the requirements of the arrangement and combination of multiple objects under the constraints given by the user; The combinatorial optimization problem is mapped into a spin model; the spin model includes complex variables to be solved and an objective function; the complex variables to be solved are used to describe the solution that the arrangement and combination of the objects meet the requirements as discrete variables in the complex domain; the objective function is used to describe the arrangement and combination of multiple objects under the given constraint conditions; Determine a dynamic equation of the complex variable to be solved in a complex domain, wherein the dynamic equation is used to describe the time-based evolution process of the complex variable to be solved; the dynamic equation at least includes a control variable, a multi-bifurcation parameter and an action parameter; the control variable is used to control the bifurcation speed of the complex variable to be solved; the multi-bifurcation parameter is used to express the number of phases of the complex variable to be solved; and the action parameter is used to describe the interaction of the complex variable to be solved; Solving the dynamic equation, and obtaining q stable phases of the complex variable to be solved by changing the value of the control variable; the value of q is determined by the multi-bifurcation parameter; The spin orientation of the spin model is determined according to the q stable phases, and a solution to the combinatorial optimization problem is obtained.
2. The method according to claim 1, characterized in that The dynamic equation also includes an external field description term, which is used to describe additional constraints.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: The multi-bifurcation parameter is determined according to the given constraint condition.
4. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Determine the spatial dimension of the solution according to the multi-bifurcation parameter; or The number of bifurcations of the complex variable to be solved is determined according to the multi-bifurcation parameter.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Setting the control variable includes setting a value range and a control step size of the control variable.
6. The method according to any one of claims 1 to 5, characterized in that: The changing the value of the control variable comprises: Change the value of the control variable according to the set control step size.
7. The method according to any one of claims 1 to 6, characterized in that: Including a time parameter, the changing the value of the control variable comprises: The value of the control variable is gradually changed based on the increase of the time parameter.
8. The method according to any one of claims 1 to 7, characterized in that: The step of obtaining q stable phases of the complex variable to be solved by changing the value of the control variable comprises: When the number of bifurcations in the stable state is greater than q, the value of the control variable is changed so that the complex variable to be solved bifurcates from a single stable state to multiple stable phases; until the number of the stable phases is equal to q.
9. The method according to any one of claims 1 to 8, characterized in that: The combinatorial optimization problem is a graph coloring problem, and the constraint condition is K colors. Under the constraint condition, a solution is sought to assign a color to each vertex so that no two adjacent vertices have the same color. The mapping of the combinatorial optimization problem to a Potts model includes: The Potts model for the graph coloring problem is determined as: Where CN is the number of color conflicts; suppose n complex variables to be solved v,u represent the vertices, and the phase θ v The value of represents the color of vertex v; is the objective function, which is used to compare whether the colors of two connected vertices v and u conflict; the value of the number of colors K is used as the multi-bifurcation parameter; the connecting edge e between vertex u and vertex v uv As the interaction parameter, e uv Indicates whether vertex u and vertex v are connected.
10. The method according to any one of claims 1 to 8, characterized in that: The combinatorial optimization problem is a traveling salesman problem, and the constraints are the distances between m cities and each pair of cities. Under the constraints, the solution of the shortest loop that visits each city once and returns to the starting city is sought. The mapping of the combinatorial optimization problem to a Potts model includes: The Potts model of the traveling salesman problem is determined as: Among them, D(x v ) is the distance of the shortest loop; let m complex variables to be solved v,u represent cities, phase θ v represents the order of visiting city v, w uv As the interaction parameter, it represents the distance between city u and city v; is the objective function, which is used to describe the next possible city to visit; means visiting city u first; q is the multi-bifurcation parameter, e i2π / q Add 1 to the sequence number of the visited city to indicate the next visited city. When , the objective function δ=1, indicating that the next city to be visited is city v; when When , the objective function δ = 0, indicating that the next visited city is not city v; the number of cities m is used as the multi-bifurcation parameter.
11. The method according to any one of claims 1 to 10, characterized in that: The spin model includes a Potts model or an XY model.
12. An electronic device, characterized in that: include: at least one memory for storing a program; At least one processor is used to execute the program stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method according to any one of claims 1 to 11.
13. A computer storage medium, wherein instructions are stored in the computer storage medium, and when the instructions are executed on a computer, the computer executes the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Method, device and system for solving combinatorial optimization problem
CN119337020A
Hybrid quantum algorithm-based combinatorial optimization solving method, system and solver architecture
CN113392580A
Information processing device, information processing system, information processing method, storage medium, and program
CN113646784A
Stereo matching method based on simulated bifurcation
CN115131422A
Method for solving entity alignment problem based on distribution problem
CN116150385A
Cited By
Parameter determination method and device of elastic flywheel, storage medium and electronic equipment
CN121562222A