Student:Victoria Kravchenko Supervisors:Prof. Yoram Moses Liat Atsmon
Study and evaluate the approach of solving optimization problems through SAT reduction, and using SAT solvers to solve the reduced problems.
Boolean satisfiability problem (x 1 +x 5 ’+x 4 ) (x 1 ’+x 5 +x 3 +x 4 ) (x 3 ’+x 4 ’) NP-Complete CNF (Conjunctive Normal Form) – “AND of ORs”
Developed at 2003 by Niklas Eén and Niklas Sörensson Advantages: open-source, successful, small.
For:(x 1 +x 5 ’+x 4 ) (x 1 ’+x 5 +x 3 +x 4 ) (x 3 ’+x 4 ’) p cnf 5 3 → p cnf number_of_variables number_of_clauses → 0 is the end of the clause
PART 1: Equation Checker PART 2: SAT with Optimization PART 3: Maximal Acyclic Subgraph
Input: X, Y, Z – decimal numbers Output: whether X+Y=Z or not Calculates the binary form of the numbers The program prepares the input for MiniSat using the table:
For the LSB bit:
Input: Vec – x 0,x 1,x 2,… Phi – CNF expression Output: maximal value of Vec (as a binary number) which satisfies Phi
Versions: I.Bit by Bit: II.MiniSat condition: MSB 1?1 0 ????? ?1?
Input: graph name nodes – [node_number],[node_weight] edges – [node_from],[node_to] For example: ex1 1,2-2,2-3,1 1,2-2,3-3,1 1 (2) 3 (1) 2 (2)
Output: maximal acyclic subgraph 1 (2) 3 (1) 2 (2)
1 (1) 3 (2) 2 (2) 5 (3) 4 (3) lsg ex1 1,1-2,2-3,2-4,3-5,3 1,2-1,3-2,3-2,4-4,5-5,3
1 (1) 3 (2) 2 (2) 5 (3) 4 (3) lsg ex2 1,1-2,2-3,2-4,3-5,3 1,2-3,1-2,3-2,4-4,5-5,3
1 (2) 3 (2) 2 (1) 5 (3) 4 (3) lsg ex3 1,2-2,1-3,2-4,3-5,3 1,2-3,1-2,3-2,4-4,5-5,3
1 (1) 3 (2) 2 (2) 5 (3) 4 (3) lsg ex4 1,1-2,2-3,2-4,3-5,3 1,2-3,1-2,3-2,4-4,5-5,2-5,3
1 (1) 3 (2) 2 (4) 5 (1) 4 (3) lsg ex5 1,1-2,4-3,2-4,3-5,1 1,2-3,1-2,3-2,4-4,5-5,2-5,3
For each edge: Define: [node_from] > [node_to] Condition: Translate the condition to CNF using a tree (reduction to 3-SAT)
Building the weighted sum: [node] x [weight]: Y1 [m vars] ↔ X1 [node number] x W1 [m vars] Y2 [m vars] ↔ X2 [node number] x W2 [m vars] Sum the intermediate variables as in the Equation Checker: Z1 [m vars] ↔ Y1 [m vars] + Y2 [m vars] Continue summing: Z2 [m vars] ↔ Z1 [m vars] + Y3 [m vars] Save the last intermediate variables representing the accumulated sum: Z(n-1) [m vars] ↔ Z(n-2) [m vars] + Yn [m vars] Z final ↔ X 1 *W 1 + X 2 *W 2 + … + X n *W n
Get a result from the MiniSat using only the edges conditions and extract the weight W res Demand a new result with a greater weight s.t. Z final > W res Continue until the conditions can not be saturated
The graphs are polynomial and not exponential although the problem in NP complete – success! Nodes have a stronger effect on the run time.
Thank you for your attention!