81
1-1 Qin Zhang B669 Sublinear Algorithms for Big Data

for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

1-1

Qin Zhang

B669 Sublinear Algorithms

for Big Data

Page 2: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

2-1

• : over 2.5 petabytes of sales transactions• : an index of over 19 billion web pages• : over 40 billion of pictures• . . .

Now about the Big Data

Big data is everywhere

Page 3: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

2-2

• : over 2.5 petabytes of sales transactions• : an index of over 19 billion web pages• : over 40 billion of pictures• . . .

Now about the Big Data

Big data is everywhere

Nature ’06 Nature ’08 Economist ’10CACM ’08

Magazine covers

Page 4: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

3-1

• Retailer databases

• Logistics, financial & health data

• Social network

• Pictures by mobile devices

• Internet of Things

• New forms of scientific data

Source and Challenge

Source

Page 5: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

3-2

• Retailer databases

• Logistics, financial & health data

• Social network

• Pictures by mobile devices

• Internet of Things

• New forms of scientific data

Source and Challenge

Source

• Volume

• Velocity

• Variety (Documents, Stock records, Personal profiles,Photographs, Audio & Video, 3D models, Location data, . . . )

Challenge

Page 6: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

3-3

• Retailer databases

• Logistics, financial & health data

• Social network

• Pictures by mobile devices

• Internet of Things

• New forms of scientific data

Source and Challenge

Source

• Volume

• Velocity

• Variety (Documents, Stock records, Personal profiles,Photographs, Audio & Video, 3D models, Location data, . . . )

Challenge

} The focus of algorithm design

Page 7: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

4-1

What is the meaning of Big Data IN THEORY?

We don’t define Big Data in terms of TB, PB, EB, . . .

Page 8: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

4-2

What is the meaning of Big Data IN THEORY?

We don’t define Big Data in terms of TB, PB, EB, . . .

The data is stored there, but no time to read them all.What can we do?

Page 9: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

4-3

What is the meaning of Big Data IN THEORY?

We don’t define Big Data in terms of TB, PB, EB, . . .

The data is stored there, but no time to read them all.What can we do?

Read some of them. Sublinear in time

Page 10: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

4-4

What is the meaning of Big Data IN THEORY?

We don’t define Big Data in terms of TB, PB, EB, . . .

The data is stored there, but no time to read them all.What can we do?

The data is too big to fit in main memory.What can we do?

Read some of them. Sublinear in time

Page 11: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

4-5

What is the meaning of Big Data IN THEORY?

We don’t define Big Data in terms of TB, PB, EB, . . .

The data is stored there, but no time to read them all.What can we do?

The data is too big to fit in main memory.What can we do?

Read some of them. Sublinear in time

Store on the disk (page/block access) Sublinear in I/O

Page 12: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

4-6

What is the meaning of Big Data IN THEORY?

We don’t define Big Data in terms of TB, PB, EB, . . .

The data is stored there, but no time to read them all.What can we do?

The data is too big to fit in main memory.What can we do?

Read some of them. Sublinear in time

Store on the disk (page/block access) Sublinear in I/O

Throw some of them away. Sublinear in space

Page 13: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

4-7

What is the meaning of Big Data IN THEORY?

We don’t define Big Data in terms of TB, PB, EB, . . .

The data is stored there, but no time to read them all.What can we do?

The data is too big to fit in main memory.What can we do?

The data is too big to be stored in a single machine.What can we do if we do not want to throw them away?

Read some of them. Sublinear in time

Store on the disk (page/block access) Sublinear in I/O

Throw some of them away. Sublinear in space

Page 14: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

4-8

What is the meaning of Big Data IN THEORY?

We don’t define Big Data in terms of TB, PB, EB, . . .

The data is stored there, but no time to read them all.What can we do?

The data is too big to fit in main memory.What can we do?

The data is too big to be stored in a single machine.What can we do if we do not want to throw them away?

Read some of them. Sublinear in time

Store on the disk (page/block access) Sublinear in I/O

Throw some of them away. Sublinear in space

Store in multiple machines, which collaborate via communication

Sublinear in communication

Page 15: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

5-1

What do we mean by “sublinear”?

Time/space/communication

spent is o(input size)

Page 16: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

6-1

Conceretly, theory folks talk about the following ...

Sublinear time algorithms

Sublinear time approximation algorithms

Property testing (not in this course)

Page 17: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

6-2

