r/AskComputerScience • u/Particular_Dig_6495 • Feb 26 '26
3sat "deterministic" solvers remain exponential?
Hello. I am a (french) amateur and uneducated in CompSci, please forgive me for my naïve question.
I spend about a year trying to solve 3 sat problems for fun and found by luck a way to solve
simple problems in a deterministic way (counting variables, applying a rule to each clauses and rectifying the "false/unchecked" clauses by a simple rule) which was very successful with low constraint ratios. Unfortunately not successful with satlib Solvable problems.
I discussed this fact with a probabilistic mathematician friend who explained to me I could imagine "hidden configurations" which made it so my solver would "loop" infinitely.
From what I understand, the more a variable is present in a 3 sat problem, the closest you are from an unsolvable problem, and clauses become more and more interlinked.
I don't have much knowledge in all of this, I feel I understand the logic but I was wondering if there are logic ways to overcome in a determinstic way these hidden loops.
My friend allso told me deterministic algorithms for solving Np-complete problems stay exponential in nature, which I don't really understand.
When I see how my algorithm works, it actually seems to lower the amount of procedures compared to random ( it loops in a smaller amount of variables than random) and so I feel it may not be really exponential. If any one feels to explain to me how that is I would be very grateful :)
Have a good day :)
4
u/Objective_Mine MSCS, CS Pro (10+) Feb 26 '26
Your algorithm may be able to find solutions to some instances of 3SAT in less than exponential time. However, usually the goal in (theoretical) computer science is to prove that an algorithm always performs in some particular way, for any possible instance of the problem. For example, in order for an algorithm for 3SAT to be considered sub-exponential time, you'd have to prove that it solves any possible instance of 3SAT in sub-exponential time. That's called worst-case analysis. You'd have to prove it mathematically, not just experimentally based on some test cases.
What your friend means is that any currently known algorithm will either fail to solve some instances of 3SAT or will require an exponential amount of time for at least some of them.
It's widely suspected that polynomial-time algorithms for 3SAT and other NP-complete problems are mathematically impossible, although that has not been proven. Some instances of 3SAT or other NP-complete problems are certainly solvable in less than exponential time even with currently known algorithms but any known algorithm will take exponential time in some cases.
1
u/FigureSubject3259 Feb 26 '26
You might google for ratio of variables to clauses for 3sat. If the number of variables is far higher than the number of clauses the problem tends to get trivial as every condition fullfilling a clause has no side impact. If the number is too low in a formula without redundant clauses it is trivia to proof the formula has no valid solution. There exist a range in that 3sat formula tend to be very hard to solve with high propability.
1
u/flatfinger Mar 02 '26
Many kinds of problems can be solved relatively quickly except when certain conditions conspire to make things difficult. Such solutions may be useful for solving most "naturally arising" problems of those kinds, but much of the usefulness of e.g. 3sat solvers comes not from their ability to solve naturally arising 3sat problems, but rather their ability to solve 3sat problems which were produced by converting other forms of problem into 3sat. If one can quickly turn some other problem into a 3sat problem in a way that would allow the solution to the 3sat problem to be quickly converted into a solution to the other problem, then a fast 3sat solver could be used to quickly solve the other problem.
Unfortunately, the 3sat problems produced by such conversion methods are much more likely to involve "hard" cases than most "naturally arising" 3sat problems. In particular, if a problem that would be hard to solve is converted to 3sat, it is almost certain to involve cases that conspire to make things difficult for the 3sat solver.
2
u/cormack_gv Feb 26 '26
There is no known sub-exponential algorithm for 3-sat. Many (most?) strongly believe that no such algorithm exists, but that has not been proven. If such an algorithm exists, it will also solve a whole class of problems known as NP-complete.
1
u/esaule Feb 26 '26
> When I see how my algorithm works, it actually seems to lower the amount of procedures compared to random ( it loops in a smaller amount of variables than random) and so I feel it may not be really exponential.
The problem you are running into probably is that 2^n is exponential but 2^{n/2} is still exponential even though it is massively less. Actually it is doing exponentially fewer steps. But that number of steps might still be an exponential number.
This is a common problem experienced by people who were not trained in complexity. There are lots of "well this seems way better than that other thing" and maybe it is. But sometimes the complexity does not change, or does not change much.
0
u/dkopgerpgdolfg Feb 26 '26
So basically, for some "easy" subset of 3SAT, you found a way of solving it in polynomial time. And now you're asking how to extend this to all of 3SAT?
That's not possible. Not only no such thing is known, but instead it is proven that it can't exist. https://en.wikipedia.org/wiki/Cook%E2%80%93Levin_theorem
(At least of turing machines and similar. For quantum computers, there's neither a known way nor a proof of the opposite)
Which part exactly? Do you understand NP-completeness etc.?
That part I don't understand. What does a random amount of variables matter here?
That's not something to feel, but to detemermine relatively easily by looking at the algorithms description.