Simplest algorithm for computing the resultant of a boolean expression?

Click For Summary
SUMMARY

The discussion focuses on finding a simple algorithm for computing the resultant of a boolean expression, specifically the example (a>b) && ((b>c) && c>d) || (d > c). The participants explore the evaluation of boolean expressions through a step-by-step approach, emphasizing the need for an elegant computational method. The problem is identified as NP complete, indicating that no known algorithm can determine the satisfiability of a general boolean expression in polynomial time. The conversation suggests that while specific properties may allow for faster evaluations in certain cases, a universal solution remains elusive.

PREREQUISITES
  • Understanding of boolean algebra and expressions
  • Familiarity with NP-completeness and computational complexity theory
  • Knowledge of algorithm design and evaluation techniques
  • Experience with programming languages that handle boolean logic (e.g., Python, Java)
NEXT STEPS
  • Research algorithms for boolean satisfiability, such as DPLL and CDCL
  • Explore optimization techniques for specific boolean expressions
  • Learn about the implications of NP-completeness in algorithm design
  • Investigate tools for symbolic computation in boolean algebra
USEFUL FOR

Computer scientists, algorithm developers, and anyone interested in computational complexity and boolean logic optimization will benefit from this discussion.

spikenigma
Messages
61
Reaction score
0
hi,

let's take something simple, for example:

(a>b) && ((b>c) && c>d) || (d > c)

Intuitively, it's easy to work out given the values of a, b, c and d and just evaluating the brackets in order of precedence.

i.e.

Is b > c?? then is c > d
Then in addition to the above answer being true is a > b?
Then despite the earlier answer is d > c?
If true return true, if false return false.

But surely there is an elegant, simple algorithm for working this out computationally?

Could you for example take each expression, number them in terms of their evaluation step then evaluate in n steps based on [some factor] to get the answer?

i.e.

1) b>c, and then because of [factor], compute &&
2) c>d, and then because of [factor], compute &&
3) a>b, and then because of [factor], compute ||
4) d > c
5) answer

I know the factor is sign-right or sign-left of the expression and it could be used to create an algorithm.

But has anybody got anything more elegant?
 
Mathematics news on Phys.org
The problem itself is NP complete, i.e. no algorithm is known, which decides in polynomial time whether a general Boolean expression is satisfiable or not, see https://en.wikipedia.org/wiki/Boolean_satisfiability_problem. This means in return, that given a certain example, we can probably use specific properties to be faster, but not in general.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
Replies
7
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
Replies
9
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
8
Views
6K
  • · Replies 12 ·
Replies
12
Views
8K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 40 ·
2
Replies
40
Views
9K