Top Banner
1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University) Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a wholly owned subsidiary of Lockheed Martin Corporation, for the U.S. Department of Energy's National Nuclear Security Administration under contract DE-AC04-94AL85000
45

1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

Mar 28, 2015

Download

Documents

Luis Price
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

1

Estimating the longest increasing sequence in polylogarithmic time

C. Seshadhri (Sandia National Labs)

Joint work with Michael Saks (Rutgers University)

Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a wholly owned subsidiary of Lockheed Martin Corporation, for the U.S. Department of Energy's National Nuclear Security Administration under contract DE-AC04-94AL85000

Page 2: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

2

The problem

Given array f:[n] → N, find (length of)

Longest Increasing Subsequence (LIS) Rather self-explanatory

By now, textbook dynamic programming problem [CLRS 01] Chapter 15.4 (Longest Common Subsequence),

Starred Problem 15.4-6 [Schensted 61, Fredman 75] O(n log n) algorithm

4 24 10 9 15 17 20 18 4 19 34 10 15 17 18 19

Page 3: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

3

Too much to read

Array f is extremely large, so can’t read all of it What can we say about LIS length, if we see very little?

|LIS| = LIS length

Read only poly(log n) positions Obviously randomized

Algorithm

5 7 4 8 9 2

|LIS| is in range [0.4n, 0.6n]

Page 4: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

4

Uniform sample says nothing

Choose uniform random sample of poly(log n) size |LIS| = n/2, but random sample always increasing

So not really that easy to learn about |LIS|…

2 1 4 3 6 5 8 7 10 94 9

Page 5: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

5

Our result

We want range to be small

1 n

|LIS|

Algorithm

|LIS| in this range

Page 6: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

6

Our result

We want range to be small [This work] For any (constant) δ > 0

Algorithm gives additive δn approximation to |LIS|

Running time is (1/δ)1/δ(log n)c

1 n

|LIS|

Algorithm

|LIS| in this range

δn

Page 7: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

7

Our result

We want range to be small [This work] For any (constant) δ > 0

Algorithm gives additive δn approximation to |LIS|

Running time is (1/δ)1/δ(log n)c

[Ailon Chazelle Liu S 03] [Parnas Ron Rubinfeld 03]

Previous best: δ = ½

1 nn/2

|LIS|

δn Ad alert!

Page 8: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

8

Our result

We want range to be small [This work] For any (constant) δ > 0

Algorithm gives additive δn approximation to |LIS|

Running time is (1/δ)1/δ(log n)c

We get (1+ δ)-approx to distance to monotonicity Previously best was factor 2

1 nn/2

|LIS|

δn Ad alert!

Page 9: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

9

Prelims: the array in space

4 20 10 9 154 10 15 4

10

15

20

1 2 3

Page 10: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

10

Prelims: the array in space

Input is points in plane, given as array (LIS is longest chain in partial order)

Increasing sequenceViolation

Page 11: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

11

A hard example

The decision for a point depends on small scale properties of “far away” portions

k

k

k 3k

k

k

k3k

10 points in each

|LIS| = 4k |LIS| = 2k

Page 12: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

12

A hard example

Random samples in neighborhoods of points are identical! “Can we really estimate LIS in polylog time?” Is it time for some heavy work?

I mean, time for lbs (lower bounds).

k k

k

k 3k

k

k3k

Page 13: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

Outline (or lack thereof)

Will I show proofs? No

Will I show the algorithm? Maybe

I will try to demonstrate the main insight By a series of thought experiments

13

Page 14: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

14

The dynamic program

Closest LIS point to left gives “splitter” Find LIS is each blue region. Piece together!

So we break up original problem into subproblems

n/2

Splitter

Closest LIS point to left

Page 15: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

15

The dynamic program

But we don’t know right splitter. So try all possible! Only n different choices

Choose the one that gives the largest sum of LIS’s MaxS (|LIS-below-S| + |LIS-above-S|)

n/2

S

Page 16: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

16

The dynamic program

If you LIS in all small boxes, you can build LIS for bigger boxes

Not the most efficient DP… So our sublinear algo will mimic this process

n/2

Page 17: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

17

The IP

n/2

Is this pointon LIS?

Where is the splitter?

It is there.

LIS is in blue region

Splitter

Page 18: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

18

The IP

n/2

Where is the splitter?

It is there.

LIS is in blue region

This pointNOT on LIS

Page 19: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

19

The IP

n/2

I wish we knew the splitter in that region

It is there.

3n/4

Page 20: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

20

The IP

n/2

I think I know what will happen

next

You’re lucky I’m

here

3n/45n/8

Page 21: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

21

The IP

n/2

I think I know what will happen

next

You’re lucky I’m

here

3n/45n/8

Page 22: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

22

The IP

n/2

I think I know what will happen

next

You’re lucky I’m

here

3n/45n/8

Page 23: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

23

The interactive protocol

If point stays in blue region till very end, then it is good (on LIS). Otherwise, bad.

This takes (log n) steps, with the help of the wizard

Page 24: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

24

The interactive protocol

If point stays in blue region till very end, then it is good (on LIS). Otherwise, bad.

This takes (log n) steps, with the help of the wizard If we could simulate the wizard…

Page 25: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

25

The interactive protocol

