communication complexity

31
Communication Complexity Guy Feigenblat Based on lecture by Dr. Ely Porat Some slides where adapted from various sources Complexity course Computer science department , Bar-Ilan university January 2008

Upload: tad

Post on 06-Feb-2016

48 views

Category:

Documents


0 download

DESCRIPTION

Communication Complexity. Guy Feigenblat Based on lecture by Dr. Ely Porat Some slides where adapted from various sources Complexity course Computer science department , Bar-Ilan university January 2008. The Model. 2 Computers : Alice (A) ,Bob (B) All calculations for A are free - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Communication Complexity

Communication Complexity

Guy Feigenblat

Based on lecture by Dr. Ely Porat Some slides where adapted from various sources Complexity course Computer science department , Bar-Ilan universityJanuary 2008

Page 2: Communication Complexity

The Model

• 2 Computers : Alice (A) ,Bob (B)• All calculations for A are free• All calculations for B are free• Algorithm costs are measured by cost of

communications.• Cost is measured per bits

• Motivation – Distributed models

Page 3: Communication Complexity

The Model

Communication Complexity

14, 29,53,28,284,348

39, 67,98,22,35,253

(48) 01110110

(98) 00100110

AB

Page 4: Communication Complexity

Our goal

Minimize the communication between A,B while calculating functions on their inputs

Page 5: Communication Complexity

First Problem Input

A has array of n numbersB has array of n numbers

Outputmedian of all 2n numbers

Numbers are O(log n) bits long

Page 6: Communication Complexity

Naive Solution

1. A sends all of his numbers to B2. B calculates median of all 2n numbers

Cost Each number is O(log n) bits n numbers are sent Total cost is O(n*log n) bits

Page 7: Communication Complexity

Naive Solution

Communication Complexity

14, 29,53,28,284,348

39, 67,98,22,35,253

(284) 00011111

(348) 001110101

(53) 101011

(29) 10111

(14) 001110

AB

Total cost is O(n*log n) bits

Page 8: Communication Complexity

8

Better algorithm

1. A sorts his array and sends his median ( ) to B

2. B sorts his array and sends his median ( ) to A.

Exercise : define : r = real median b = MAX{ } s = MIN { } prove :

AM

BM

BA M,M

BA M,Mb r s

Page 9: Communication Complexity

Better algorithm

Communication Complexity

14,

28,29,53,284,348,500

22,

35,39,67,98,253,300

A B

B sort his array and find his median

A sort his array and find his median

Page 10: Communication Complexity

Better algorithm

Communication Complexity

14,

28,29,53,284,348,500

22,

35,39,67,98,253,300

A B

67

53

B send his median to A

A send his median to B

Page 11: Communication Complexity

Better algorithm

4. If = then return ( = )

5. If > then A throws top (n/2) elements B throws low (n/2) elements

6. Otherwise, vice versa

We reduces the size of the problem by half

7. Back to step 1, until size of arrays = 1

AM

AMAM

BMBMBM

Page 12: Communication Complexity

Better algorithm

Communication Complexity

,53,284,348,500

A B

67>53

Then B throws the big half of his array

53<67

Then A throws the small half of his array

14,

28,2

9

22, 35,39,67

,98,2

53,3

00

,98,2

53,3

00

Page 13: Communication Complexity

Better algorithm

Communication Complexity

,53,284,348,500

A B

14,

28,2

9

22, 35,39,67

,98,2

53,3

00

,98,2

53,3

00

We will repeat this algorithm until the size of the array will be 1, while every loop the array is cut in half, and log n bits transferred

Total cost is

CCmid = O (log2n) bits

Page 14: Communication Complexity

Even Better algorithm

Exercise:

Try reducing the communication complexity to O(log n) bits

Page 15: Communication Complexity

EQThe previous subject talked about problem of finding median of a divided array.

Now we consider a new problem : Each side has a number and we want to know if the numbers are equal.

Communication Complexity

A B

X Y?

X=Y

Page 16: Communication Complexity

Deterministic Algorithm

Send all the data

We can’t avoid it !!

Think why ?

Page 17: Communication Complexity

Probabilistic Algorithm

Page 18: Communication Complexity

Analysis

)(log)(2

1 nOEQCCn

Like Co-RP

Page 19: Communication Complexity

How can we lower the failure probability ?

Run the experience few times

Use larger “q” (i.e. q = n10 )

Page 20: Communication Complexity

G – Communication Complexity

Till now we had to send the Random number. Consider a model in which A,B use a third party in

order to synchronize random numbers. A,B use exactly the same random

“Alise on the moon, Bob on earth, both take random from the sun”

Hard to “understand” – Remember this is just a model!!

Page 21: Communication Complexity

Protocol

Page 22: Communication Complexity

Analysis Completeness – Perfect Completeness

If A=B then all i times (a,r) = (b,r)

Soundness – If A≠B the probability that all i times (a,r) = (b,r) is

2-i

Communication Complexity )1()()(2

1 OiOEQGCCi

Page 23: Communication Complexity

Exercise

Define LE to be : LE(x,y) = 1 x ≤ y

0 otherwise

Show that

)(log)( 21 nOLECCn

Page 24: Communication Complexity

Theorem:

We prove that we can give up synchronized random with an overhead of O(logn) communication bits.

We will choose the same randomnumbers (n2) using deterministic machine for both A,B

)log)(()(2

1

2

1 nLGCCOLCC

ni

n

ri

rrrR

}1,0{

... 2,2,1

Page 25: Communication Complexity

Protocol

A choose and send it to B ][ 2ni R

Page 26: Communication Complexity

)(3)(

)()(

)log)(()(

8

1

2

1

8

1

2

1

ngLGCC

ngLGCC

nLGCCOLCC

If algorithm exists for L, we will run it 3

times and use it.

)(2

1 LGCC

Page 27: Communication Complexity

As for the proof…

We have perfect completeness in

But, we need to prove soundness

)(LGCC

For the chosen i

Page 28: Communication Complexity

It is equivalent to argue:

By union bound:

Page 29: Communication Complexity
Page 30: Communication Complexity
Page 31: Communication Complexity

We have proved that there exist a group of

There is a deterministic algorithm that can find them.

Remember, both A and B have unlimited computational power.

ni

n

ri

rrrR

}1,0{

... 2,2,1