Method, device and system for solving combinatorial optimization problem

Through the multi-directional bifurcation quantum heuristic algorithm of phase encoding, the combinatorial optimization problem is mapped into a spin model, which solves the problems of slow solution speed and high resource and energy consumption of combinatorial optimization problems under large-scale variables, and achieves an efficient solution process.

CN119337020APending Publication Date: 2025-01-21HUAWEI TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202310898465.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-20
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

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.

Method used

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.

Benefits of technology

Significantly improve the speed and quality of solving combinatorial optimization problems under large-scale variables, reduce resource and energy consumption, meet computing power requirements, and shorten solution time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119337020A_ABST
    Figure CN119337020A_ABST
Patent Text Reader

Abstract

The invention provides a method, a device and a system for solving a combinatorial optimization problem. The method comprises the steps of receiving a combination optimization problem input by a user; mapping the combinatorial optimization problem into a model; the model comprises a complex variable to be solved and a target function; the complex variables to be solved are used for describing solutions, meeting the requirements, of permutation and combination of things as discrete variables in a complex field; the objective function is used for describing permutation and combination of a plurality of things under a given constraint condition; determining a kinetic equation of the model in a complex field, wherein the kinetic equation is used for describing a time-based evolution process of a complex variable to be solved; the kinetic equation at least comprises a control variable, a multi-bifurcation parameter and an action parameter; solving the kinetic equation, and changing the value of the control variable to obtain q stable phases of the complex variable to be solved; the value of q is determined by a multi-bifurcation parameter; and obtaining a solution of the combinatorial optimization problem according to the q stable phases. The spin scale can be reduced and the solving time can be shortened when the combinatorial optimization problem is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] 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

[0002] In social life and industry, we often encounter the problem of finding the best combination among a large number of variables. Common problems include the traveling salesman problem and the minimum spanning tree. In the industry, they involve large-scale integrated circuit design, drug design, and financial portfolio management problems, etc. These combinatorial optimization problems are often expressed mathematically as minimization or maximization problems of objective functions based on discrete variables.

[0003] Combinatorial optimization problems refer to problems of finding the best arrangement or combination of certain things under given constraints. The characteristic of combinatorial optimization problems is that the decision space of decision variables is a finite set of points, and the optimal solution to the problem can be obtained by exhaustive enumeration. However, exhaustive enumeration and enumeration methods are often not feasible. The number of feasible solutions will increase exponentially with the scale of the problem. For each additional decision variable, the speed of solution needs to be doubled. Take the traveling salesman problem as an example. It was first proposed by Dantzig et al. in 1959. It is the most basic shortest path problem. The traveling salesman has to travel to several cities. The distance between the cities is known. In order to save money, the traveling salesman decides to start from the city where he is located, travel to each city once, and then return to the initial city. So what route should he choose to minimize the distance or cost? When the number of cities increases, the complexity of the problem will increase exponentially. For example, when there are 30 cities, it will take hundreds of thousands of years to try all possible routes with the fastest supercomputers. Although parallel computing with hundreds of thousands of supercomputers can shorten the solution time, it consumes huge resources and energy and requires huge capital support from application developers. The computing power of current computing equipment cannot meet the capital and benefit requirements. Therefore, it is necessary to provide a method, device and system for solving combinatorial optimization problems to improve the speed and quality of solving combinatorial optimization problems under large-scale variables. Summary of the invention

[0004] 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 solution quality of combinatorial optimization problems under large-scale variables, reduce resource energy consumption, meet computing power requirements, and improve user satisfaction.

