Weighted part maximum satisfiability problem solving method based on parallel gradient descent
By employing a clause error term-global error function-parallel backpropagation gradient descent method in WPMS solving, the problems of high computational complexity and poor parallelism in existing technologies are solved, achieving efficient and stable WPMS solving, especially with excellent performance in large-scale instances.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHANGSHA UNIVERSITY OF SCIENCE AND TECHNOLOGY
- Filing Date
- 2026-01-07
- Publication Date
- 2026-04-17
AI Technical Summary
Existing WPMS/MaxSAT solving techniques face significant computational and storage challenges in large-scale instances. Graph modeling and offline training lead to computational complexity, making it difficult to fully utilize global information and perform clause-level parallel optimization.
We employ a clause error term-global error function-parallel backpropagation gradient descent method, which directly utilizes gradient information in a continuous space, reduces the search space through unit propagation, adaptively selects activation functions and learning rates, and combines three layers of weight management and periodic reset to achieve efficient parallel solution.
It achieves efficient and stable WPMS solving, reduces computational complexity, and improves the solving efficiency and solution quality of large-scale instances, especially performing well when the proportion of long clauses is high or the weight span is large.
Smart Images

Figure CN121882297A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to intelligent solutions for Boolean satisfiability and its optimization extensions, belonging to the interdisciplinary fields of combinatorial optimization, constrained optimization, and differentiable optimization. Specifically, it relates to a solution method for the Weighted Partial MaxSAT (WPMS) problem based on parallel gradient descent. Background Technology
[0002] MaxSAT is an important optimization extension of SAT; when clauses cannot be fully satisfied, the objective becomes maximizing the number of satisfied clauses (unweighted) or maximizing the sum of the weights of satisfied soft clauses (weighted). WPMS further divides clauses into hard clauses that must be satisfied and soft clauses that should be satisfied as much as possible, and assigns weights to soft clauses. The goal is to minimize the sum of the weights of unsatisfied soft clauses while satisfying all hard clauses.
[0003] There are two main paths for existing WPMS / MaxSAT solving techniques: (1) Stochastic Local Search (SLS) and its variants: Iterative improvement in discrete space by variable flipping, supplemented by perturbation / restart to escape local optima. This type of method is simple to implement, but it often suffers from unstable convergence, easy to get trapped in local optima, and difficulty in systematically utilizing global information for instances with large weight spans and complex structures. (2) Neural solving / neural guidance based on graph neural networks (GNN): For example, NeuroSAT encodes CNF into a “text-clause” bipartite graph and performs message passing to predict satisfiability and decode solutions; NeuroCore further adopts the “periodic refocusing” method to reset the activity of traditional solvers with the probability of unsat-core variables predicted by the network, thereby improving the performance of CDCL solvers; Graph-Q-SAT and other works use graph networks + reinforcement learning to learn branch strategies; G4SATBench proposes a system benchmark and points out that existing GNNs are more likely to learn strategies similar to greedy local search, but are difficult to learn backtracking search in space.
[0004] The aforementioned GNN paths typically require transforming the problem into a graph structure of nodes and edges and performing multiple rounds of message passing. They often rely on offline training, iterative overhead during inference, and integration strategies with traditional solvers. As the instance size increases, graph construction, message passing, and frequent full-graph feature updates impose significant computational / storage pressures, and the coupling between nodes makes simple clause-level parallelism difficult to fully leverage. Therefore, there is an urgent need for a WPMS solution scheme that does not require graph modeling and offline training, can systematically utilize gradient information in a continuous space, and naturally supports clause-level parallelism. Summary of the Invention
[0005] This invention aims to provide a WPMS incomplete solver based on "clause error term - global error function - parallel backpropagation gradient descent", which achieves a highly interpretable, parallelizable, numerically stable and robust solution process for complex instances without relying on GNN graph modeling and offline training.
[0006] For the MaxSAT problem, the goal of an incomplete solver is to find a solution that satisfies all hard clauses while satisfying as many soft clauses as possible, or maximizes the total weight of satisfied clauses. Based on this goal, we consider transforming a CNF (Connative Normalized Framework) into a loss function. If a CNF exists where all clauses have a weight of 1... Therefore, the corresponding loss function is: If there exists a solution α such that the clause If the condition is met, meaning that at least one of the three characters is true, then... There must be at least one error term in the clauses that is 0. If there are more clause error terms that are 0, then... The value will also be closer to 0. Ideally, all clauses satisfy this condition. The value is 0. The constructed error function. The closer the value is to 0, the more clauses are satisfied, meaning a better solution α and a smaller cost(α). To achieve this... To reduce the value, this invention uses gradient descent to update the variable's value in the opposite direction of the gradient, causing the function to converge toward a local minimum.
[0007] This invention solves for sets containing hard clauses. With soft clause set WCNF instances for sets of hard clauses The preprocessing steps involve preprocessing unit clauses (containing only a single literal character) to perform unit propagation, directly assigning values to relevant variables to satisfy constraints and updating the data structure. This preprocessing significantly reduces the number of variables and clauses requiring optimization, narrows the search space, and strengthens the effectiveness of hard constraints. After unit propagation, structural information such as the number of variables n, the number of clauses m, and the number of long clauses count_long_clauses (greater than 2) is collected, and several complexity metrics are calculated based on this information, including...
[0008] Problem size:
[0009]
[0010] Constrained density:
[0011]
[0012] And the proportion of long clauses:
[0013]
[0014] Based on this, a comprehensive complexity score is generated:
[0015]
[0016] This score is then used to adaptively select key parameters such as the activation function type (sigmoid or normalized softsign) and the learning rate growth factor *inc*. The activation function is defined as follows:
[0017]
[0018]
[0019]
[0020] Since the value of the activation function can easily tend to 1 or 0, i.e., reach saturation, sigmoid is chosen for low-complexity instances to allow the variables to enter the saturation region more quickly, thus stabilizing convergence. Normalized softsign can be used for medium- to high-complexity instances to slow down gradient decay, alleviate gradient vanishing, and maintain more thorough exploration. For the learning rate growth factor inc, the higher the complexity, the longer the time for a single gradient calculation. To improve the optimization progress per unit time, inc can be set larger to accelerate convergence.
[0021] In the optimization process based on gradient descent, if the original variables are used directly... Gradient calculation and updating become difficult because the form of the error function can lead to large gradients or non-smooth convergence. During the modeling phase, this invention uses each Boolean variable... Corresponding to a continuous variable Through activation function Define its relaxed value:
[0022]
[0023] A threshold rule is applied at the end of the solution process:
[0024]
[0025] The continuous solution is discretized into Boolean assignments, achieving a mapping from the continuous space back to the original WPMS solution space. At the clause level, this invention performs a process for each character... The term function is defined by polarity.
[0026] For the main text :
[0027]
[0028] For negative text :
[0029]
[0030] Note clauses The set of characters in the text is Then the clause error term is defined as:
[0031]
[0032] Further construct the overall error function:
[0033]
[0034] When clause c contains a certain literal that gradually tends to satisfy (i.e., correspondence) When it is close to 0, Approaching 0; when all literals within the clause tend to not satisfy (each When it is close to 1), Approaching 1. Therefore... It forms a smooth approximation of the discrete objective, used to provide a descent direction in the continuous space; its descent trend tends to reduce the weights of unsatisfied soft clauses under thresholding assignment.
[0035] Unlike random initialization, to obtain a good starting point, this invention determines the biased Boolean initial value of each variable by counting the number of times each variable appears in positive and negative text: if a variable If a positive literal appears at least as many times as a negative literal, it tends to be assigned a value. Conversely, tending to assign values Based on this, the corresponding Initialize to a positive or negative center value This allows the activation function output to naturally fall near the threshold of 0.5, which is beneficial for the continuous optimization phase to quickly evolve towards a structurally better assignment, reducing the number of iterations required to start from a completely random starting point and improving the convergence quality.
[0036] In terms of weight management, this invention applies to each clause. Maintain three types of weights: original weights Initialize weights With current weight .in, Read from the input instance and remain unchanged during algorithm execution for accurate calculation of the weights of unsatisfied soft clauses; Depend on Numerical scaling and hard / soft clause differentiation rules are used to avoid gradient saturation caused by excessive weights. This is used for gradient calculation and error function construction, and is enhanced after each iteration based on whether the clauses are unsatisfied. Considering that adjusting weights solely based on the unsatisfied conditions of the current iteration can easily lead to the algorithm being pulled back and forth between different clauses, neglecting clauses that are difficult to satisfy in the long term, thus getting stuck in local optima or remaining near certain undesirable solutions for a long time, this invention accumulates the unsatisfied information from the last five iterations and applies stronger weight penalties to clauses that are unsatisfied for five consecutive iterations when updating weights. This adaptively amplifies the influence of these stubborn clauses on the overall error function, guiding the gradient optimization process to focus more on fixing truly difficult constraints, thereby achieving a lower sum of unsatisfied soft clause weights under the same time budget. After each iteration, the algorithm calculates the average weight (avgw) of all current clauses. When avgw exceeds a threshold... At that time, perform a smooth update on all clauses:
[0037]
[0038] And update the smoothing benchmark to This is to suppress excessive weight divergence and avoid numerical instability and excessive bias towards a few clauses. Furthermore, this invention introduces a periodic reset mechanism: after each preset `resetInterval` iteration, all current weights are reset. Reset to initial weights This avoids the imbalance in weight distribution caused by long-term accumulation, maintains the algorithm's ability to continuously explore new solution space regions, and prevents it from falling into a fixed search stage dominated by historical weights.
[0039] During the continuous optimization phase, this invention is based on the aforementioned error function. For each intermediate variable Calculate the gradient using the chain rule. For a given variable... The error function is about The partial derivative is:
[0040]
[0041] in Dependency clause The product structure of each term within the clause is used in this invention to calculate the partial derivative contributions of all clauses to each variable in O(L) time complexity through forward-backward multiplication (equivalent to dynamic programming). This represents the total number of characters in the formula. The gradient is determined by the chosen activation function (sigmoid or normalized softsign). After obtaining the global gradient vector, the current learning rate is used. Perform gradient descent update:
[0042]
[0043] The method iteratively approaches the local or global minimum, thereby gradually reducing the weights of unsatisfied soft clauses. After each iteration, the invention thresholds the continuous solutions using formula (9) to obtain the current Boolean solution, and utilizes the original weights. The weights of unsatisfied soft clauses under this assignment are precisely calculated and compared with the historical best solution and its cost. If the latter is better, the global best solution is updated.
[0044] Under clause product-type error functions, the optimization process may experience oscillations or plateaus. If the learning rate is fixed, oscillations are likely to occur in regions with large gradients, or the process may linger in regions with small gradients. Therefore, this invention employs an adaptive scheduling strategy for the learning rate: when the current round error... Greater than the previous round If an oscillation or update in the wrong direction occurs, the algorithm reverts to the previous round of continuous assignment and reduces the learning rate to [a certain value]. To reduce the step size and achieve stable convergence; when Less than the preset tolerance Furthermore, when the plateau count exceeds a threshold, the algorithm is deemed to be stuck in the plateau region, and the learning rate is increased accordingly. To attempt to break out of the platform; when the error steadily decreases with iteration, then execute according to the growth factor inc corresponding to the complexity score. This accelerates convergence while ensuring stability. The three scenarios described above together constitute a learning rate adaptive scheduling mechanism for different error evolution patterns.
[0045] In the gradient descent solution process of this invention, to avoid continuing ineffective iterations, wasting time budget, and introducing numerical oscillations during gradient vanishing / saturation or plateau states, this invention sets an adaptive termination mechanism in each iteration of gradient descent: when the gradient norm is consistently less than the threshold 1e-6, it means that the continuous variable... The stationary region of the error function has been reached, and the plateau period means that the error function... If the number of variables stops decreasing after multiple iterations, it indicates that the current search direction is difficult to improve further. If more than 90% of the variables are saturated, it means that the activation output of most variables is close to the 0 / 1 boundary, and the variable partial derivatives tend to 0. At this point, continuing the iteration will result in a decrease in the variable update amount. Minimal error function As the gradient decreases towards zero, continuing to calculate and update the gradient incurs significant computational overhead but yields almost no gain in solution quality. Therefore, this termination mechanism is used to exit the current gradient descent phase early when convergence or saturation conditions are met, and return to the outer process to perform weight updates, resets, or the next round of search, thereby increasing the probability of obtaining a better solution per unit time.
[0046] For large-scale instances, this invention leverages the independence of clause error terms and their gradient contributions along the clause dimension to divide the clause set into multiple subsets. The local gradients of each subset are computed in parallel on a multi-core CPU, and then aggregated into a global gradient vector through a reduction operation. Because each clause... The computation depends only on the text within the clause, and the error calculation between different clauses can be regarded as independent. The parallelization implementation of this invention has natural clause-level parallelism. Compared with the graph neural network (GNN) method, which requires multiple rounds of message passing on a large-scale graph structure, the computation is simpler, the data dependency is weaker, and it is easier to achieve a near-linear speedup in a real multi-core hardware environment.
[0047] Beneficial effects
[0048] (1) Clause-level natural parallelism: The error terms and gradient contributions of each clause are independent of each other, and the gradients can be computed in parallel on a multi-core CPU and accelerated by reduction and aggregation;
[0049] (2) Unlike GNN’s direct clause modeling: it does not require converting CNF into a graph structure of points and edges, nor does it rely on offline training and message passing inference; it directly constructs a differentiable error function with clauses as basic units, and uses the backpropagation chain rule for online optimization, making the target more interpretable;
[0050] (3) Stabilization mechanism oriented towards weights and hard constraints: three-layer weights ( Management, weight scaling and smoothing, and periodic reset are implemented to avoid gradient saturation / vanishing caused by weight spans.
[0051] (4) Complexity-driven adaptation: Automatically select activation functions and parameters based on instance size, density, and the proportion of long clauses to reduce the cost of manual parameter tuning;
[0052] (5) Robustness to oscillations and plateaus: Learning rate rollback, plateau escape and saturation judgment strategies improve convergence efficiency;
[0053] (6) Experimental results: On several public benchmark instances, under the same time constraints, the cost of some instance solutions obtained by this method is better than that of the representative weighted local search solver NUWLS; this phenomenon is more obvious on large-scale instances with large weight spans or a high proportion of long clauses. Attached Figure Description
[0054] To more clearly illustrate the technical solution of this invention, the following figures are provided:
[0055] Figure 1 : Flowchart of the "WPMS Solution Method Based on Parallel Gradient Descent" of this invention Detailed Implementation
[0056] Let CNF formula F be composed of the set of clauses. Composition, the set of variables is WPMS divides clauses into sets of hard clauses. With soft clause set Soft clause With positive integer weights The goal is to minimize the weight and cost(α) of unsatisfied soft clauses, while satisfying all hard clauses.
[0057] Step S1: Instance Reading and Classification. Read in the (W)PMS instance to obtain the hard clause set. soft clause set and the original weight of soft clauses Count the number of variables (n) and clauses (m). Perform unit propagation on hard unit clauses to determine the values of some variables, construct a new instance, which will have fewer variables and clauses than the original instance. Then, count the number of variables again. and Structural features such as total word count L and number of long clauses.
[0058] Step S2: Calculate problem_scale, clause_to_var_ratio, and long_clause_ratio to form complexity_score; select the activation function accordingly. It also sets parameters such as inc, resetInterval, w_inc, and coe. Furthermore, it initializes clause weights based on the original weights: for unweighted instances (problem_weighted == 0), soft clause weights are all 1, and hard clause weights are... Increment the number of soft clauses by 1; if the weight of hard clauses is greater than 100 at this point, find the smallest integer a such that... At this point, the weight of the hard clause is updated to... For a weighted instance (problem_weighted == 1), calculate the original average soft clause weight, letting S be the set of all soft clauses: the original average soft clause weight. , Find the smallest positive integer a such that is the number of soft clauses. Define scaling factor For any soft clause c: Then the initial weight of the maximum soft clause is obtained. For any hard clause c: .
[0059] Step S3: Generate initial values based on the character polarity.
[0060] Step S4: Determine if the running time has reached the time limit. If yes, exit the program and output the cost(α) of the optimal solution; otherwise, continue.
[0061] Step S5: Periodically reset weights; find clauses that are not satisfied by the current solution and add them to a set. Simultaneously, check if any clauses have not been satisfied for five consecutive iterations; store these clauses. Then, update the weights, adding weights to the unsatisfied clauses. At the same time, the stored consecutive unsatisfied clauses are given more weight. When the smooth triggering condition is met, the weights are updated smoothly.
[0062] Step S6: Enter gradient descent iteration. In each iteration, first update the optimal solution, and then calculate the current total error. and gradient norm (Using L2 norm). If the following conditions are met in 50 consecutive iterations: If this occurs, early termination is triggered, and the current gradient descent iteration loop exits. Otherwise, the error function value is used as the determining factor. Adjust the learning rate growth parameter `inc` to determine whether the market is in a period of fluctuation, plateau, or normal decline. Also, if... Once the preset number of confirmations is reached, a platform confirmation is recorded. If the number of consecutive platform confirmations reaches 3, the saturation ratio (saturation_ratio) is calculated (statistically satisfied). (the percentage of variables), when If more than 90% of the variables are in the saturation region, then premature termination is triggered, and the current gradient descent iteration loop is exited.
[0063] Step S7: Calculate the gradient of each variable. Using the chain rule: Gradient computation is enabled via the `#pragma ompparallel` directive, which initiates a parallel region. The master thread generates a set of worker threads. The `#pragma omp for schedule(static)` directive statically distributes clauses to different threads in a cyclical manner. For example, with 4 cores and 1000 clauses, each thread processes approximately 250 clauses. Each thread independently computes the gradient contribution of the clauses assigned to it. A separate, local gradient array (`grad_local`) is allocated to each thread using the `grad_thread` two-dimensional array, and each thread only writes data to its own `grad_local`.
[0064] Step S8: Perform efficient calculation For each clause, use the forward product FD and the backward product R (two-pass dynamic programming): first calculate Then the partial derivative with respect to the variable corresponding to the j-th character is... The proportions ensure that the overall gradient calculation time complexity is O(L). The temporary array FD (forward propagation data) used during the calculation is also declared as thread-private FD_local, ensuring that intermediate calculation results are not overwritten by different threads when calculating different clauses. After the parallel region ends (Join phase), the main thread uses a serial loop to accumulate the local gradients grad_local of all threads into the global gradient grad, completing the merging of the final results. Then, the current gradients of each variable are saved, allowing for rollback and re-iteration when oscillations are detected.
[0065] Step S9: Update the variable values. Exit the iteration when the maximum number of iterations is reached, otherwise continue.
[0066] Step S10: After completing one iteration, return to S4.
[0067] To verify the solution performance and robustness of the "Weighted Partial Maximum Satisfactionability (WPMS) Solution Method Based on Parallel Gradient Descent" described in this invention on public benchmarks, WPMS instances from the MaxSAT Evaluation (MSE) 2022–2024 public benchmarks were selected for comparative experiments. MSE is an annual evaluation activity for MaxSAT solvers, continuously organized since 2006. The benchmark set covers MaxSAT / WPMS instances from different sources, with different structural features and different weight ranges, and is representative and publicly reproducible. The experiments were conducted on an Ubuntu 24.04.2 LTS system on an AMD Ryzen™ 9 platform.
[0068] The solver in this invention is named Grad_MaxSAT. The comparison target is the representative Weighted Local Search (SLS) WPMS solver NUWLS, which is highly representative in MSE's anytime / incomplete evaluation scenarios. Benchmark examples are from the MSE 2022–2024 publicly available benchmark collection; a portion of these benchmarks are selected for comparison in the experiment.
[0069] For each instance, the solver outputs a Boolean assignment. Provided that all hard clauses are satisfied, the solution quality is measured by the weight of unsatisfied soft clauses and cost(α) (the smaller the value, the better). For ease of statistics, WIN is defined at the instance level: if the optimal cost obtained by the solver of this invention within the time budget is lower than NUWLS (i.e., ... If both are present, then this instance is denoted as WIN of the present invention; In case of a tie, the result is counted as a win. The time limit is set to 300 seconds. Table 1 shows the statistical results (number of cases and number of wins) on three subsets of the baseline set (total number of instances 161) in MSE 2022–2024.
[0070] Table 1 Comparison of Grad_MaxSAT and NUWLS results on various dataset subsets.
[0071]
[0072] In the selected 161 instances, the solver of this invention satisfies... This achieves 100% coverage. In the selected benchmarks, the solver of this invention achieves lower cost(α) than NUWLS on some instances of the ran.scp.scpnr series and drmx-cryptogen series. The ran.scp.scpnr series instances exhibit a structural characteristic of "extremely large text content in single clauses" (many clauses can exceed 500 characters in length), meaning a high proportion of long clauses and a large total text volume, a scenario where traditional discrete flip-type local search is prone to decreased search efficiency and reduced improvement. This is attributed to the present invention directly constructing each clause as a differentiable clause error term and obtaining the gradient direction in continuous space through the chain rule, enabling the optimization process to continuously obtain usable descent signals under high text volume conditions; adaptive selection of activation functions and learning rate growth factors based on complexity scoring, combined with mechanisms such as oscillation backoff and plateau escape, enhances convergence stability on long clause / high-density instances.
[0073] The above description is merely a partial embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A parallel gradient descent based weighted partial max-satisfiability (WPMS) problem solving method for solving a CNF instance containing a set of hard clauses and a set of soft clauses, the soft clauses having weights, the method characterized by, include: (1) Instance reading and preprocessing: Read the CNF instance and distinguish between hard clauses and soft clauses; Unit propagation is performed on hard unit clauses within hard clauses to fix the values of the corresponding variables, and the clause and text data structures are updated. (2) Complexity-driven parameter adaptation: After unit propagation, the number of variables, clauses, total number of words, number of long clauses or proportion of long clauses are statistically analyzed, and a complexity score is calculated based on the statistical measures; the activation function type is adaptively selected according to the complexity score and parameters including learning rate growth factor, weight increment, weight smoothing threshold coefficient and weight reset interval are set. (3) Continuous relaxation with error function modeling: Introduce a continuous variable for each Boolean variable , get the relaxation value through the selected activation function ; Construct a sub-item function term for each literal according to the polarity, so that each clause is mapped into a differentiable clause error , and the overall error is constructed by weighting and summing each clause error term with the current clause weight w(c) ; (4) Initialization assignment: determine the initial Boolean bias based on the occurrence of each variable in the positive and negative texts, and set the initial value of continuous variable accordingly value; (5) Outer iteration: Executes in a loop until the time budget or stopping condition is not met. (5-1) Identify the set of unsatisfied clauses under the current assignment, and perform enhanced updates on the weights of the current clauses based on the set of unsatisfied clauses; perform weight smoothing and periodic reset as necessary; (5-2) Entering a gradient descent phase, thresholding the current continuous solution to obtain a Boolean assignment , calculating the unsatisfied soft clause weight sum under the Boolean assignment using the original weights, and updating the global optimal solution accordingly; (5-3) Perform several iterative updates on the continuous variable y: calculate the error function. With gradient The learning rate is updated according to the adaptive learning rate scheduling strategy, and gradient descent is performed to update the learning rate. ; When an oscillation or plateau is detected, a rollback or early termination will be executed; (6) Output the Boolean assignment and cost corresponding to the global optimal solution.
2. The method according to claim 1, characterized in that, The sub-function Defined by character polarity: Orthogonal characters of for Negative text of for A clause of length k The clause error term is defined as And when clause c has a certain literal that gradually tends to satisfy (i.e., corresponding to) When it is close to 0, Approaching 0; When all the words in the clause tend to not satisfy (each When it is close to 1), Close to 1.
3. The method according to claim 1, characterized in that, The activation function is either sigmoid or normalized softsign, and its derivative is used in the gradient chain rule, respectively. The derivative of sigmoid is The normalized softsign derivative is .
4. The method according to claim 1, characterized in that, The gradient calculation is performed using a forward-backward product to achieve a time complexity that is linearly related to the total number of words L: the forward prefix product FD and the backward product term R are calculated for each clause, and the gradient contribution of each clause to the variable is accumulated to obtain the global gradient vector.
5. The method according to claim 1, characterized in that, Three types of weights are maintained: original weights for cost calculation, initialized weights for initialization and reset, and current weights for error function construction and gradient calculation. The current weights are updated during outer iterations. Initialized weights include: for unweighted instances, both the original soft clause weight and the initial weight are 1; the initial weight for hard clauses is set to the number of soft clauses plus 1, but if this value is greater than 100, it is scaled down to a value less than 100; for weighted instances, the weights are calculated based on the sum of the soft clause weights, by adjusting the original average soft clause weight. Scaling times, making , As a scaling factor, the initial soft clause weight for each soft clause c. For a hard clause c, the initial weight is the initial weight of the largest soft clause plus 10. The weight enhancement update includes: performing [action] on clauses in the unsatisfied clause set. A stronger weighted penalty is applied to stubborn clauses that are not satisfied for multiple consecutive rounds. This makes its weight increment greater than the weight increment of a normal unsatisfied clause.
6. The method according to claim 5, characterized in that, When the average weight of the current clauses exceeds the threshold, a smooth update is performed on all clause weights. It also updates the smoothing baseline parameters to suppress weight divergence. Simultaneously, it performs periodic resets on all current weights at preset reset intervals, ensuring... Restore to the initial weights.
7. The method according to claim 1, characterized in that, The adaptive learning rate scheduling strategy includes: when the error function value increases compared to the previous round, reverting to the previous round's continuous solution and reducing the learning rate; when the long-term change in the error function is less than the tolerance and the plateau count exceeds the threshold, increasing the learning rate to break out of the plateau; and when the error function steadily decreases, increasing the learning rate by the growth factor.
8. The method according to claim 1, characterized in that, An early termination mechanism is set in the gradient descent phase, which triggers the exit from the current gradient descent phase based on at least one or more of the gradient norm threshold, plateau period count threshold and variable saturation ratio threshold.
9. The method according to claim 1, characterized in that, Variables that have been fixed by unit propagation or other constraints are marked as inactive variables. Inactive variables are skipped during gradient descent updates to reduce computation and maintain consistency of hard constraints.
10. An apparatus for solving a weighted partial maximum satisfiability problem by performing the method of any one of claims 1 to 9, characterized in that, include: The preprocessing module is used for cell propagation and data structure updates of hard cell clauses; The complexity evaluation and parameter configuration module is used to calculate the complexity score and select the activation function and parameters; The modeling module is used to construct the clause error term and the overall error function; The weight management module is used for unsatisfied clause identification, weight enhancement, smoothing, and periodic reset. The parallel computing and reduction module calculates the gradient based on the forward-backward product, calculates the local gradient of each thread in parallel according to the clause dimension, and reduces it to obtain the global gradient. An adaptive learning rate scheduling and backoff module is used for oscillation detection, plateau detection, learning rate adjustment and backoff; The update and output module is used to update continuous variables, threshold them to obtain Boolean solutions, calculate costs, and output the global optimal solution.