Algorithms For Dummies


Solving 2-SAT using randomization



Download 7,18 Mb.
Pdf ko'rish
bet563/651
Sana15.07.2021
Hajmi7,18 Mb.
#120357
1   ...   559   560   561   562   563   564   565   566   ...   651
Bog'liq
Algorithms

Solving 2-SAT using randomization

No matter the electronic circuit you have to test using a Boolean representation, 

you  can  render  it  as  a  vector  of  Boolean  variables.  You  can  also  create  another 

FIGURE 18-4: 

Symbols and 

truth tables of 

logic operators 

AND



OR



, and 

NOT


.


350

 

   


  PART 5 

 Challenging Difficult Problems

vector to contain the clauses, the set of conditions the circuit needs to satisfy (for 

example, that wire A and wire B should both be 

True


). This isn’t the only way to 

represent  the  problem;  in  fact,  there  are  other  solutions  involving  the  use  of 

graphs. However, for this example, these two vectors are enough.

You solve the problem using a randomized local search in polynomial time. Pro-

fessor Christos H. Papadimitriou, teaching at the University of California at Berke-

ley (


https://people.eecs.berkeley.edu/~christos/

), devised this algorithm, 

called  RandomWalkSAT.  He  presented  it  in  his  paper  “On  Selecting  a  Satisfying 

Truth Assignment,” published in 1991 on the Proceedings of the 32nd IEEE Sym-

posium  on  the  Foundations  of  Computer  Science.  The  algorithm  is  competitive 

when compared to more reasoned ways, and it is an exemplary local search 

approach because it makes just one change at a time on the current solution. It 

uses two nested loops, one for trying the starting solution multiple times and one 

for randomly amending the initial random solution. Repeat the outer loop 

log


2

(k)


 

times (where k is the number of wires). The inner loop uses the following steps:

1. 

Pick a random problem solution.



2. 

Repeat the following steps 

2*k

2

 times:



a.  Determine whether the current solution is the right one. When it is the 

correct solution, break free of all the loops and report the solution.

b.  Pick an unsatisfied clause at random. Choose one of the conditions in it at 

random and amend it.




Download 7,18 Mb.

Do'stlaringiz bilan baham:
1   ...   559   560   561   562   563   564   565   566   ...   651




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2025
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish