Boolean satisfiability problem solving method and Boolean satisfiability problem solving system
By combining traditional random walk algorithms with optical computing, and leveraging the high parallelism and low energy consumption of optoelectronic hybrid computing devices, the problem of low efficiency in solving large-scale SAT problems is solved, achieving efficient and low-energy-consumption solutions to SAT problems.
Patent Information
- Application Number
- CN202410573956.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-09
- Publication Date
- 2025-11-11
AI Technical Summary
Existing technologies struggle to efficiently solve large-scale Boolean satisfiability problems (SAT problems). Traditional electronic processors are inefficient, and optoelectronic hybrid computing systems have not yet been widely applied to solving complex scenarios or other NP problems, especially SAT problems.
Combining traditional random walk algorithms with optical computing, the Boolean satisfiability problem is solved using a hybrid optoelectronic computing device. Taking advantage of the high parallelism and low energy consumption of the hybrid optoelectronic computing device, optical domain matrix and threshold judge are used for calculation, and noise processing is combined to escape local minima.
It significantly accelerates the solution of the SAT problem, reduces energy consumption, avoids getting trapped in local minima, and improves solution efficiency.
Smart Images

Figure CN120928906A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method and system for solving Boolean satisfiability problems. Background Technology
[0002] In logic and computer science, the Boolean Satisfaction Problem (SAT) is the problem of determining whether there exists an interpretation that satisfies a given Boolean formula. In other words, a formula is considered satisfies if it can be made TRUE by assigning appropriate logical values (i.e., TRUE, FALSE). On the other hand, if no such assignment exists, then for all possible variable assignments, the function represented by the formula is FALSE, and the formula is unsatisfactory.
[0003] The Boolean satisfiability problem (SAT) is a well-known decision problem with significant theoretical research value and high application value in many fields such as operations research, computer science, artificial intelligence, and VLSI design. In particular, SAT solvers are the core underlying engines of many industrial software programs, playing a crucial role in many important industrial applications. However, because the SAT problem is a nondeterministic, polynomial-time (NP) solvable problem, solving it is quite difficult. Currently, SAT solving algorithms fall into two main categories: deterministic algorithms and stochastic search algorithms. The solution time required by deterministic algorithms increases exponentially with the problem size, making them unsuitable for solving large-scale SAT problems. Stochastic search algorithms, primarily based on the idea of local search, employ heuristic strategies to guide the search for a solution to the SAT problem, and can obtain a solution faster than deterministic algorithms when dealing with large-scale satisfiable SAT problems.
[0004] In recent years, based on the development of integrated optics, various optoelectronic hybrid computing systems have been proposed and have demonstrated superior performance compared to traditional electronic processors in machine learning, neural network inference, and solving NP problems. In particular, optical computing methods utilizing optoelectronic hybrid systems to solve the maximum cut NP problem have seen significant development, including spatial light modulation Ising machines, coherent Ising machines, and photonic neural network Ising machines based on cascaded Mach-Zehnder interferometers (MZI). These computing systems fully utilize the advantages of optical parallelism, low latency, and low energy consumption, providing a completely different approach to solving combinatorial optimization problems from classical electronic computing, and have achieved performance exceeding that of classical computers (running specific heuristic algorithms) in solving the maximum cut NP problem. Summary of the Invention
[0005] However, as Moore's Law approaches its limits, the performance of traditional electronic processors, such as CPUs, is difficult to improve further, making the solution efficiency for large-scale and difficult SAT instances in certain scenarios extremely low. Furthermore, current research on optoelectronic hybrid computing systems only demonstrates solutions for simple machine learning tasks such as handwritten digit recognition or specific NP problems like maximum cut, lacking exploration of more complex scenarios or other NP problems. In particular, for the SAT problem, there is still a lack of research on whether optical computing methods can be used to solve it.
[0006] This invention is proposed in view of the above situation, and its purpose is to provide a Boolean satisfiability problem solving method and system that combines the traditional random walk algorithm of SAT problem with optical computing. It is the first to realize a SAT random walk algorithm accelerated by optical computing, which will help to accelerate the solution of large-scale SAT problems.
[0007] Technical solutions to solve technical problems
[0008] To solve the above problems, the method for solving the Boolean satisfiability problem according to the first aspect of the present invention includes the following steps:
[0009] (S1) Extract information from multiple clauses and multiple variables of the Boolean satisfiability problem;
[0010] (S2) Introduce a variable information matrix for recording the position of the variable in the clause and the sign of the variable, and a first vector for recording the length of the clause, and calculate a threshold vector based on the first vector;
[0011] (S3) Based on the variable information matrix and the threshold vector, the optical domain matrix and threshold judge of the optoelectronic hybrid clause state calculation device in the operation unit are respectively set; and
[0012] (S4) The photoelectric hybrid clause state calculation device calculates a second vector representing the state of the clause according to the settings in (S3).
[0013] Further, in step (S4), the spin vector is calculated based on the variable vector composed of multiple variables, and the second vector is calculated multiple times based on the variable information matrix, the spin vector, the threshold vector, and the noise from each channel of the optoelectronic hybrid clause state calculation device, and the average of the multiple calculation results is taken to obtain the average second vector.
[0014] Furthermore, it also includes the following steps:
[0015] (S5) Based on the average second vector, randomly select a clause that does not satisfy the condition;
[0016] (S6) Reverse the value of each variable in the selected non-satisfied clauses in turn, calculate the second vector after each reversal, and select the variable that minimizes the number of non-satisfied clauses based on the second vector after each reversal, and reverse the value of that variable to obtain the updated variable vector;
[0017] (S7) Calculate the updated spin vector based on the updated variable vector, and calculate the updated second vector multiple times based on the variable information matrix, the updated spin vector, the threshold vector, and the noise from each channel of the optoelectronic hybrid clause state calculation device, and average the results of the multiple calculations to obtain the updated average second vector; and
[0018] (S8) Compare the updated number of unsatisfied clauses calculated based on the updated average second vector obtained in (S7) with the number of unsatisfied clauses calculated based on the average second vector obtained in (S4). If the updated number of unsatisfied clauses is smaller than the number of unsatisfied clauses, then set the updated number of unsatisfied clauses as the current optimal number of unsatisfied clauses, set the updated variable vector as the current optimal variable vector, and increment the iteration count by 1.
[0019] Furthermore, it also includes the following steps:
[0020] (S9) If the number of currently optimal unsatisfied clauses is greater than 0 and the number of iterations is less than or equal to the maximum number of iterations, then execute (S5) to (S8) again; if the number of currently optimal unsatisfied clauses is equal to 0 or the number of iterations is greater than the maximum number of iterations, then output the number of currently optimal unsatisfied clauses and the current optimal variable vector.
[0021] Furthermore, the Boolean satisfiability problem is given in the form of conjunctive normal form.
[0022] The Boolean satisfiability problem-solving system according to the second aspect of the present invention includes:
[0023] The preprocessing unit is used to perform the following steps: (S1) extracting information of multiple clauses and multiple variables of the Boolean satisfiability problem; (S2) introducing a variable information matrix for recording the position of the variables in the clauses and the positive and negative signs of the variables, and a first vector for recording the length of the clauses, and calculating a threshold vector based on the first vector.
[0024] The setting unit is configured to perform the following steps: (S3) setting the optical domain matrix and threshold determiner of the optoelectronic hybrid clause state calculation device in the operation unit according to the variable information matrix and the threshold vector; and
[0025] The arithmetic unit is used to perform the following steps: (S4) using the photoelectric hybrid clause state calculation device to calculate a second vector representing the state of the clause according to the settings in (S3).
[0026] Further, in step (S4), the computational unit calculates the spin vector based on the variable vector composed of multiple variables, and calculates the second vector multiple times based on the variable information matrix, the spin vector, the threshold vector, and the noise from each channel of the optoelectronic hybrid clause state calculation device, and averages the results of the multiple calculations to obtain the average second vector.
[0027] Furthermore, the arithmetic unit also performs the following steps:
[0028] (S5) Based on the average second vector, randomly select a clause that does not satisfy the condition;
[0029] (S6) Reverse the value of each variable in the selected non-satisfied clauses in turn, calculate the second vector after each reversal, and select the variable that minimizes the number of non-satisfied clauses based on the second vector after each reversal, and reverse the value of that variable to obtain the updated variable vector;
[0030] (S7) Calculate the updated spin vector based on the updated variable vector, and calculate the updated second vector multiple times based on the variable information matrix, the updated spin vector, the threshold vector, and the noise from each channel of the optoelectronic hybrid clause state calculation device, and average the results of the multiple calculations to obtain the updated average second vector; and
[0031] (S8) Compare the updated number of unsatisfied clauses calculated based on the updated average second vector obtained in (S7) with the number of unsatisfied clauses calculated based on the average second vector obtained in (S4). If the updated number of unsatisfied clauses is smaller than the number of unsatisfied clauses, then set the updated number of unsatisfied clauses as the current optimal number of unsatisfied clauses, set the updated variable vector as the current optimal variable vector, and increment the iteration count by 1.
[0032] Furthermore, the arithmetic unit also performs the following steps:
[0033] (S9) If the number of currently optimal unsatisfied clauses is greater than 0 and the number of iterations is less than or equal to the maximum number of iterations, then execute (S5) to (S8) again; if the number of currently optimal unsatisfied clauses is equal to 0 or the number of iterations is greater than the maximum number of iterations, then output the number of currently optimal unsatisfied clauses and the current optimal variable vector.
[0034] Furthermore, the Boolean satisfiability problem is given in the form of conjunctive normal form.
[0035] Invention Effects
[0036] The Boolean satisfiability problem solving method and system of the present invention solve the SAT problem by using a hybrid optoelectronic computing device to solve the SAT problem. This fully utilizes the advantages of the hybrid optoelectronic computing device in matrix operations, such as high parallelism, low latency, and low energy consumption. Compared with the traditional electronic chip solving method, this accelerates the solution of the SAT problem and significantly reduces energy consumption. Attached Figure Description
[0037] Figure 1 This is a flowchart illustrating an example of a method for solving the Boolean satisfiability problem according to an embodiment of the present invention.
[0038] Figure 2 This is a flowchart illustrating another example of a method for solving the Boolean satisfiability problem according to an embodiment of the present invention.
[0039] Figure 3 This is a schematic block diagram illustrating a Boolean satisfiability problem-solving system according to an embodiment of the present invention.
[0040] Figure 4 This is a schematic diagram illustrating the specific structure of the photoelectric hybrid clause state calculation device of the arithmetic unit in the Boolean satisfiability problem solving system according to an embodiment of the present invention.
[0041] Label Explanation
[0042] A system for solving the Boolean satisfiability problem of 100.
[0043] 1001 Preprocessing Unit
[0044] 1002 Setting Unit
[0045] 1003 arithmetic units
[0046] 3000 Optoelectronic Hybrid Clause State Calculation Device
[0047] 3001 Spin Arithmetic Unit
[0048] 3002 Optical Domain Matrix
[0049] 3003 Threshold Analyzer Detailed Implementation
[0050] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are implemented based on the technical solution of the present invention, providing detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0051] For ease of description, spatial relative terms such as “below,” “under,” “down,” “above,” “up,” etc., may be used herein to describe the relationship of one element or feature relative to another element or feature as shown in the figure. It should be understood that spatial relative terms are intended to include different orientations of the device used or operated in addition to those shown in the figure. For example, if the device in the figure were flipped, an element described as “below” or “under” other elements or features would be oriented as “above” other elements or features.
[0052] Unless otherwise specified, the terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. Terms should be understood to have the meaning consistent with their meaning in the context of the relevant art and should not be interpreted in an idealized or overly formalized manner, unless explicitly stated otherwise herein.
[0053] <Methods for solving Boolean satisfiability problems>
[0054] An example of the Boolean satisfiability problem-solving method involved in the embodiments of the present invention includes the following steps:
[0055] (S1) Extract information from multiple clauses and multiple variables of the Boolean satisfiability problem;
[0056] (S2) Introduce a variable information matrix for recording the position of the variable in the clause and the sign of the variable, and a first vector for recording the length of the clause, and calculate a threshold vector based on the first vector;
[0057] (S3) Based on the variable information matrix and the threshold vector, the optical domain matrix and threshold judge of the optoelectronic hybrid clause state calculation device in the operation unit are set respectively; and
[0058] (S4) The photoelectric hybrid clause state calculation device calculates a second vector representing the state of the clause according to the settings in (S3).
[0059] Preferably, in step (S4), the spin vector is calculated based on the variable vector composed of multiple variables, and the second vector is calculated multiple times based on the variable information matrix, the spin vector, the threshold vector, and the noise from each channel of the optoelectronic hybrid clause state calculation device, and the average of the multiple calculation results is taken to obtain the average second vector.
[0060] Figure 1 This is a flowchart illustrating an example of a method for solving the Boolean satisfiability problem according to an embodiment of the present invention. Below, refer to... Figure 1 The flowchart of an example of a method for solving the Boolean satisfiability problem according to an embodiment of the present invention is described in detail.
[0061] like Figure 1 As shown, firstly, in step ST11, the number of binary logical variables n and the number of clauses m contained in the SAT problem to be solved are obtained and given in the form of Conjunctive Normal Form (CNF). Next, a detailed explanation will be given using the CNF represented by Equation 1 below as an example. However, Equation 1 is merely an example to more clearly illustrate the technical solution of the present invention, and the scope of protection of the present invention is not limited thereto.
[0062]
[0063] According to the CNF above, this SAT problem contains four binary logic variables (x1, x2, x3, x4, each with a value of 0 or 1) and four clauses, where variable x... i negation of variables This is called a literal, and each clause represents the disjunction of the literal, denoted by C, such as C = (x1 ∨ x2), where the symbol “∨” represents the logical OR operation and “∧” represents the logical AND operation. Here, step ST11 corresponds to step (S1) mentioned above.
[0064] Then, in step ST12, a matrix M is introduced to record the text positions and their positive and negative signs, based on the CNF of the SAT problem described above. cnf For F(X) in step ST11, M cnf for:
[0065]
[0066] Where matrix M cnf Each line represents a clause, and a "1" in each line indicates that the position contains a logical variable x. i "-1" indicates that the position has the negation of a logical variable. "0" indicates that no variable appears at that position. In addition, a vector l is introduced to record the clause length. cnf (Corresponding to the first vector mentioned above), for F(X) in step ST11, l cnf for
[0067]
[0068] Among them l cnf The i-th component represents the number of literals contained in the i-th clause of the CNF. According to l cnf A threshold vector T is calculated. For F(X) in step ST11, the threshold vector T is as follows:
[0069]
[0070] Here, step ST12 corresponds to step (S2) described above.
[0071] Then, in step ST13, based on the matrix M obtained in step ST12... cnf The threshold vector T is used to set the optical domain matrix and threshold judge of the optoelectronic hybrid clause state calculation device, thereby obtaining the set optoelectronic hybrid clause state calculation device for solving the SAT problem described later. Here, step ST13 corresponds to step (S3) above.
[0072] Then, in step ST14, the literal variable vector X is initialized, the spin vector σ = 2X - 1 is calculated, and the initial vector G (corresponding to the second vector mentioned above) is calculated using the photoelectric hybrid clause state calculation device. For F(X) in step ST11, we can obtain:
[0073]
[0074] Where sign() is the sign function, and S PIC =M cnf σ is the result of the optical domain matrix calculation, noise i Let G represent the noise from the circuitry of the optoelectronic hybrid clause state calculation device in the i-th channel. The noise in each channel can be approximated as Gaussian noise N(0,s) with a mean of 0 and a standard deviation of s. To ensure the accuracy of the G value calculation, G needs to be averaged multiple times to eliminate the influence of noise. Generally, the number of averaging calculations N_avg = 10, but this invention is not limited to this. Each component in G corresponds to the state of a clause. Wherein, G... i When = 1, the corresponding clause C i Satisfy; G i When = 0, the corresponding clause C iThe condition is not met. The initial number of unsatisfied clauses can be calculated from vector G as unsat = m - sum(G). The initial number of unsatisfied clauses unsat is calculated from G, and the current optimal number of unsatisfied clauses Best_unsat = unsat, the current optimal variable Best_x = X, and the iteration count t = 0. Here, step ST14 corresponds to step (S4) above.
[0075] Furthermore, another example of the Boolean satisfiability problem-solving method involved in the embodiments of the present invention includes the following steps:
[0076] (S5) Based on the average second vector, randomly select a clause that does not satisfy the condition;
[0077] (S6) Reverse the value of each variable in the selected non-satisfied clauses in turn, calculate the second vector after each reversal, and select the variable that minimizes the number of non-satisfied clauses based on the second vector after each reversal, and reverse the value of that variable to obtain the updated variable vector;
[0078] (S7) Calculate the updated spin vector based on the updated variable vector, and calculate the updated second vector multiple times based on the variable information matrix, the updated spin vector, the threshold vector, and the noise from each channel of the optoelectronic hybrid clause state calculation device, and average the results of the multiple calculations to obtain the updated average second vector; and
[0079] (S8) Compare the updated number of unsatisfied clauses calculated based on the updated average second vector obtained in (S7) with the number of unsatisfied clauses calculated based on the average second vector obtained in (S4). If the updated number of unsatisfied clauses is smaller than the number of unsatisfied clauses, then set the updated number of unsatisfied clauses as the current optimal number of unsatisfied clauses, set the updated variable vector as the current optimal variable vector, and increment the iteration count by 1.
[0080] Figure 2 This is a flowchart illustrating another example of a method for solving the Boolean satisfiability problem according to an embodiment of the present invention. Below, refer to... Figure 2 The flowchart of another example of the Boolean satisfiability problem-solving method involved in the embodiments of the present invention will be described in detail.
[0081] because Figure 2 The specific contents of steps ST11a to ST14a are as follows: Figure 1 The steps ST11 to ST14 are similar, so repeated explanations are omitted. The following mainly focuses on the detailed explanation of steps ST15a to ST20a.
[0082] like Figure 2 As shown, in step ST15a, the set of clauses {C} that do not satisfy G is selected. unsat}, and from set {C unsat Randomly select a clause C from} unsat-i Here, step ST15a corresponds to step (S5) described above.
[0083] Then, in step ST16a, C is flipped sequentially. unsat-i The value of each variable x in i-j This yields a new variable vector X', and the spin vector σ' = 2X'-1 after each variable is flipped is calculated. Then, the matrix-vector product S' is calculated based on the optical domain matrix. PIC =M cnf σ', then calculate the vector G' after flipping each variable sequentially. For F(X) in step ST11, the vector G' after flipping, for example, the first spin, is σ'.
[0084]
[0085] Select the spin variable x that minimizes the number of unsatisfied clauses according to G'. i-j The variable vector X is then flipped, and the iteration count t is incremented by 1. Furthermore, the inventors of this invention discovered that without noise, the number of unsatisfied clauses might remain unchanged (i.e., the reduction in the number of unsatisfied clauses is trapped at a local minimum), while the noise here can actually help the algorithm escape local minima. Therefore, averaging is not necessary in this step. Step ST16a here corresponds to step (S6) described above.
[0086] Then, the updated number of non-satisfied clauses is calculated based on the updated variable vector X. Specifically, the updated spin vector σ = 2X - 1 is calculated, and the matrix-vector product S is calculated based on the optical domain matrix. PIC =M cnf σ, then calculate the vector G = sign(S) PIC Similar to step ST14 above, to ensure the accuracy of the G value calculation, G needs to be averaged multiple times to eliminate the influence of noise. Generally, the number of average calculations N_avg = 10, but this invention is not limited to this. Then, the updated number of unsatisfied clauses unsat = m - sum(G) is calculated based on the value of G. Here, step ST17a corresponds to step (S7) above.
[0087] Then, in step ST18a, the optimal number of unsatisfied clauses, Best_unsat, is updated. Specifically, the previously recorded optimal number of unsatisfied clauses, Best_unsat, is compared with the current number of unsatisfied clauses, unsat. If Best_unsat > unsat, then Best_unsat = unsat and Best_x = X; otherwise, Best_unsat and Best_x remain unchanged. Here, step ST18a corresponds to step (S8) described above.
[0088] Furthermore, another example of the Boolean satisfiability problem-solving method involved in the embodiments of the present invention may also include the following steps:
[0089] (S9) If the number of currently optimal unsatisfied clauses is greater than 0 and the number of iterations is less than or equal to the maximum number of iterations, then execute (S5) to (S8) again; if the number of currently optimal unsatisfied clauses is equal to 0 or the number of iterations is greater than the maximum number of iterations, then output the number of currently optimal unsatisfied clauses and the current optimal variable vector.
[0090] Specifically, in Figure 2 In step ST19a, for clauses where the number of clauses unsat = 0 or the number of iterations t > N, max The condition is checked to determine if the condition is true. If the condition is not met, the number of clauses is greater than 0 and the number of iterations has not reached the total number of iterations N. max If the condition is met, return to step ST15a and execute steps ST15a to ST18a again. Otherwise, proceed to step ST20a, where the optimal variable Best_x and the optimal number of unsatisfied clauses Best_unsat are given, and the program ends. Furthermore, as an example, the total number of iterations N... max For example, around 10,000 times, but the present invention is not limited to this. Here, steps ST19a and ST20a correspond to step (S9) described above.
[0091] Therefore, the Boolean satisfiability problem solving method of the present invention, by using a hybrid optoelectronic computing device to solve the SAT problem, can make full use of the advantages of the hybrid optoelectronic computing device in matrix operations, such as high parallelism, low latency, and low energy consumption. Compared with the traditional electronic chip solving method, it can accelerate the solution of the SAT problem and significantly reduce energy consumption.
[0092] Furthermore, in the Boolean satisfiability problem-solving method of the present invention, when selecting the spin variable that minimizes the number of unsatisfied clauses (i.e., minimizes the number of unsatisfied clauses), the noise of the optoelectronic hybrid computing device itself is utilized to prevent the reduction in the number of unsatisfied clauses from being trapped at a local minimum, thus enabling the escape from local minimums.
[0093]
[0094] Figure 3 This is a schematic block diagram illustrating a system for solving the Boolean satisfiability problem according to an embodiment of the present invention. Below, referring to... Figure 3 The specific structure of the Boolean satisfiability problem solving system involved in the embodiments of the present invention will be described in detail.
[0095] The Boolean satisfiability problem solving system involved in the embodiments of the present invention includes:
[0096] The preprocessing unit 1001 is used to perform the following steps: (S1) extracting information of multiple clauses and multiple variables of the Boolean satisfiability problem; (S2) introducing a variable information matrix for recording the position of the variables in the clauses and the positive and negative signs of the variables, and a first vector for recording the length of the clauses, and calculating a threshold vector based on the first vector.
[0097] Setting unit 1002 is used to perform the following steps: (S3) setting the optical domain matrix and threshold judge of the photoelectric hybrid clause state calculation device in the operation unit according to the variable information matrix and the threshold vector; and
[0098] The arithmetic unit 1003 is used to perform the following steps: (S4) using the photoelectric hybrid clause state calculation device to calculate a second vector representing the state of the clause according to the settings in (S3).
[0099] Preferably, in step (S4), the operation unit 1003 calculates the spin vector based on the variable vector composed of multiple variables, and calculates the second vector multiple times based on the variable information matrix, the spin vector, the threshold vector, and the noise from each channel of the optoelectronic hybrid clause state calculation device, and averages the results of the multiple calculations to obtain the average second vector.
[0100] Preferably, the arithmetic unit 1003 further performs the following steps:
[0101] (S5) Based on the average second vector, randomly select a clause that does not satisfy the condition;
[0102] (S6) Reverse the value of each variable in the selected non-satisfied clauses in turn, calculate the second vector after each reversal, and select the variable that minimizes the number of non-satisfied clauses based on the second vector after each reversal, and reverse the value of that variable to obtain the updated variable vector;
[0103] (S7) Calculate the updated spin vector based on the updated variable vector, and calculate the updated second vector multiple times based on the variable information matrix, the updated spin vector, the threshold vector, and the noise from each channel of the optoelectronic hybrid clause state calculation device, and average the results of the multiple calculations to obtain the updated average second vector; and
[0104] (S8) Compare the updated number of unsatisfied clauses calculated based on the updated average second vector obtained in (S7) with the number of unsatisfied clauses calculated based on the average second vector obtained in (S4). If the updated number of unsatisfied clauses is smaller than the number of unsatisfied clauses, then set the updated number of unsatisfied clauses as the current optimal number of unsatisfied clauses, set the updated variable vector as the current optimal variable vector, and increment the iteration count by 1.
[0105] Preferably, the arithmetic unit 1003 further performs the following steps:
[0106] (S9) If the number of currently optimal unsatisfied clauses is greater than 0 and the number of iterations is less than or equal to the maximum number of iterations, then execute (S5) to (S8) again; if the number of currently optimal unsatisfied clauses is equal to 0 or the number of iterations is greater than the maximum number of iterations, then output the number of currently optimal unsatisfied clauses and the current optimal variable vector.
[0107] Figure 4 This is a schematic diagram illustrating the specific structure of the photoelectric hybrid clause state calculation device of the arithmetic unit in the Boolean satisfiability problem solving system according to an embodiment of the present invention.
[0108] like Figure 4 As shown, the arithmetic unit 1003 includes a photoelectric hybrid clause state calculation device 3000, which includes a spin arithmetic unit 3001, an optical domain matrix unit 3002, and a threshold judge 3003.
[0109] Among them, the spin arithmetic unit 3001 calculates the spin σ = 2X⁻¹ based on the input variable vector X. The optical domain matrix unit 3002 calculates the spin based on the set matrix M. cnf And the spin vector σ, perform the following matrix calculation: S PIC =M cnf σ, thus obtaining vector S PIC Threshold judgment unit 3003 determines the threshold based on vector S. PIC The set threshold vector T and noise vector are used to obtain vector G through the sign() function, and then output.
[0110] Therefore, the Boolean satisfiability problem solving system according to the present invention, by using a hybrid optoelectronic computing device to solve the SAT problem, can fully utilize the advantages of the hybrid optoelectronic computing device in matrix operations, such as high parallelism, low latency, and low energy consumption. Compared with the traditional electronic chip solving method, it can accelerate the solution of the SAT problem and significantly reduce energy consumption.
[0111] Furthermore, in the Boolean satisfiability problem solving system of the present invention, when selecting the spin variable that reduces the number of unsatisfied clauses the most (i.e., minimizes the number of unsatisfied clauses), the noise of the optoelectronic hybrid computing device itself is utilized to prevent the reduction in the number of unsatisfied clauses from being trapped at a local minimum, thus enabling the escape from local minimums.
[0112] It should be understood that the above description is illustrative and not restrictive. For example, the above embodiments (and / or aspects thereof) can be used in combination with each other. Furthermore, many modifications can be made to adapt particular conditions or materials to the teachings of the various embodiments of the invention without departing from the scope of the invention. While the dimensions and types of materials described herein are used to define parameters of the various embodiments of the invention, the embodiments are not intended to be restrictive but are exemplary. Many other embodiments will become apparent to those skilled in the art upon reading the above description. Therefore, the scope of the various embodiments of the invention should be determined by reference to the appended claims and the full scope of their equivalents.
[0113] Industrial practicality
[0114] The Boolean satisfiability problem-solving method and system of the present invention can be applied to solving Boolean satisfiability problems in many fields such as operations research, computer science, artificial intelligence, and very large-scale integrated circuit design.
Claims
1. A method for solving the Boolean satisfiability problem, characterized in that, Includes the following steps: (S1) Extract information from multiple clauses and multiple variables of the Boolean satisfiability problem; (S2) Introduce a variable information matrix for recording the position of the variable in the clause and the sign of the variable, and a first vector for recording the length of the clause, and calculate a threshold vector based on the first vector; (S3) Based on the variable information matrix and the threshold vector, the optical domain matrix and threshold judge of the optoelectronic hybrid clause state calculation device in the operation unit are set respectively; as well as (S4) The photoelectric hybrid clause state calculation device calculates a second vector representing the state of the clause according to the settings in (S3).
2. The method for solving the Boolean satisfiability problem according to claim 1, characterized in that, In step (S4), a spin vector is calculated based on a variable vector consisting of multiple variables, and the second vector is calculated multiple times based on the variable information matrix, the spin vector, the threshold vector, and the noise from each channel of the optoelectronic hybrid clause state calculation device, and the average of the multiple calculation results is taken to obtain an average second vector.
3. The method for solving the Boolean satisfiability problem according to claim 2, characterized in that, It also includes the following steps: (S5) Based on the average second vector, randomly select a clause that does not satisfy the condition; (S6) Reverse the value of each variable in the selected non-satisfied clauses in turn, calculate the second vector after each reversal, and select the variable that minimizes the number of non-satisfied clauses based on the second vector after each reversal, and reverse the value of that variable to obtain the updated variable vector; (S7) Calculate the updated spin vector based on the updated variable vector, and calculate the updated second vector multiple times based on the variable information matrix, the updated spin vector, the threshold vector, and the noise from each channel of the optoelectronic hybrid clause state calculation device, and average the results of the multiple calculations to obtain the updated average second vector. as well as (S8) Compare the updated number of unsatisfied clauses calculated based on the updated average second vector obtained in (S7) with the number of unsatisfied clauses calculated based on the average second vector obtained in (S4). If the updated number of unsatisfied clauses is smaller than the number of unsatisfied clauses, then set the updated number of unsatisfied clauses as the current optimal number of unsatisfied clauses, set the updated variable vector as the current optimal variable vector, and increment the iteration count by 1.
4. The method for solving the Boolean satisfiability problem according to claim 3, characterized in that, It also includes the following steps: (S9) If the number of currently optimal unsatisfied clauses is greater than 0 and the number of iterations is less than or equal to the maximum number of iterations, then execute (S5) to (S8) again; if the number of currently optimal unsatisfied clauses is equal to 0 or the number of iterations is greater than the maximum number of iterations, then output the number of currently optimal unsatisfied clauses and the current optimal variable vector.
5. The method for solving the Boolean satisfiability problem according to any one of claims 1 to 4, characterized in that, The Boolean satisfiability problem is given in the form of conjunctive normal form.
6. A system for solving Boolean satisfiability problems, characterized in that, include: The preprocessing unit is used to perform the following steps: (S1) extracting information of multiple clauses and multiple variables of the Boolean satisfiability problem; (S2) introducing a variable information matrix for recording the position of the variables in the clauses and the positive and negative signs of the variables, and a first vector for recording the length of the clauses, and calculating a threshold vector based on the first vector. The setting unit is used to perform the following steps: (S3) setting the optical domain matrix and threshold judge of the photoelectric hybrid clause state calculation device in the operation unit according to the variable information matrix and the threshold vector; as well as The arithmetic unit is used to perform the following steps: (S4) using the photoelectric hybrid clause state calculation device to calculate a second vector representing the state of the clause according to the settings in (S3).
7. The Boolean satisfiability problem-solving system according to claim 6, characterized in that, In step (S4), the computational unit calculates the spin vector based on a variable vector composed of multiple variables, and calculates the second vector multiple times based on the variable information matrix, the spin vector, the threshold vector, and the noise from each channel of the optoelectronic hybrid clause state calculation device, and averages the results of the multiple calculations to obtain an average second vector.
8. The Boolean satisfiability problem-solving system according to claim 7, characterized in that, The arithmetic unit also performs the following steps: (S5) Based on the average second vector, randomly select a clause that does not satisfy the condition; (S6) Reverse the value of each variable in the selected non-satisfied clauses in turn, calculate the second vector after each reversal, and select the variable that minimizes the number of non-satisfied clauses based on the second vector after each reversal, and reverse the value of that variable to obtain the updated variable vector; (S7) Calculate the updated spin vector based on the updated variable vector, and calculate the updated second vector multiple times based on the variable information matrix, the updated spin vector, the threshold vector, and the noise from each channel of the optoelectronic hybrid clause state calculation device, and average the results of the multiple calculations to obtain the updated average second vector. as well as (S8) Compare the updated number of unsatisfied clauses calculated based on the updated average second vector obtained in (S7) with the number of unsatisfied clauses calculated based on the average second vector obtained in (S4). If the updated number of unsatisfied clauses is smaller than the number of unsatisfied clauses, then set the updated number of unsatisfied clauses as the current optimal number of unsatisfied clauses, set the updated variable vector as the current optimal variable vector, and increment the iteration count by 1.
9. The Boolean satisfiability problem solving system according to claim 8, characterized in that, The arithmetic unit also performs the following steps: (S9) If the number of currently optimal unsatisfied clauses is greater than 0 and the number of iterations is less than or equal to the maximum number of iterations, then execute (S5) to (S8) again; if the number of currently optimal unsatisfied clauses is equal to 0 or the number of iterations is greater than the maximum number of iterations, then output the number of currently optimal unsatisfied clauses and the current optimal variable vector.
10. The system for solving the Boolean satisfiability problem according to any one of claims 6 to 9, characterized in that, The Boolean satisfiability problem is given in the form of conjunctive normal form.