Problem: Satisfiability of Equality Equations Task: Given equations like "a==b" and "a!=c", determine if they can all be satisfied. Process all "==" equations first (union the variables). Then check "!=" equations. If any "!=" connects variables in the same group, return false.
This two-pass approach works because equality is transitive. If and , then . After unioning all equalities, any inequality between members of the same component is a contradiction.