Print value of each varaible in 2-SAT (loj — 1251 — Forming the Council)

Revision en2, by ivplay, 2015-11-21 19:50:51

I failed to manage any good resource on 2-SAT that illustrates printing solution for the value of each variable.Basically, I am stuck with this problem: lighoj — 1251 — Forming the Council http://www.lightoj.com/volume_showproblem.php?problem=1251

  • What I did: for each (a v b) I connected -a ->b and -b ->a. Then I run SCC and check if a and -a exist in same component.

But how can I decide value of each variable?

Thanks in advance ...

Tags 2-sat, graph

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English ivplay 2015-11-21 19:50:51 19 Tiny change: 't I did:\nWhat I tried , for each (' -> 't I did:\nfor each ('
en1 English ivplay 2015-11-21 19:50:13 548 Initial revision (published)