Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 46s1 days 16 hours 1 minutes 46 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 46s1 days 16 hours 1 minutes 46 seconds.

Sign in to watch this lesson
Advanced - Graphs · 4:37
2-SAT asks for true/false values that satisfy a conjunction of clauses with two literals each. Every clause (a or b) becomes the implications not a => b and not b => a on a graph with a vertex per literal; the formula is unsatisfiable exactly when some variable shares a strongly connected component with its negation. Otherwise, with components in topological order, set x true iff its component comes later than not x's, all in O(n + m).