[0005] In a first aspect, an embodiment of the present application provides a method for solving a combinatorial optimization problem. The method comprises: receiving a combinatorial optimization problem input by a user; the combinatorial optimization problem refers to finding a solution that satisfies the arrangement and combination of multiple objects under the constraints given by the user; mapping the combinatorial optimization problem into a spin model; the spin model comprises a complex variable to be solved and an objective function; the complex variable to be solved is used to describe the solution that satisfies the arrangement and combination of objects as discrete variables under a complex number domain; the objective function is used to describe the arrangement and combination of multiple objects under given constraints; determining a dynamic equation of the complex variable to be solved in the complex number domain, the dynamic equation is used to describe the time-based evolution process of the complex variable to be solved; the dynamic equation at least comprises 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 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; determining the spin orientation of the spin model according to the q stable phases, and obtaining a solution to the combinatorial optimization problem.

[0006] 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, and after initializing the control variables and the complex variables to be solved, the control variables drive the complex variables to be solved to bifurcate in multiple directions according to the dynamic equation, and takes the phase angle of the complex variables 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, the solution speed and solution quality of the combinatorial optimization problem can be improved under large-scale variables, greatly reducing the spin scale required to solve the problem, reducing the computing power requirements, and shortening the solution time.

[0007] In a feasible implementation, the dynamic equation further includes an external field description term, and the external field description term is used to describe additional constraints.

[0008] 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.

[0009] In an achievable implementation, the method further includes: determining a multi-bifurcation parameter according to a given constraint condition.

[0010] 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 the Potts model.

[0011] In an achievable implementation, 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.

[0012] Therefore, for solving the same problem, compared with the Ising model, the variable scale required in the embodiment of the present application is smaller and the amount of calculation is less, and the overall amount of calculation can be reduced exponentially when solving large-scale combinatorial optimization problems.

[0013] In an achievable implementation, the method further includes: setting a control variable, including setting a value range and a control step size of the control variable.

[0014] 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.

[0015] In an achievable implementation, changing the value of the control variable includes: changing the value of the control variable according to a set control step size.

[0016] 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.

[0017] 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.

[0018] In this way, the embodiment of the present application can change the value of the control variable by changing the time parameter, thereby speeding up the solution of the complex variable bifurcation.

[0019] 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.

[0020] In this way, the embodiments of the present application can obtain the solution to the combinatorial optimization problem in the complex domain according to 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.

[0021] In an achievable implementation, the combinatorial optimization problem is a graph coloring problem, the constraint condition is K colors, and under the constraint condition, a solution 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:

[0022]

[0023] 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.

[0024] Thus, by using a method for solving a combinatorial optimization problem provided by an embodiment of the present application, the variable scale of the combinatorial optimization problem can be greatly reduced when solving the combinatorial optimization problem of large-scale graph coloring, and the overall computational complexity can be reduced by n*q times. It can also solve combinatorial optimization problems in scenarios such as timetable making, mobile radio frequency allocation, register allocation, and server scheduling.

[0025] In an achievable implementation, the combinatorial optimization problem is a traveling salesman problem, the constraints are m cities and the distances between each pair of cities, and the solution of the shortest loop that visits each city once and returns to the starting city is sought under the constraints. The combinatorial optimization problem is mapped to a Potts model, including: determining the Potts model of the traveling salesman problem as:

[0026]

[0027] Where D(x) is the distance of the shortest loop; 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; 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.

[0028] In this way, the embodiment of the present application can greatly reduce the variable scale of the combinatorial optimization problem when solving the large-scale combinatorial optimization traveling salesman problem, and the overall calculation amount can be reduced by m 2Times. The method for solving the combinatorial optimization problem provided in the embodiment of the present application is used to solve the traveling salesman problem, which 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 similarity measurement 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 are directly solved without converting to the Ising model. Compared with the Ising model, the variable scale required in this application is smaller and the amount of calculation is less for solving the same problem.

[0031] In a second aspect, an embodiment of the present application provides an electronic device, comprising: at least one memory for storing a program; and at least one processor for executing the program stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method of any embodiment of the first aspect. The beneficial effects are as described in the first aspect and will not be repeated here.

