Graph Theory37 sections · 1633 units
Open in Course

Modeling as 2-SAT

(Toppings as variables)

Let variable x_i represent topping i. True means topping is on the pizza, false means it is not. This is the boolean choice. Customer wants "+i +j": that is the clause x_i OR x_j. Customer wants "+i -j": that is x_i OR NOT x_j.

Customer wants "-i -j": that is NOT x_i OR NOT x_j. Each customer gives you one clause. You have m clauses total over n variables. This is a standard 22-SAT instance ready to solve.