Conceretly, theory folks talk about the following ...

Sublinear time algorithms

Sublinear time approximation algorithms

Property testing (not in this course)

Sublinear space algorithms

Data stream algorithms

Page 18: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

6-3

Conceretly, theory folks talk about the following ...

Sublinear time algorithms

Sublinear time approximation algorithms

Property testing (not in this course)

Sublinear space algorithms

Data stream algorithms

Sublinear communication algorithms

Multiparty communication protocols/algorithms(particular models: MapReduce, BSP, . . . )

Page 19: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

6-4

Conceretly, theory folks talk about the following ...

Sublinear time algorithms

Sublinear time approximation algorithms

Property testing (not in this course)

Sublinear space algorithms

Data stream algorithms

Sublinear communication algorithms

Multiparty communication protocols/algorithms(particular models: MapReduce, BSP, . . . )

Sublinear I/O algorithms (not in this course)

External memory data structures/algorithms

Page 20: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

7-1

Sublinear in time

Given a social network graph, we want to compute its average degree.(i.e., the average # of friends people have in the network)

Can we do it without quering the degrees of all nodes?(i.e., asking everyone)

Example:

Page 21: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

8-1

Why hard? You can’t see everything in sublinear time!

Computing exact average degree is impossible withoutquerying at least n − 1 nodes (n: # total nodes).

So our goal is to get a (1 + ε)-approximation w.h.p.(ε is a very small constant, e.g., 0.01)

Page 22: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

8-2

Why hard? You can’t see everything in sublinear time!

Computing exact average degree is impossible withoutquerying at least n − 1 nodes (n: # total nodes).

So our goal is to get a (1 + ε)-approximation w.h.p.(ε is a very small constant, e.g., 0.01)

Can we simply use sampling?

Page 23: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

8-3

Why hard? You can’t see everything in sublinear time!

Computing exact average degree is impossible withoutquerying at least n − 1 nodes (n: # total nodes).

So our goal is to get a (1 + ε)-approximation w.h.p.(ε is a very small constant, e.g., 0.01)

Can we simply use sampling?

No, it doesn’t work. Consider the star, with degree sequence(n − 1, 1, . . . , 1).

Page 24: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

8-4

Why hard? You can’t see everything in sublinear time!

Computing exact average degree is impossible withoutquerying at least n − 1 nodes (n: # total nodes).

So our goal is to get a (1 + ε)-approximation w.h.p.(ε is a very small constant, e.g., 0.01)

Can we simply use sampling?

So can we do anything non-trivial?

(think about it, and we will discuss later in the course)

No, it doesn’t work. Consider the star, with degree sequence(n − 1, 1, . . . , 1).

Page 25: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

9-1

Sublinear in space

The data stream model (Alon, Matias and Szegedy 1996)

RAM

CPU

Page 26: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

9-2

Sublinear in space

The data stream model (Alon, Matias and Szegedy 1996)

Applications

Internet Router.

RAM

CPU

Router

Packets limited space

Stock data, ad auction, flight logs on tapes, etc.

The router wants to maintain some statistics on data.E.g., want to detect anomalies for security.

Page 27: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

10-1

Why hard? You do see everything but then “forget”!

Game 1: A sequence of numbers

Page 28: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

10-2

Why hard? You do see everything but then “forget”!

Game 1: A sequence of numbers

52

Page 29: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

10-3

Why hard? You do see everything but then “forget”!

Game 1: A sequence of numbers

45

Page 30: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

10-4

Why hard? You do see everything but then “forget”!

Game 1: A sequence of numbers

18

Page 31: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

10-5

Why hard? You do see everything but then “forget”!

Game 1: A sequence of numbers

23

Page 32: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

10-6

Why hard? You do see everything but then “forget”!

Game 1: A sequence of numbers

17

Page 33: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

10-7

Why hard? You do see everything but then “forget”!

Game 1: A sequence of numbers

41

Page 34: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

10-8

Why hard? You do see everything but then “forget”!

Game 1: A sequence of numbers

33

Page 35: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

10-9

Why hard? You do see everything but then “forget”!

Game 1: A sequence of numbers

29

Page 36: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

10-10

Why hard? You do see everything but then “forget”!

Game 1: A sequence of numbers

49

Page 37: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

10-11

Why hard? You do see everything but then “forget”!

Game 1: A sequence of numbers

12

Page 38: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

10-12

Why hard? You do see everything but then “forget”!

Game 1: A sequence of numbers

35

Page 39: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

10-13

Why hard? You do see everything but then “forget”!

Game 1: A sequence of numbers

Q: What’s the median?

Page 40: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

10-14

Why hard? You do see everything but then “forget”!

Game 1: A sequence of numbers

A:

Q: What’s the median?

33

Page 41: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

11-1

Why hard? Cannot store everything.

Game 1: A sequence of numbers

Game 2: Relationships between

Alice, Bob, Carol, Dave, Eva and Paul

Q: What’s the median?

A: 33

Page 42: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

11-2

Why hard? Cannot store everything.

Game 1: A sequence of numbers

Game 2: Relationships between

Alice, Bob, Carol, Dave, Eva and Paul

Q: What’s the median?

A: 33

Alice and Bob become friends

Page 43: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

11-3

Why hard? Cannot store everything.

Game 1: A sequence of numbers

Game 2: Relationships between

Alice, Bob, Carol, Dave, Eva and Paul

Q: What’s the median?

A: 33

Carol and Eva become friends

Page 44: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

11-4

Why hard? Cannot store everything.

Game 1: A sequence of numbers

Game 2: Relationships between

Alice, Bob, Carol, Dave, Eva and Paul

Q: What’s the median?

A: 33

Eva and Bob become friends

Page 45: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

11-5

Why hard? Cannot store everything.

Game 1: A sequence of numbers

Game 2: Relationships between

Alice, Bob, Carol, Dave, Eva and Paul

Q: What’s the median?

A: 33

Dave and Paul become friends

Page 46: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

11-6

Why hard? Cannot store everything.

Game 1: A sequence of numbers

Game 2: Relationships between

Alice, Bob, Carol, Dave, Eva and Paul

Q: What’s the median?

A: 33

Alice and Paul become friends

Page 47: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

11-7

Why hard? Cannot store everything.

Game 1: A sequence of numbers

Game 2: Relationships between

Alice, Bob, Carol, Dave, Eva and Paul

Q: What’s the median?

A: 33

Eva and Bob unfriends

Page 48: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

11-8

Why hard? Cannot store everything.

Game 1: A sequence of numbers

Game 2: Relationships between

Alice, Bob, Carol, Dave, Eva and Paul

Q: What’s the median?

A: 33

Alice and Dave become friends

Page 49: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

11-9

Why hard? Cannot store everything.

Game 1: A sequence of numbers

Game 2: Relationships between

Alice, Bob, Carol, Dave, Eva and Paul

Q: What’s the median?

A: 33

Bob and Paul become friends

Page 50: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

11-10

Why hard? Cannot store everything.

Game 1: A sequence of numbers

Game 2: Relationships between

Alice, Bob, Carol, Dave, Eva and Paul

Q: What’s the median?

A: 33

Dave and Paul unfriends

Page 51: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

11-11

Why hard? Cannot store everything.

Game 1: A sequence of numbers

Game 2: Relationships between

Alice, Bob, Carol, Dave, Eva and Paul

Q: What’s the median?

A: 33

Dave and Carol become friends

Page 52: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

11-12

Why hard? Cannot store everything.

Game 1: A sequence of numbers

Game 2: Relationships between

Alice, Bob, Carol, Dave, Eva and Paul

Q: What’s the median?

A: 33

Q: Are Eva and Bob connected by friends?

Page 53: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

11-13

Why hard? Cannot store everything.

Game 1: A sequence of numbers

Game 2: Relationships between

Alice, Bob, Carol, Dave, Eva and Paul

Q: What’s the median?

A: 33

Q: Are Eva and Bob connected by friends?

A: YES. Eva ⇔ Carol ⇔ Dave ⇔ Alice ⇔ Bob

Page 54: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

11-14

Why hard? Cannot store everything.

Game 1: A sequence of numbers

Game 2: Relationships between

Alice, Bob, Carol, Dave, Eva and Paul

Q: What’s the median?

A: 33

Q: Are Eva and Bob connected by friends?

A: YES. Eva ⇔ Carol ⇔ Dave ⇔ Alice ⇔ Bob

Have to allow approx/randomization given a small memory.

Page 55: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

12-1

Sublinear in communication

x1 = 010011 x2 = 111011

x3 = 111111

xk = 100011

They want to jointly compute f (x1, x2, . . . , xk) (e.g., f is # distinct ele)

Goal: minimize total bits of communication

The model

Page 56: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

12-2

Sublinear in communication

x1 = 010011 x2 = 111011

x3 = 111111

xk = 100011

They want to jointly compute f (x1, x2, . . . , xk) (e.g., f is # distinct ele)

Goal: minimize total bits of communication

The model

Applicaitons

etc.

Page 57: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

13-1

Why hard? You do not have a global view of the data.

Let’s think about the graph connectivity problem:k machine each holds a set of edges of a graph.

Goal: compute whether the graph is connected.

Page 58: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

13-2

Why hard? You do not have a global view of the data.

Let’s think about the graph connectivity problem:k machine each holds a set of edges of a graph.

Goal: compute whether the graph is connected.

A trivial solution: each

machine sends a local

spanning tree to the first

machine. Cost O(kn log n)

bits.

Page 59: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

13-3

Why hard? You do not have a global view of the data.

Let’s think about the graph connectivity problem:k machine each holds a set of edges of a graph.

Goal: compute whether the graph is connected.

A trivial solution: each

machine sends a local

spanning tree to the first

machine. Cost O(kn log n)

bits.

Can we do better, e.g., o(kn) bits of communication?

Page 60: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

13-4

Why hard? You do not have a global view of the data.

Let’s think about the graph connectivity problem:k machine each holds a set of edges of a graph.

Goal: compute whether the graph is connected.

A trivial solution: each

machine sends a local

spanning tree to the first

machine. Cost O(kn log n)

bits.

What if the graph is node partitioned among the k machines?

That is, each node is stored in 1 machine with all adjancent edges.

Can we do better, e.g., o(kn) bits of communication?

Page 61: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

14-1

Problems

Statisticalproblems

• Frequency moments Fp

F0: #distinct elements

F2: size of self-join

• Heavy hitters

• Quantile

• Entropy

• . . .

Page 62: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

14-2

Problems

Statisticalproblems

• Frequency moments Fp

F0: #distinct elements

F2: size of self-join

• Heavy hitters

• Quantile

• Entropy

• . . .

Graph problems

• Connectivity

• Bipartiteness

• Counting triangles

• Matching

• Minimum spanning tree

• . . .

Page 63: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

14-3

Problems

Statisticalproblems

• Frequency moments Fp

F0: #distinct elements

F2: size of self-join

• Heavy hitters

• Quantile

• Entropy

• . . .

Numericallinear algebra

• Lp regression

• Low-rank

approximation

• . . .

Graph problems

• Connectivity

• Bipartiteness

• Counting triangles

• Matching

• Minimum spanning tree

• . . .

Page 64: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

14-4

Problems

Statisticalproblems

• Frequency moments Fp

F0: #distinct elements

F2: size of self-join

• Heavy hitters

• Quantile

• Entropy

• . . .

Numericallinear algebra

• Lp regression

• Low-rank

approximation

• . . .

Graph problems

• Connectivity

• Bipartiteness

• Counting triangles

• Matching

• Minimum spanning tree

• . . .

DB queries

Strings

Geometry problems

• Conjuntive

queries

• Edit distance

• Longest increasingsequence

• Clustering

• Earth-Mover Distance

. . .

Page 65: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

15-1

Example: random sampling

in data stream

RAM

CPU

Page 66: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

16-1

A toy example: Reservoir Sampling

Tasks: Find a uniform sample from a stream of unknownlength, can we do it in O(1) space?

Page 67: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

16-2

A toy example: Reservoir Sampling

Tasks: Find a uniform sample from a stream of unknownlength, can we do it in O(1) space?

Algorithm: Store 1-st item. When the i-th (i > 1) item arrives

With probability 1/i , replace the current sample;With probability 1− 1/i , throw it away.

Page 68: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

16-3

A toy example: Reservoir Sampling

Tasks: Find a uniform sample from a stream of unknownlength, can we do it in O(1) space?

Algorithm: Store 1-st item. When the i-th (i > 1) item arrives

With probability 1/i , replace the current sample;With probability 1− 1/i , throw it away.

Space: O(1)

Correctness: each item is included in the final sample w.p.1i × (1− 1

i+1 )× . . .× (1− 1n ) = 1

n (n: total # items)

Page 69: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

17-1

Maintain a sample for Sliding Windows

Tasks: Find a uniform sample from the last w items.

Page 70: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

17-2

Maintain a sample for Sliding Windows

Tasks: Find a uniform sample from the last w items.

Algorithm:

– For each xi , we pick a random value vi ∈ (0, 1).– In a window < xj−w+1, . . . , xj >, return value xi withsmallest vi .– To do this, maintain the set of all xi in sliding windowwhose vi value is minimal among subsequent values.

Page 71: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

17-3

Maintain a sample for Sliding Windows

Tasks: Find a uniform sample from the last w items.

Algorithm:

– For each xi , we pick a random value vi ∈ (0, 1).– In a window < xj−w+1, . . . , xj >, return value xi withsmallest vi .– To do this, maintain the set of all xi in sliding windowwhose vi value is minimal among subsequent values.

Space (expected): 1/w + 1/(w − 1) + . . .+ 1/1 = logw .

Correctness: Obvious.

Page 72: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

18-1

Tentative course plan

Part 0 : Introductions– New models for Big Data, interesting problems– Basic probabilistic tools

Part 1 : Sublinear in space– Distinct elements, heavy hitters, `0-sampling

Part 2 : Sublinear in communication– Connectivity, min-cut and sparsification

Part 3 : Sublinear in time– Average degree, minimum spanning tree

Part 4 : Random topics– E.g., distributed monitoring

Part 5 : Student presentations

Page 73: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

19-1

Resources

There is no textbook for the class.

Reference for part of the course: lecture notes by AmitChakrabarti

Background on Randomized Algorithms:

• Probability and Computing

by Mitzenmacher and Upfal

(Advanced undergraduate textbook)

• Randomized Algorithms

by Motwani and Raghavan

(Graduate textbook)

Page 74: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

20-1

Surveys

Surveys

• Sketch Techniques for Apporximate Query Processing

by Cormode

• Data Streams: Algorithms and Applications

by Muthukrishnan

Check course website for more resources

http://homes.soic.indiana.edu/qzhangcs/

B669-17-fall-sublinear/index.html

Page 75: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

21-1

Instructors

• Instructor: Qin ZhangEmail: [email protected] hours: Wed. 4-5pm at LH430A

• Associate Instructor: Ruiyu ZhuEmail: [email protected] hours: Mon. 4-5pm at Lindley Abyss

Page 76: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

22-1

Grading

Assignments 40% : – Two homework assignments.– Solutions should be typeset in LaTeXand submitted via Canvas.– Will be a HW0 for practicing Latex(0 pt; −5 if not submitted)

Project 60% : Consists of the following components:(details see course website)1. Write a proposal.2. Write a report.3. Make a presentation.4. Grade others’ presentations.

Final grade with be curved

Page 77: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

23-1

Prerequisites

A research-oriented course. Will be quite mathematical.

One is expected to know:basics on algorithm design and analysis + basic probability.

e.g., have taken B403 “Introduction to Algorithm Designand Analysis” or equivalent courses.

I will NOT start with things like big-O notations, thedefinitions of expectation and variance, and hashing.

Page 78: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

24-1

Frequently asked questions

Is this a course good for my job hunting in industry?

Yes and No.

Yes, if you get to know some advanced (and easily implementable)algorithms for handling big data, that will certainly help. (e.g.,Google interview questions)

But, this is a research-oriented course, and is NOT designed forteaching commercially available techniques.

Page 79: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

24-2

Frequently asked questions

Is this a course good for my job hunting in industry?

Yes and No.

Yes, if you get to know some advanced (and easily implementable)algorithms for handling big data, that will certainly help. (e.g.,Google interview questions)

But, this is a research-oriented course, and is NOT designed forteaching commercially available techniques.

I haven’t taken B403 “Introduction to Algorithm Designand Analysis” or equivalent courses. Can I take thecourse? Or, will this course fit me?

Generally speaking, this is an advanced algorithm course. It mightbe difficult if you do not have enough background (math +programming). So think carefully before taking this course!

Page 80: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

25-1

Summary for today

We have introduced three types of sublinear algorithms:in time, space, and communication

We have talked about why algorithmic design in thesemodels/paradigms are difficult.

We have discussed some simple problems

We have talked about the course plan and assessment.

Page 81: for Big Data B669 Sublinear Algorithmshomes.sice.indiana.edu/qzhangcs/B669-17-fall-sublinear/slides/intro.pdfWhat is the meaning of Big Data IN THEORY? We don’t de ne Big Data in

26-1

Thank you!