[0032] In a third aspect, an embodiment of the present application provides a computer storage medium, in which instructions are stored, and when the instructions are executed on a computer, the computer executes the method of any embodiment of the first aspect. The beneficial effects are as described in the first aspect and will not be repeated 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 drawings required for the description of the embodiments will be briefly introduced below. 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 paying creative work.

[0034] The following is a brief introduction to the drawings required for describing the embodiments or prior art.

[0035] Figure 1 A flowchart of a method for solving a combinatorial optimization problem provided in an embodiment of the present application;

[0036] Figure 2a A schematic diagram of phase bifurcation of complex variables in a method for solving a combinatorial optimization problem provided in an embodiment of the present application;

[0037] Figure 2b A schematic diagram of the amplitude bifurcation of complex variables in the method for solving the combinatorial optimization problem provided in an embodiment of the present application;

[0038] Figure 3 An algorithm flow chart of a method for solving a combinatorial optimization problem provided in Example 1 of the present application;

[0039] Figure 4a A schematic diagram of the graph coloring problem provided in Example 2 of the present application;

[0040] Figure 4b A flowchart for solving the graph coloring problem provided in Example 2 of the present application;

[0041] Figure 5a A schematic diagram of the traveling salesman problem provided in Example 3 of the present application;

[0042] Figure 5b A flow chart for solving the traveling salesman problem provided in Example 3 of the present application;

[0043] Figure 6 A schematic diagram of a device for solving a combinatorial optimization problem provided in an embodiment of the present application;

[0044] Figure 7 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 interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a concrete way.

[0046] In the description of the embodiments of the present application, the term "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "multiple" means two or more. For example, multiple systems refers to two or more systems, and multiple terminals refers to two or more terminals.

[0047] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprises", "has" 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 will 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 those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application 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 a problem and the size of the problem.

[0055] Non-deterministic polynomial (NP) problems are problems that can be solved by non-deterministic machines in polynomial time.

[0056] The Ising model is used to describe the ferromagnetism of materials. The model contains parameters that can be used to describe the magnetic moment of a single atom, where the parameters of the magnetic moment of a single atom are +1 or -1, representing spin up or down, respectively. These magnetic moments are usually arranged according to certain rules to form a lattice, and specific interaction parameters are introduced in the model so that adjacent spins affect 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 in conjunction with the accompanying drawings.

[0058] Scientists proposed the spin model in the process of studying the properties of magnetic materials, and gradually found that many combinatorial optimization problems can be mapped to the spin model. The spin model has been widely used in the field of combinatorial optimization and has brought some new solutions to combinatorial optimization problems.

[0059] Spin models are mainly used in physics to explain mathematical models of magnetism. Since 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:

[0061] H(σ)=-∑ ij J ij σ i σ j -∑ j h j σ j (1)

[0062] 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.

[0063] The Hatt quantity expression of the XY model is as follows:

[0064] H(s)=-∑ ij J ij s i ·s j -∑ j h j ·s j =-∑ ij J ij cos(θ i -θ j )-∑ j h j cosθ j (2)

[0065] In formula (2), s i represents the orientation of the spin, which can take continuous values ​​in a two-dimensional plane. ij represents the interaction between spins, h j Indicates the outfield.

[0066] The Potts model is a generalization of the Ising model. The Potts model is a spin model of interactions on a lattice. The orientation of the spin in the Potts model takes discrete values ​​in a two-dimensional plane.

[0067] In formula (2), θ i =2*2πn / q,θ i is the phase of the ith 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 plane, J ij represents the interaction between the two spins, h j Indicates the outfield.

[0068] 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.

[0069] 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 continuous 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:

[0070] f(x)=-∑ ij J ij x i x j -∑ j h j x j (3)

[0071] In formula (3), x is a continuous variable, x i represents a spin, x j represents another spin.

[0072] 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:

[0073]

[0074] 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.

