Professional Documents
Culture Documents
Michael Luby
Department of Computer Science
University of Toronto
Toronto, Canada M!!S lA4
2
l-0
G’=(V’,E’)- G =(V.E)
wku8V’C0&
X-0
lnpmltd,for8uvEV’, d ~1
(9 rmll8mryemntouJdv tax withprob.
Pr[v CN(Z’)]Z f; Pr[E,‘)~Pr[A, 1E;] .
i-1
(Ifd(v)=Othcn&rayssddv toX} But
I’- x
tnpmlkl,for8uvcX,wEX. &[A, I E,‘]z Pr[A,]z 1-
u(V,w)<E’tk8
Ud(V)S d(w) t&ml’+ I’-(v)
daI’- I ‘-{w} In the next section, lemma 2, it is shown that
(Notcthrtf’irmindcpsndsnt~tinG’)
I-IUI.
Y.- f’UN(I’)
G’=(V’.E’) istheinducedsu~honv’-Y. even when the events {E,} are only pairwisc indepen-
ad
rd dent. Thus, Pr [v CN (f ‘)] 2 + -min(sum, ,l) q
1
33 algtwlthm Amlyd8 Theorem 1: E[m3]r gmI
Let m t be the number of edges in G ’ before the Proof : For all W E V , the set of edges touching W is
execution of the body of the rhUe loop. Let m2 be ET(W)={(v,w)CE I vfW or wCW ).
the random variable which is the number of edges in
The edges eliminated due to one execution of the
G * after the execution of the body of the wItBe loop.
while loop are the edges in the set ET [Z ’ U N (I ‘)I.
Let ml be the random variable which is the number of
edges eliminated from G ’ due to one execution of the Each edge (v , w ) is in ET [I ’ U N (f ‘)] &her because
while loop. Then, m2 -ml - mX. Theorem 1 cstab- vCr’UN(I’) orbecauscwef’UN(f’). Thus,
3
4. Pairwise Independent Events d . The work of Galambos (Gal can be used towards
this end. In fact, a stronger version of lemma 2 is
The algorithm described in the previous section
implicit in the work of Galambos.
assumed that the events {E,} were mutuaily indepen-
dent. In this section, the events {E,) are only The following lemma is a stronger version of
assumed to be p&wise independent [Fr]. The analysis lemma 1. The proof of this lemma is similar to the
shows that under this weaker assumption the algo- proof of lemma 2, only more complicated.
rithm still has the property that the expected number Lemma 3 : Consider the events {I&} defined above
of iterations of the body of the while loop is O(lugn). lemma 1, only now it is assumed that the events are
This surprisingly leads to a deterministic implementa- only pairwire independent. Then
tion of the first algorithm.
Pr[vCN(l’)]r + 9tla(sum,,l)
The following lemma is used in the proof of
lemma 1 and completes the analysis of the Srst algo- Proof : The notation introduced in the proof of
rithm. It may also be useful as a tool in other applica- lemma 1 is retained. Assume WLOG that
tions. Let ae=0 and, for 1~ t Sd(v),
PI’ .‘. rPd+).
Lemma2: LetEt,.-- ,E, be events such that for
let a, =:$lp, (note that ad(v) = sum,). Then,
lsisn, Pr[Efl=pc , ad for lsf#:/sn,
Pr (4 n Ej 1‘pi *pj f tit Sw”“XPpi’ Then
Pr[vCN(f’)]r’~‘Pr(E,‘]Pr~A, IE;].
I
i=l
Pr[U E,]k f .min(~wn,l).
1 A lower bound is fust derived on Pr [A, I E, ‘1.
Prool: WLGG that p1zpp2z --*pm. Let El’ be Pr[A, I E;)=l-Pr[+, I E; 1. But,
the event 6 E, and let uk -i pf . Then, for all Pr[4, IEl’]s 2 Pt[E, IEi’ ]
i-t I-1
1 s k s n , Pr [E, ‘1 ;t Pr [Ek ‘1. Since the events (E, } $i3%
are pairwise independent, and
Pr[E, I E,‘]=
Pr[E,n
wlEl n
yEIn **- n
-** n IE,,,
TE~-,IE~]
IE, ]
.
(This last inequality follows by observing that LHS of The numerator is less than or equal to
the inequality is minimum when all pi are equal to Pr [E, I Ei ] =pr . The denominator is equal to
Pr[E,‘]r cq .[lqq~ + cl
1 l-&X,-t
One of the basic steps for converting Monte Carlo Pr[AI I E,‘]k l-
W-a4-t) = 2(1-a,,*) ’
algorithms into deterministic rdgorithms using the
techniques developed in this paper is the development Now, a lower bound is derived on Pt [E, ’ 1.
of stronger lemmas of this type. Bonferroni and Pr[Ei’]=Pr[Ei]Pr[lEln --- n lEjiIIEi]=
4
Thus, for 1s 1 5 d(v), LP, ‘q J
Pr[E, ]=p,‘=-. Thus, Ip, -p,’ IS t S +
Q
’ Pi (l--%-l)
Pr[vCfv(f’)]~ 2 --y-- (This is a sufficient approximation to pi for the appli-
cations considered in this paper). Consider a n by q
=--ai 2 p,pi:~[l-aiq * matrix A. Intuitively, row i of A corresponds to E,
2 1Sj<iSl (In the following discussion, x, y, j, jt and jx are
(This last inequality is similar to an inequality in the integers between 0 and q -1, inclusive, and f , It, and
i2 are integers between 0 and n -1, inclusive). Let
proof of lemma 2.) If rum& then
L
11 if OS] Sp,#*q -1
If sum,+ then let 1 =mi.n{& :a12 +}. If I-1 The new sample space is the collection of q2 binary
1 vectors
then Pr(vW(f’)]~ -. If 122 then
4 br,y =(bx,ro, - -. ,b,,y”-t) ,
al-l< lSaiS -- Then,
2 2(k) - where b, ,x1 =A, ,(I +r . ,),,+ . The new probability dis-
Pr[vav(f’)]~ 7s f 0 tribution assigns a probability of -!- to each such
q2
Consider the first MIS algorithm modiied so that bX.1 *
the events. {E, } are assumed to be only pairwise Ikmm84: Pr[E,]=p,’ .
independent. Let m lr m 2 and ma be as defined in the
Proof : For fixed 1, there are exactly q pairs of x ,y
discussion preceeding theorem 1 with respect to this
such that (x +y *i)mudq -I. Event E, occurs in all
modified algorithm. Theorem 2, the analog to
bXrY such that (x +y *i)modq is between 0 and
Theorem 1, states that this modified algorithm will
pi ’ *q - 1, inclusive, i.e. for exactly pi ’ =q2 boolean
work well on the average.
vectors cl
Tbe4Wem2: E[m3]2 +m, .
Lcmm8 5 : Pr[E,, n E,, J =p,,‘-pi; .
Proof : Use lemma. 3 in place of lemma 1 in the proof Proof : For fued 1t and 1,) there is exactly one x ,y
of theorem 1 q Pair such that (x+y ‘j,)-Q “11 and
(x +y .i,)mwdq = 12 simultaneously. Events E,, and
5. Generating Paimise Independent Evenb E,, both occur for pI,‘*pia’*q2 pairs of 11,12. Thus,
Consider a probability space where the sample E,,and E,, both occur for pi,**pi,**q2 boolean vectors
space is the set of all binary vectors of length n. Let
bx.1 0
E, be an event that occurs for all binary vectors
These two lemma together show that the events
(bo, * - - ,b,-,) such that b, = 1. Let the probability {E, } are pairwise independent in the new probability
of (bo, - * - ,&) be
(l-p, )(*-bll . the
“ifpibl space. Since the new sample space only has q2 binary
i-0 vectors, it is possible to sample all vectors quickly in
events Eo, -** ,I$+ are mutually independent and
parallel. This feature is exploited in the next section
Pr [E, ] =p, . Note that Cl (n) random bits are needed
to design a deterministic algorithm for the MIS prob-
to randomly choose a binary vector. In this section, a lem.
new probability space is defined where the sample
This construction may be a useful tool to make
space is a small subset of all binary vectors of length
other Monte Carlo algorithms deterministic. The only
n. A probability distribution is defined on this new
requirement is that the algorithm only requires pair-
sample space such that the events E I, * * . ,E, are
wise independent events. This construction can be
pairwise independent.
extended to generate painvisc independent random
Let q be a prime number between n and 2n. The variables in the following way. The matrix A can be
new probability distribution has the property that filled with any set of computable rational numbers.
5
Each row of A corresponds to a random variable shcc Lp,,Y J+ 1
which takes on each of the q entries in that row of A ---P”,
Q
with equal probability. Both Paul Beanie and Noga
Lemma 6 : Let the events {E, } bc pairwisc indcpen-
Alon have found a natural extension of this technique
dent such that Pr[E, ] =pr’ and such that for all
to generate d-wise independent random variables
using ud sample points. vcv, d(v)< +. Then
Pr[vCN(.f’)]r $ mfn(sum,, 1) .
6. Deterministic Algorithm far the MIS Pr~b-
lek PreoI : The same proof as for lemma 3, except
The algorithms for the MIS problem described in is used as a lower bound and pv is used as an upper
this section are almost immediate consequencesof the
results in sections 3, 4 and 5. In section 3, a Monte bound on Pr [E, ] 0
Carlo algorithm for the MIS problem is presented. Tlscorcm 3 : Consider the first MIS algorithm as
Under the assumption that the events (E, } (de&d modified above so that the events {E, } are pairwise
above lemma 1) are mutually independent, the analysis independent and Pr [E, ] =pv ’ and for all v CV,
shows that the expected running time of the algorithm d(v)< +. Let ml, m2, and ml be as &l&d in the
is small. In section 4, it is shown that the same result
discussion prcccediig theorem 1 with respect to this
holds when the events {E, } arc assumed to be pair-
wise independent. In section 5, i.t is shown how to modified algorithm. Then E [ms] 2 f ml.
construct a probability distribut:ion such that the Preof : Use lemma 6 in place of lemma 1 in the proof
events {E, } arc pairwisc independent and such that
of theorem 1 0
the number of points in the sample space is O(n*),
thus they they can all be sampled in parallel. Putting The description of the second algorithm is given
these results together yields a deterministic algorithm on the following page. This algorithm is very practi-
with a small running time. cal because it is simple, fast, uses 8 small number of
The only difficulty is that the events {E, } do not processors and a small number of random bits. Each
have exactly the same probability in the new probabil- execution of the body of the wldIe loop can be implc-
ity space as they did in the original. More precisely, mented in O(logn) time on a EREW P-RAM using
O(m) processors, where the expected number of ran-
in the original probability space, Pr[E, ] = --!--
U(v) ’ dom bits used is 0(&n). The expected number of
whereas in the new probability space, executions of the while loop before termination of the
algorithm is 0 (fogn ). Thus, the expected running time
L-J
.- LP*‘QJ 26(v) of the entire algorithm on a EREW P-RAM is
Pr[E, I “Pr
4 4 - O((fogn)*) using O(m) processors, where the
This difficulty is overcome with the following expected number of random bits used is O((logn)t).
modification to the algorithm. If there is a vertex
The algorithm can be easily modiicd to remove
vf V such that d (v)s: 2 then v is immediately the random choices made in the (9 step of the algo-
added to the independent set I and {v} U N ({v}) is rithm. The idea is to let the algorithm try all q* pos-
sible pairs x,y in parallel, creating q* sets IrJ’. The
deleted from the graph. In this cuse, at least + of
set which maximizes the number of edgcs eliminated
the vertices are eliminated from the graph. If no such from G ’ is used to form the new G I. Theorem 3
vertex exists, then for all v 6 V, d(v)< E, which shows that the best set will eliminate at least + of
implies --/I- 2 -u;v) ) 8 and consequently the cdgcs in the graph G ‘. This algorithm can be
=@I implemented on a EREW P-RAM with O(mn*) pro-
LP” ‘4 J
p+ But this implies that -- g 2 1. Thus, ccssorswith running time O((lugn)z).
Another problem which is a special case of the
I- 0
G’=(V’.E’)- 0 =(v.E) Maximal Coloring problem is the A+lVC problem.
rNtcV’f0& The input to the A+lVC problem is an undirected
graph G =(V ,E ) . Let A be the maximum degree of
In pmtkt. for au v c v -, compute d(v)
Inpuaucl,for~IIvCV’
any vertex in V, let A’= A+1 and let C = {ct, ....c*.}
Ud(v)=Otknuld~ to1 l uldeletev fromv’. be a set of distinct colors. The output is an assign-
compute It’= IV’1 ment of a color from C to each vertex such that no
Bndv(V’rucht~td(v)irmuimum two adjacent vertices are assigned the same color.
u d(v)a $heaaddv tol andIetG’bcthc The A+lVC problem is the special case of the Maxi-
graph induced on the vertices V ‘-(iv) U N ({v))) mal Coloring problem where for each vertex v c V,
etse(for all vEV’.d(v)< $1 C, =C . In any Maximal Coloring each vertex will be
assigned some color from C because A’ is larger than
compute a prime 9 such that n’s 9 s 24 ’ d(v). The obvious sequential algorithm for the
(3 ruubmlychoIx mdy lucht!utO~xx,ys9-1 A+lVC problem follows: For v = 1, ....n , vertex v is
X-0 assigned the smallest indexed color from C which is
iopumlld,for~VCV’.
not assigned to a smaller indexed adjacent vertex.
One might hope to devise a fast parallel algorithm for
cmputc n(y) ‘L -J
2d(“)
the A +lVC problem by emulating the sequential algo-
c0mptef(v)=(i+v~)mdg
rithm. However, this is unlikely since
uf(v)an(v)thearddv tax
cd Lemm8 7 : The problem of deciding what color ver-
I’- x tex n is assigned by the above sequential algorithm is
Inpuauet.forauvCX,w~X.
NC’ complete for P .
U(v.w)CE’t&m
Pd(V)Stf(W) tkmf’- I’-(v) Prod : There is an easy reduction from the LFMIS
eIaef’- f’-(w)
problem (see section 1) to this problem 0
I-IUle
Y - “U N(f’) Thus, as was the case for the MIS problem, the color-
G’=(V’.E’) istheinducedaubgmphonV’-Y. ing algorithm cannot simply emulate the sequential
end algorithm.
08d
There is‘ a NC’ reduction from the Maximal
ad
Coloring problem to the MIS problem. Given a Maxi-
mal Coloring problem with input G = (V, E) and
7. The Maximal Coloring Problem color sets {C, }, a new graph G * is formed. The ver-
The Maximal Coloring problem generaliies two tices in G’ are V’={(v,c):vEV ftndc~C,}. The
problems of interest. The input is an undirected edges in G ’ are
graph G = (V , E ) and a set of colors C, for each ver-
tex v E V . The output is a maximal coloring. In a
man~mal coloring, each vertex v is either assigned a
color from C, or is not assigned a color, subject to There is a one to one correspondence between
the restrictions that no two adjacent vertices are
maximal colorings in G and maximal independent sets
assigned the same color and that if v fs not assigned a
in G *. This reduction together with the MIS algorithm
color then each color in C, must be assigned to at
shows that the Maximal Coloring problem is in NC 2.
least one neighbor of v .
The AVC problem is to color all the vertices
The MIS problem is a special case of the Maximal
using only A distinct colors. Brook ‘E Theorem [Br]
Coloring problem where C, -{red} for each vertex
proves that all but very special graphs can be colored
v d V . The set of vertices colored r&d in MY maximd with A colors, and implicitly gives a polynomial time
coloring are a MIS. sequential algorithm. Karloff, Shmoys and Sorokcr
[KSS) have found a NC parallel algorithm for the G - (V ,E ), and weights and thresholds for all edges
AVC problem when A is polylog in the number of and vertices in G, respectively. The output is a sys-
vertices. Their algorithm uses the algorithm for the tem state where all vertices have energy greater than
A +lVC problem as a subroutine. The classification of or equal to zero. The BCS problem has a polynomial
the AVC problem with respect to parallel computa- time sequential algorithm if all of the weights and
tion is still open for unrestricted A. thresholds are input in unary. The algorithm repeats
the following step until all vertices have energy
8. Binary Coherent Systems greater tha.n or equal to zero: find a vertex with nega-
Recently, researchers in Artificial Intelligence tive energy and flip its state. The running time of this
have been actively investigating various connectionist algorithm i.s slow if the system is large. Hopfield sug-
models of the brain [Fe],[Go], [Hi],(:Ho]. Some of the gests a simple asynchronous parallel algorithm for this
basic features of the connectionist model are shared problem, but provides no formal analysis of its run-
by knowledge representation schemas [Ts]. Infor- ning time, although he does give some empirical evi-
mally, they model the brain cells by a large collection dence that it is fast. An open question is whether or
of computational units with a finite number of states not the BCS problem has an NC algorithm.
and with very limited computing power. They model The MIS problem is a special case of the BCS
the synaptic connections by interconnections between problem, where all edge weights are -1 and for each
the units through which they can pass information VfV, I, =-d(v)+l. Thus, the algorithm described
about their current state. They describe various in section 6 shows that at least a special case of the
models for representing knowledge, and suggest mas- BCS problem is in NC, and Baruch Awerbuch has
sively parallel asynchronous algorithms for computing, observed that the algorithm given in section 3 can be
i.e. for acquiring new information, recalling previously easily modified to run asynchronously ‘in parallel.
acquired information and concepts, deducing new con- Another natural problem which is a special case
cepts from old, etc. They are faced with two basic of the BCS problem is the Different Than Majority
questions: how to represent knowledge so that the
Labelling (DTML) problem. The input to this prob-
representation has the desired semantic properties and lem is an undirected graph G = (V ,E). The output is
how to implement parallel asynchronous algorithms to a label of -1 or 1 for each vertex v such that at least
compute quickly given a particular representation. half of the neighbors of v have the opposite label.
The hope is that the development of problems which The DTML problem is a BCS problem where all
seem to model a problem typically encountered by the thresholds are zero and all edge weights are -1. The
brain, together with a study of the inherent complex- DTML problem may also be viewed as a graph parti-
ity of algorithms for these problems, will give some tion problem: partition the vertices of an undirected
insight into the low level workings of the brain. graph into two sets such that for each vertex Y at least
One particular model of the brain is a binary half of the edges out of v cross the partition. Karloff
coherent system [Ho], [Hi]. The interconnections of [Ka2] has :found a NC algorithm for this problem
the system can be represented by an undirected graph when the input is a cubic graph, but the general prob-
G - (V , E ). Each edge c f E has a real-valued weight lem is still open. However, there is evidence that a
we . Each vertex Y 6 V has a real-valued threshold r, . different type algorithm than the MIS algorithm will
Each vertex v has a state s, which can be either -1 or have to be found.
1. The state of the system is a tuple (st ) .... s ,v , ). Thawem 4 : The problem of deciding whether there
The energy of vertex w in a system state is is a DTML for a graph such that two speci3ed vertices
8
9. Open Problems and Further Work problem, and more specifically for suggesting that an
analysis be done on an algorithm very similar to the
1. Fiid other Monte Carlo algorithms for which the
algorithm’ described in section 3.1. I thank Allan
techniques developed in this paper are applicable
Borodin for introducing me to the work on connec-
for converting the algorithm into a deterministic
tionist models.
algorithm. There are a number of problems for
which these techniques provide an easy deter-
ministic algorithm. 11. References
2. Develop probabilistic bounds on events that are [ACGS]
d -wise independent. As mentioned previously, Alexi, W., Chor, B., Goldreich, 0. and Schnorr,
1+- 1
the work of [Gal implicitly addressesthis type of C. RSAfRabin Bits are secure, _,
2 ~01~OWN 1
question. This seems to be one of the necessary 25’* FOCS9October 1984
steps for proving that a Monte Carlo algorithm
[ABI]Alon, N., Babai, L., and hi, A.,A Far and Sim-
can be converted into a deterministic algorithm
ple Randomized Parallel Algorirhm for the Maximal
using the techniques developed in this paper. In
Independent Set Problem, private communication
a different setting, [ACGS] used the fact that
Chebychev’s Inequality holds for painvise [Br] Brooks, R.L., On colouring rhe nodesof a network,
independent events to prove the security of Proc. Cambridge Philos. Sot., 37, 194-197,1941
RSA/Rabin Bits. Their basic idea was the same, [CoJCook, S. A Taxonomy of Problems wirh Fast Paral-
you need less random bits to generate pairwise lel Algorirhms, to appear in Information and Con-
independent events than you do to generate trol
mutually independent events. [CL]Cook. S. and Luby, M. A Fast Parallel Afgorilhm
3. The Monte Carlo algorithm presented in section 3 for Finding a Truth Assignment lo a 2-CNF For-
has a very local property. This property seems mula, paper in preparation
particularly well-suited to distributed computing [Fe] Feldman, J. A. A Connecliontsr Model of Visual
networks where the processors can only commun- Memory, Parallel Models of Associative Memory,
icate with neighboring processors. As pointed GE. Hinton and J.A. Anderson editors, Hillsdale,
out in section 8, this feature also seems desirable NJ., Lawrence Erlbaum Associates, publishers,
in some Artificial Intelligence applications. Find 1981
applications for the algorithms presented in this [Fr] Feller, W. An ftiroduction to Probabfflfy Theory
paper in these areas. und Its Applicarfons, vol. 1,3” edition, 1968, John
4. There is no known lower bound on the parallel Wiley and Sons, publishers
complexity of the MIS problem. Either 6nd a [Ga]Galambos, J., Bonferroni Inequalities, The Annals
problem which is complete in some complexity of Probability, 1977, vol. 5, no. 4,577-581
class (like NL) and reduce it to the MIS problem,
[GolGoldschlager, L.M. A Compuzrriional Theory of
or else find a faster MIS algorithm.
Higher Brain Function, Technical Report, Stan-
ford University, April 1984
10. Acknowledgements
[Ho)Hopficld, J. J., Neural networks and physical sys-
I thank Paul Beame for extensive discussions
tem with emergent collecrive computaUona1 abili-
which helped simplify the analysis of the algorithms,
ties, Proceedings National Academy of Sciences,
and especially for conversations which contributed
vol. 79, pp. 2554-2558,April 1982
signticantly to the results in sections 4 and 5. I thank
Stephen Cook for many discussion about the MIS [Hi] Hinton, GE., Sejnowski, T. and Ackley, D.,
Bollzmann Machines: Consrraint Sarisf action Neb
problem and related problems, and for his unswerving
belief that there must be a faster algorithm for the works rhar Learn, technical report CMU-CS-84-
MIS problem. Thanks go to both Charlie Rackoff and 119
Gary Miller for helpful discussions about the MIS
9
[II] Israeli, A. and Itai, A. A Fusr und Simple Random-
ized Parallel Algorithm for Maxfmal Murchfttg,
Computer Science Dept., Technion, Haifa Israel,
1984
[IS] Israeli, A. and Shiloach, Y. AwrImproved Muzfmul
Matching Parallel Algorithm, Tech. Rep. 333,
Computer Science Dept., Technion, Haifa Israel,
1984
[KflJKarlofE, H., Randomfzed Parallel Algorithm for
the Odd-Set Cover Problem, preprint
[Kf2]Karloff, H., private communication
(KSSlKarloff, H., Shmoys, D. and Soroker, D.,
Efffcfent Parallel Algorfthmz for Graph Coloring
and Partitioning Problems, preprint
[KWjKarp, RX and Wigderson, A. A Fazt Purolfel
Algorithm forthe Mazimal fndependenf Set Prob.
km, Proceedings 16th AChf SI’OC (X984),pp. 266-
272
WJWI
Karp, R-M., Upfal, E. and Wigderson, A., Con-
structing a Petfect Matching is in Random NC, this
conference
[Le] Lev G. Size Boundz und Purullef Algorfrhmz for
Networkz, Report CST-8-80, Department of Com-
puter Science, University of Edinburgh (1980)
[Ts] Tsotsos, J. Representatfonul Axes und Temporul
Cooperutfve Processes, Technical Report RRCV-
84-2, University of Toronto, April 1984
[Va] Valiant, L. G. Parullel Comp~utfon, Proceedings
71h IBM Symposium on Mathematical Founda-
tions of Computer Science (19g2)
10