If point stays in blue region till very end, then it is good (on LIS). Otherwise, bad.

This takes (log n) steps, with the help of the wizard If we could simulate the wizard…

What?? If you could simulate the wizard, you know the LIS!

Page 26: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

26

Find a splitter

n/2

Finding splitter may be hard, so try for approximate versions…?

But how do we determine the number of LIS points?

If very few LIS pointsoutside blue, this is not a bad splitter

Page 27: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

27

Find a splitter

n/2

If μ < 1/(100 log n), being against health care conservative is good enough

Total no. of points outside blue< μn

Conservative splitter

Page 28: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

28

Easy to check

n/2

Count fraction of sample outside blue poly(log n) samples checks this accurately

Page 29: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

29

Getting a conservative splitter

n/2

We can sample (log n) different candidates and check which of them disbelieves evolution is conservative

What if no conservative splitter exists?

Page 30: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

30

A liberal paradise

n/2

So we know that |LIS| < (1-μ) n

Leads to the next idea. Boosting approximations! Given δ-approx to LIS, can we get improve to δ’?

Choose any lineNo. of points outsideat least μn

Page 31: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

31

Boosting approximations

n/2

Take sum of outputs as total LIS estimate |LIS| = |LIS1| + |LIS2|, Est = Est1 + Est2

|Est1 – LIS1| < δn1 |Est2 – LIS2| < δn2

So |Est – LIS| < δ(n1 + n2)

n1+n2 < (1-μ)n, so |Est – LIS| < δ(1-μ)n !

Real splitter

No. of points outsideat least μn

Run δn-approxon points in box

Run δn-approxon points in box

n1

n2

Page 32: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

32

Putting it together

n/2

Check if each is conservative splitter If it is, we’re found right subproblems

Otherwise…

Conservative splitter?

Page 33: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

33

Putting it together

n/2

One of these is “close enough” to real splitter Est(S) = Left-Est(S) + Right-Est(S)

Run δn-approxon points in box

Run δn-approxon points in box

S

Page 34: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

34

Putting it together

n/2

One of these is “close enough” to real splitter Est(S) = Left-Est(S) + Right-Est(S) Final Estimate = maxS Est(S) Looks like a great idea!

We go from δn to δ(1- μ)n. Recur to keep improving approximation

Run δn-approxon points in box

Run δn-approxon points in box

S

Page 35: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

35

It fails, miserably

As we go up each level, approx gets better by (1-μ). So to get δ0 = ¼, how many levels needed?

¼ = ½ (1-μ)t So t = 1/μ We have running time at least 21/μ.

So, μ needs to be > 1/log log n.

Alg

AlgAlg

AlgAlg AlgAlg

δ0 = δ1(1-μ)

δ1

δ2

AlgAlg AlgAlg ½

1/μ

Page 36: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

36

Find a splitter

n/2

If μ < 1/(100 log n), being against health care conservative is good enough

Total no. of points outside blue< μn

Conservative splitter

Page 37: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

37

The basic dichotomy

P

We find splitter

Continue IP

Cannot find splitter

The “Dynamic Programming”phase

The “Interactive Protocol”phase

For IP, we need μ < 1/log n μn is error in each “level” of IP

For DP, we need μ > 1/log log n (1-μ) is decrease in approximation

Page 38: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

38

The basic dichotomy

P

We find splitter

Continue IP

Cannot find splitter

The “Dynamic Programming”phase

The “Interactive Protocol”phase

For IP, we need μ < 1/log n μn is error in each “level” of IP

For DP, we need μ > 1/log log n (1-μ) is decrease in approximation

Weaken Strengthen

Page 39: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

39

Reducing to smaller DP!

Run δ-approx on all poly(log n) such boxes

n/(log n)

n/(log n) Run δ-approx to get LISestimate inside box

Page 40: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

40

Reducing to smaller DP!

Run δ-approx on all poly(log n) such boxes Use Dynamic Program to find chain with largest sum of

estimates Longest path in DAG Can solve in poly(log n) time

Chain

n/(log n)

n/(log n)

Page 41: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

Dichotomy theorem

41

Either it is easy to find theright subproblems

One can go from δ-approx to (δ-δ2)-approx by a (log n) sized DP

OR

Page 42: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

42

The algorithm, in one slide

Overall running time becomes (log n)1/δ

*&^#$% miracle that the math works out

P

We find splitter

Continue IP

Cannot find splitter

Make poly(log n) calls to δ-approx. Solve DP of poly(log n) size.

Page 43: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

43

The even better version

Don’t exactly solve this dynamic program! Use our sublinear algo to approximately solve in

(loglog n) time. Then do it recursively… It’s painful

It’s all Greek: α β γ δ ε ζ λ μ ξ We had ν, but got rid of it

Page 44: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

44

What next? Sublinear dynamic programming! We get (1/δ)1/δ (log n)c time. Can we get

(log n)/δ time? Would be extremely cool. Completely optimal

Applications for other dynamic programs? How does one find the “right” subproblems in sublinear

time? Generalize the dichotomy Longest common subsequence/edit distance…?

Page 45: 1 Estimating the longest increasing sequence in polylogarithmic time C. Seshadhri (Sandia National Labs) Joint work with Michael Saks (Rutgers University)

Ask and you shall know…

45