[0075] The simulated bifurcation algorithm is used to realize the transition of continuous variables from one steady state to two steady states, which can be used to solve the Ising model with only two spin orientations. However, the XY model with continuous changes in a two-dimensional plane or the Potts model with multiple discrete spin orientations in a two-dimensional plane requires an exponential increase in the spin scale and amount of calculation, and Scheme 1 cannot meet the computing power requirements.

[0076] The embodiment of the present application provides a device for solving combinatorial optimization problems, which is used to map the problems abstracted from combinatorial optimization problems in actual production and life into a Potts model and find the optimal solution. Combinatorial optimization problems involve the fields of extremely large-scale integrated circuit design, drug design, and financial portfolio management, etc. The abstracted problems include the maximum k-cut problem, graph partitioning problem, graph coloring problem, N-queen problem, traveling salesman problem, etc. These abstracted problems are mathematically expressed as minimization or maximization problems of objective functions based on discrete variables.

[0077] 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.

[0078] 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.

[0079] Figure 1 A flowchart of a method for solving a combinatorial optimization problem provided in an embodiment of the present application. Figure 1 As shown, the following steps are included:

[0080] 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:

[0081] f(x)=-∑ ij J ij x i ·x j -∑ j h j x j (5)

[0082] In some embodiments, the effect of the external field is not considered, and the external field description term ∑ j h j x j=0.

[0083] In some embodiments, the spin model may be an XY model based on multi-directional bifurcation of complex variables.

[0084] S12, determine the dynamic equation 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:

[0085]

[0086] or

[0087]

[0088] in is a complex variable, is x i is the conjugate of , 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 empirically.

[0089] Let x be a complex variable. i Representing a spin, solving 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 .

[0090] S13, change the control variable μ to drive the complex variable x i Transition from a single stable state to multiple stable states.

[0091] 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.

[0092] 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, complex variable x i is 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.

[0093] Figure 2a A schematic diagram of phase bifurcation of complex variables is given; Figure 2b A schematic diagram of the amplitude bifurcation of complex variables is given; Figure 2a and 2b As shown, based on the change of 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.

[0094] 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.

[0095] 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.

[0096] In the implementation example of this application, the complex variable x i Corresponding multiple phase angles θ i The combination of is the solution of the Potts model.

[0097] Example 1

[0098] Figure 3 This is a flow chart of an algorithm for solving the combinatorial optimization problem provided in Example 1 of the present application. Figure 3 As shown in the figure, the implementation process of each step is explained in detail in combination with the algorithm flow chart. The steps are as follows:

[0099] S201, in the external field description item ∑ 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 J ij .

[0100] f(x)=-∑ij J ij x i ·x j (8)

[0101] S202, set the multi-bifurcation parameter q and initialize the control variable μ.

[0102] The multi-bifurcation parameter is used to describe the number of bifurcations of the spatial dimension of the solution and / or the spin orientation, and the multi-bifurcation parameter can be determined according to given constraints.

[0103] For example, in an actual traveling salesman problem, 30 cities are visited, and 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 The shortest path to visit 30 cities.

[0104] In some implementations, a control variable μ is set, including a control step size and a value range of μ.

[0105] In some implementations, the value of the control variable μ may be changed as the time parameter t increases, and the value of the control variable μ may be set to a natural number sequence, such as Figure 2a / 2b shown in μ 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.

[0106] 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.

[0107] S203, determine the intermediate value f of the interaction variable i .

[0108] 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 :

[0109]

[0110] S204, setting the initial value of loop variable i to 0.

[0111] S205, based on the complex variable x to be solved i and the intermediate value of the interaction variable f i Calculate the dynamic equation (6) or (7) and get the optimal solution polynomial:

[0112]

[0113] In formula (10), α is the third factor, and the values ​​of α, r, and η are determined or adjusted based on experience.

[0114] 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.

[0115] S207, change the value of the control variable μ according to the set step size, and return to step S204 when the value of the control variable μ is less than or equal to the set threshold; terminate the loop and execute S208 when the value of the control variable μ exceeds the set threshold.

[0116] S208, set the initial value of the loop variable i to 0.

[0117] S209, calculate the complex variable x i The phase θ i :

[0118] θ i =angle(x i ) (11)

[0119] 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.

[0120] S211, statistical phase θ i , determine the phase θ i Whether the value of converges to q stable states.

[0121] 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 μ.

[0122] S212, output phase θ i The value of .

[0123] 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 during the solution process, the embodiment of the present application can implement an annealing mechanism for multi-bifurcation solutions, and can directly solve the XY model and the Potts model without converting them into an Ising model.

[0124] For solving the same problem, compared with the Ising model, the variable scale required in this application is smaller and the amount of calculation is less. Therefore, the overall amount of calculation in the embodiment of the present application can be reduced exponentially when solving large-scale combinatorial optimization problems.

[0125] Embodiment 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 the accuracy can be guaranteed.

[0126] The embodiment 1 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 embodiment 1 of the present application can directly solve the XY model and the Potts model.

[0127] Many combinatorial optimization problems including the maximum k-cut problem, graph coloring problem, N-queens problem, traveling salesman problem, etc. can be solved using the algorithm of embodiment 1 of the present application. The following is an introduction using the graph coloring problem and the traveling salesman problem as examples.

[0128] Example 2

[0129] Figure 4a This is a schematic diagram of the graph coloring problem provided in Example 2 of this application. Figure 4a As shown, 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 a color can be assigned to each vertex using K colors so that no two adjacent vertices have the same color. Two adjacent vertices having the same color constitute a conflict.

[0130] Figure 4b This is a flowchart for solving the graph coloring problem provided in Example 2 of this application. Figure 4b As shown, for the graph coloring problem, the method for solving the combinatorial optimization problem provided in Example 2 of the present application includes the following steps:

[0131] S301, determining a spin model according to a graph coloring problem, the spin model is a Potts model based on multi-directional bifurcation of complex variables, and the Hamiltonian form of the Potts model is:

[0132]

[0133] 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.

[0134] In Embodiment 2 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 are v represents the vertex, and the phase θ v The value of represents the color of vertex v. 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.

[0135] 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 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.

[0136] For example, Figure 4a As shown, 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

[0137] 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 three colors, and no two connected vertices have the same color.

[0138] S302, determining initial parameters, including multi-bifurcation parameter q, control variable μ and complex variables to be solved.

[0139] Set the value of the number of colors K as the multi-bifurcation parameter q, then q = K; Figure 4aAs shown, the number of colors K is 3, namely K1 red, K2 green and K3 yellow, and the multi-bifurcation parameter q=3.

[0140] 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

[0141] 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.

[0142] S303, solving the kinetic equation of the complex variable according to formula (12) of the spin model.

[0143] The kinetic equation calculated by formula (12) is:

[0144]

[0145] or

[0146]

[0147] S304, change the control variable μ so that the complex variable x v Transition from a single stable state to multiple stable states. For specific implementation, reference may be made to step S202 to step S212 in embodiment 1, which will not be described in detail here.

[0148] For example, for Figure 4a Color the graph shown, and change the control variable μ so that the complex variable x v It transforms 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.

[0149] S305, output multiple complex variables x i The phase θ i , multiple complex variables x i The corresponding phase combination is the solution of the Potts model.

[0150] For example, for Figure 4a Coloring the graph shown, outputting multiple complex variables x i The phase θ i , the color of the corresponding vertex is determined according to the value of the phase angle of the output complex variable.

[0151] 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 calculation amount can be reduced by n*q times.

[0152] A method for solving a combinatorial optimization problem provided by an embodiment of the present application can be applied to scenarios such as timetable making, mobile radio frequency allocation, register allocation, and server scheduling.

[0153] Example 3

[0154] Figure 5a Schematic diagram of the traveling salesman problem provided in Example 3 of this application. Figure 5a As shown in Figure 1, 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 path that visits each city once and returns to the starting city.

[0155] Figure 5b This is a flow chart for solving the traveling salesman problem provided in Example 3 of this application. Figure 5b As shown, 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:

[0156] S401, determining a spin model according to 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:

[0157]

[0158] Among them, D(x v ) is the distance to be minimized; the effect of the external field is not considered, and the external field description term ∑ j h j x j =0.

[0159] In Embodiment 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.

[0160] δ(,) is used to describe the next possible city to visit: means visiting city u first; q is the 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 that the next city to be visited is not city v. Calculate D(xv ) value, visit each city once and return to the starting city, solve D(x v ) is accessed in the order of the smallest value.

[0161] S402, determining initial parameters, including multiple bifurcation parameters, control variables μ and complex variables to be solved.

[0162] 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 city distance W uv As an interaction. Let the complex variable x v Represents a spin where |x v | is a complex variable x v The amplitude changes from small to large during the evolution process.

[0163] Complex variable x u Represents another spin Set the initial value of the control variable μ.

[0164] For example, reference Figure 5a As shown, the number of cities m = 35, each city is visited once and returns to the starting city, then the multi-bifurcation parameter q = 35.

[0165] S403, calculate the kinetic equation according to formula (15) and find a solution with the minimum value of D(r).

[0166] The kinetic equation calculated by formula (15) is:

[0167]

[0168] or

[0169]

[0170] S404, change the control variable μ so that the complex variable x v Transition from a single stable state to multiple stable states. For specific implementation, reference may be made to step S202 to step S212 in embodiment 1, which will not be described in detail here.

[0171] S405, output multiple complex variables x i The 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.

[0172] In the case of solving the large-scale combinatorial optimization traveling salesman problem, the variable scale of the combinatorial optimization problem can be greatly reduced, and the overall calculation amount can be reduced by m2 times.

[0173] The method for solving the combinatorial optimization problem provided in Example 3 of the present application is used to solve the traveling salesman problem, which 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 similarity measurement between DNA fragments.

[0174] 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.

[0175] The method for solving the combinatorial optimization problem provided in the embodiment of the present application is a multi-bifurcation solution process simulated by a classical computer, and the multi-bifurcation solution process is all completed in the complex domain. The multi-directional bifurcation parameter q is a variable that controls the number of bifurcations of the variable to be solved, and the value of q is selectable; the phase of the output complex variable is the solution to the problem.

[0176] The method for solving the combinatorial optimization problem provided in the embodiment of the present application is based on a multi-bifurcation encoding scheme, which can achieve the purpose of searching for the optimal solution to a certain problem. The accuracy can be guaranteed.

[0177] Figure 6 A schematic diagram of a device for solving a combinatorial optimization problem provided in an embodiment of the present application. Figure 6 As shown, the device includes: a problem acquisition module 91 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 objects 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 a complex variable to be solved and an objective function; the complex variable to be solved is used to describe the solution of the arrangement and combination of objects as a discrete variable in a complex domain; the objective function is used to describe the arrangement and combination of multiple objects 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 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.

[0178] Figure 7A schematic diagram of an electronic device is provided for an embodiment of the present application. Figure 7 As shown, the electronic device 1000 includes: at least one memory 1001 for storing programs; at least one processor 1002 for executing the programs stored in the memory 1001. When the program stored in the memory is executed, the processor 1002 is used to execute the method for solving the combinatorial optimization problem as described in any one of the above embodiments.

[0179] The embodiment of the present application proposes 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.

[0180] It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), or 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.

[0181] 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, and the software modules 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.

[0182] 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 may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may 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 may 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 disk (SSD)), etc.

[0183] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.

Claims

1. A method for solving a combinatorial optimization problem, 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 to make the complex variable to be solved branch 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

Cited By

  • Task operation method, electronic equipment, medium and product

    CN119718553A

  • Method, apparatus and system for solving combinatorial optimization problem

    EP4730159A1

  • Method, apparatus and system for solving combinatorial optimization problem

    WO2025016344A1