Fitting a Step Function to a Point Set e Fournier 1 Antoine Vigneron - - PowerPoint PPT Presentation

fitting a step function to a point set
SMART_READER_LITE
LIVE PREVIEW

Fitting a Step Function to a Point Set e Fournier 1 Antoine Vigneron - - PowerPoint PPT Presentation

Fitting a Step Function to a Point Set e Fournier 1 Antoine Vigneron 2 Herv 1 University of Versailles St-Quentin en Yvelines 2 INRA Jouy-en-Josas December 4, 2008 H. Fournier and A. Vigneron (UVSQ, INRA) Fitting a Step Function to a Point Set


slide-1
SLIDE 1

Fitting a Step Function to a Point Set

Herv´ e Fournier1 Antoine Vigneron2

1University of Versailles St-Quentin en Yvelines 2INRA Jouy-en-Josas

December 4, 2008

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 1 / 20

slide-2
SLIDE 2

1

Introduction Problem statement Our results Previous work

2

Decision algorithm

3

Optimization algorithm Searching in a sorted matrix

4

Linear time algorithm Path partitioning General framework Linear-time algorithm for fitting a step function Weighted version Frederickson’s algorithm (sketch)

5

Conclusion

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 2 / 20

slide-3
SLIDE 3

Problem statement

INPUT: a set P of n points and an integer k.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 3 / 20

slide-4
SLIDE 4

Problem statement

INPUT: a set P of n points and an integer k. OUTPUT: a step function f ∗ with k steps that minimizes the maximum vertical distance ε∗ = d(P, f ∗) between f and P. d(f , P) = maxi |f (xi) − yi| when P = {(x1, y1) . . . (xn, yn)}

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 3 / 20

slide-5
SLIDE 5

Problem statement

ε∗

INPUT: a set P of n points and an integer k. OUTPUT: a step function f ∗ with k steps that minimizes the maximum vertical distance ε∗ = d(P, f ∗) between f and P. d(f , P) = maxi |f (xi) − yi| when P = {(x1, y1) . . . (xn, yn)}

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 3 / 20

slide-6
SLIDE 6

Problem statement

ε∗ ε∗

INPUT: a set P of n points and an integer k. OUTPUT: a step function f ∗ with k steps that minimizes the maximum vertical distance ε∗ = d(P, f ∗) between f and P. d(f , P) = maxi |f (xi) − yi| when P = {(x1, y1) . . . (xn, yn)}

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 3 / 20

slide-7
SLIDE 7

Our results

An O(n log n) time algorithm.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 4 / 20

slide-8
SLIDE 8

Our results

An O(n log n) time algorithm.

◮ based on Frederickson and Johnson’s sorted matrix searching technique.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 4 / 20

slide-9
SLIDE 9

Our results

An O(n log n) time algorithm.

◮ based on Frederickson and Johnson’s sorted matrix searching technique.

An O(n) time algorithm for sorted input.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 4 / 20

slide-10
SLIDE 10

Our results

An O(n log n) time algorithm.

◮ based on Frederickson and Johnson’s sorted matrix searching technique.

An O(n) time algorithm for sorted input.

◮ based on Frederickson’s path partitioning algorithm, and the data

structure by Gabow, Bentley, and Tarjan for range maxima.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 4 / 20

slide-11
SLIDE 11

Our results

An O(n log n) time algorithm.

◮ based on Frederickson and Johnson’s sorted matrix searching technique.

An O(n) time algorithm for sorted input.

◮ based on Frederickson’s path partitioning algorithm, and the data

structure by Gabow, Bentley, and Tarjan for range maxima.

An O(n log4 n) time algorithm for the weighted case.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 4 / 20

slide-12
SLIDE 12

Our results

An O(n log n) time algorithm.

◮ based on Frederickson and Johnson’s sorted matrix searching technique.

An O(n) time algorithm for sorted input.

◮ based on Frederickson’s path partitioning algorithm, and the data

structure by Gabow, Bentley, and Tarjan for range maxima.

An O(n log4 n) time algorithm for the weighted case. An O(n log n · h2) time algorithm when h outliers are allowed.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 4 / 20

slide-13
SLIDE 13

Previous work

Di´ az-B´ a˜ nez and Mesa (2001): O(n2 log n).

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 5 / 20

slide-14
SLIDE 14

Previous work

Di´ az-B´ a˜ nez and Mesa (2001): O(n2 log n). Wang (2002): O(n2).

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 5 / 20

slide-15
SLIDE 15

Previous work

Di´ az-B´ a˜ nez and Mesa (2001): O(n2 log n). Wang (2002): O(n2). Mayster and Lopez (2006): O(min(n2, nk log n)).

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 5 / 20

slide-16
SLIDE 16

Previous work

Di´ az-B´ a˜ nez and Mesa (2001): O(n2 log n). Wang (2002): O(n2). Mayster and Lopez (2006): O(min(n2, nk log n)). Guha and Shim (2007): O(n + k2 log n), and O(n log n + k2 log6 n) for the weighted case.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 5 / 20

slide-17
SLIDE 17

Previous work

Di´ az-B´ a˜ nez and Mesa (2001): O(n2 log n). Wang (2002): O(n2). Mayster and Lopez (2006): O(min(n2, nk log n)). Guha and Shim (2007): O(n + k2 log n), and O(n log n + k2 log6 n) for the weighted case. Mayster and Lopez (2008): O(n2) for the weighted case.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 5 / 20

slide-18
SLIDE 18

Previous work

Di´ az-B´ a˜ nez and Mesa (2001): O(n2 log n). Wang (2002): O(n2). Mayster and Lopez (2006): O(min(n2, nk log n)). Guha and Shim (2007): O(n + k2 log n), and O(n log n + k2 log6 n) for the weighted case. Mayster and Lopez (2008): O(n2) for the weighted case. In databases, the problem is known as the problem of computing a Maximum Error Histogram.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 5 / 20

slide-19
SLIDE 19

Decision algorithm

Decision problem: given P, k, ε > 0, is there a k-step function f such that d(P, f ) ε?

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 6 / 20

slide-20
SLIDE 20

Decision algorithm

Decision problem: given P, k, ε > 0, is there a k-step function f such that d(P, f ) ε? Simple O(n) time greedy algorithm by Di´ az-B´ a˜ nez and Mesa:

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 6 / 20

slide-21
SLIDE 21

Decision algorithm

Decision problem: given P, k, ε > 0, is there a k-step function f such that d(P, f ) ε? Simple O(n) time greedy algorithm by Di´ az-B´ a˜ nez and Mesa:

ε

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 6 / 20

slide-22
SLIDE 22

Decision algorithm

Decision problem: given P, k, ε > 0, is there a k-step function f such that d(P, f ) ε? Simple O(n) time greedy algorithm by Di´ az-B´ a˜ nez and Mesa:

ε

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 6 / 20

slide-23
SLIDE 23

Decision algorithm

Decision problem: given P, k, ε > 0, is there a k-step function f such that d(P, f ) ε? Simple O(n) time greedy algorithm by Di´ az-B´ a˜ nez and Mesa:

ε

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 6 / 20

slide-24
SLIDE 24

Decision algorithm

Decision problem: given P, k, ε > 0, is there a k-step function f such that d(P, f ) ε? Simple O(n) time greedy algorithm by Di´ az-B´ a˜ nez and Mesa:

ε

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 6 / 20

slide-25
SLIDE 25

Decision algorithm

Decision problem: given P, k, ε > 0, is there a k-step function f such that d(P, f ) ε? Simple O(n) time greedy algorithm by Di´ az-B´ a˜ nez and Mesa:

ε

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 6 / 20

slide-26
SLIDE 26

Decision algorithm

Decision problem: given P, k, ε > 0, is there a k-step function f such that d(P, f ) ε? Simple O(n) time greedy algorithm by Di´ az-B´ a˜ nez and Mesa:

ε

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 6 / 20

slide-27
SLIDE 27

Decision algorithm

Decision problem: given P, k, ε > 0, is there a k-step function f such that d(P, f ) ε? Simple O(n) time greedy algorithm by Di´ az-B´ a˜ nez and Mesa:

ε

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 6 / 20

slide-28
SLIDE 28

Decision algorithm

Decision problem: given P, k, ε > 0, is there a k-step function f such that d(P, f ) ε? Simple O(n) time greedy algorithm by Di´ az-B´ a˜ nez and Mesa:

ε

FALSE if k = 3

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 6 / 20

slide-29
SLIDE 29

Decision algorithm

Decision problem: given P, k, ε > 0, is there a k-step function f such that d(P, f ) ε? Simple O(n) time greedy algorithm by Di´ az-B´ a˜ nez and Mesa:

ε

FALSE if k = 3 TRUE if k = 4

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 6 / 20

slide-30
SLIDE 30

Optimization algorithm

{y1, . . . , yn} denote the y-coordinates of points in P.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 7 / 20

slide-31
SLIDE 31

Optimization algorithm

{y1, . . . , yn} denote the y-coordinates of points in P. Let εij = 1

2(yi − yj).

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 7 / 20

slide-32
SLIDE 32

Optimization algorithm

{y1, . . . , yn} denote the y-coordinates of points in P. Let εij = 1

2(yi − yj).

Then ε∗ = εij for some i, j.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 7 / 20

slide-33
SLIDE 33

Optimization algorithm

{y1, . . . , yn} denote the y-coordinates of points in P. Let εij = 1

2(yi − yj).

Then ε∗ = εij for some i, j. Simple algorithm:

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 7 / 20

slide-34
SLIDE 34

Optimization algorithm

{y1, . . . , yn} denote the y-coordinates of points in P. Let εij = 1

2(yi − yj).

Then ε∗ = εij for some i, j. Simple algorithm:

◮ Sort the εij’s: O(n2 log n) time.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 7 / 20

slide-35
SLIDE 35

Optimization algorithm

{y1, . . . , yn} denote the y-coordinates of points in P. Let εij = 1

2(yi − yj).

Then ε∗ = εij for some i, j. Simple algorithm:

◮ Sort the εij’s: O(n2 log n) time. ◮ Perform binary search using the decision algorithm: O(n log n).

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 7 / 20

slide-36
SLIDE 36

Optimization algorithm

{y1, . . . , yn} denote the y-coordinates of points in P. Let εij = 1

2(yi − yj).

Then ε∗ = εij for some i, j. Simple algorithm:

◮ Sort the εij’s: O(n2 log n) time. ◮ Perform binary search using the decision algorithm: O(n log n).

Can be improved to O(n log n) using Frederickson and Johnson’s sorted matrix searching technique.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 7 / 20

slide-37
SLIDE 37

Optimization algorithm

{y1, . . . , yn} denote the y-coordinates of points in P. Let εij = 1

2(yi − yj).

Then ε∗ = εij for some i, j. Simple algorithm:

◮ Sort the εij’s: O(n2 log n) time. ◮ Perform binary search using the decision algorithm: O(n log n).

Can be improved to O(n log n) using Frederickson and Johnson’s sorted matrix searching technique. Let ˜ y1 . . . ˜ yn denote the y-coordinates in sorted order.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 7 / 20

slide-38
SLIDE 38

Optimization algorithm

{y1, . . . , yn} denote the y-coordinates of points in P. Let εij = 1

2(yi − yj).

Then ε∗ = εij for some i, j. Simple algorithm:

◮ Sort the εij’s: O(n2 log n) time. ◮ Perform binary search using the decision algorithm: O(n log n).

Can be improved to O(n log n) using Frederickson and Johnson’s sorted matrix searching technique. Let ˜ y1 . . . ˜ yn denote the y-coordinates in sorted order. Let Mij = 1

2 (˜

yi − ˜ yn+1−j).

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 7 / 20

slide-39
SLIDE 39

Optimization algorithm

{y1, . . . , yn} denote the y-coordinates of points in P. Let εij = 1

2(yi − yj).

Then ε∗ = εij for some i, j. Simple algorithm:

◮ Sort the εij’s: O(n2 log n) time. ◮ Perform binary search using the decision algorithm: O(n log n).

Can be improved to O(n log n) using Frederickson and Johnson’s sorted matrix searching technique. Let ˜ y1 . . . ˜ yn denote the y-coordinates in sorted order. Let Mij = 1

2 (˜

yi − ˜ yn+1−j). M is a sorted matrix: i i′ and j j′ implies Mij Mi′j′.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 7 / 20

slide-40
SLIDE 40

Searching in a sorted matrix

1 2 3 4 5 6 7 8 2 3 5 6 7 8 9 10 3 6 7 8 10 11 12 13 4 7 8 9 11 12 13 15 6 9 10 11 12 14 15 17 7 10 11 13 14 16 17 18 8 12 13 14 15 18 19 20 9 13 14 16 17 19 21 23 a sorted matrix M

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 8 / 20

slide-41
SLIDE 41

Searching in a sorted matrix

1 2 3 4 5 6 7 8 2 3 5 6 7 8 9 10 3 6 7 8 10 11 12 13 4 7 8 9 11 12 13 15 6 9 10 11 12 14 15 17 7 10 11 13 14 16 17 18 8 12 13 14 15 18 19 20 9 13 14 16 17 19 21 23 a sorted matrix M an increasing boolean function g: there exists x∗ such that g(x) = FALSE for all x < x∗, and g(x) = TRUE for all x x∗.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 8 / 20

slide-42
SLIDE 42

Searching in a sorted matrix

1 2 3 4 5 6 7 8 2 3 5 6 7 8 9 10 3 6 7 8 10 11 12 13 4 7 8 9 11 12 13 15 6 9 10 11 12 14 15 17 7 10 11 13 14 16 17 18 8 12 13 14 15 18 19 20 9 13 14 16 17 19 21 23 a sorted matrix M an increasing boolean function g: there exists x∗ such that g(x) = FALSE for all x < x∗, and g(x) = TRUE for all x x∗. Problem: search for x∗ in M.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 8 / 20

slide-43
SLIDE 43

Searching in a sorted matrix

1 2 3 4 5 6 7 8 2 3 5 6 7 8 9 10 3 6 7 8 10 11 12 13 4 7 8 9 11 12 13 15 6 9 10 11 12 14 15 17 7 10 11 13 14 16 17 18 8 12 13 14 15 18 19 20 9 13 14 16 17 19 21 23 smallest elements in submatrices: {1, 5, 6, 12}; median=6.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 9 / 20

slide-44
SLIDE 44

Searching in a sorted matrix

1 2 3 4 5 6 7 8 2 3 5 6 7 8 9 10 3 6 7 8 10 11 12 13 4 7 8 9 11 12 13 15 6 9 10 11 12 14 15 17 7 10 11 13 14 16 17 18 8 12 13 14 15 18 19 20 9 13 14 16 17 19 21 23 smallest elements in submatrices: {1, 5, 6, 12}; median=6. largest elements in submatrices: {9, 15, 16, 23}; median=16.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 9 / 20

slide-45
SLIDE 45

Searching in a sorted matrix

1 2 3 4 5 6 7 8 2 3 5 6 7 8 9 10 3 6 7 8 10 11 12 13 4 7 8 9 11 12 13 15 6 9 10 11 12 14 15 17 7 10 11 13 14 16 17 18 8 12 13 14 15 18 19 20 9 13 14 16 17 19 21 23 smallest elements in submatrices: {1, 5, 6, 12}; median=6. largest elements in submatrices: {9, 15, 16, 23}; median=16. we compute g(6) = FALSE and g(16) = TRUE.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 9 / 20

slide-46
SLIDE 46

Searching in a sorted matrix

1 2 3 4 5 6 7 8 2 3 5 6 7 8 9 10 3 6 7 8 10 11 12 13 4 7 8 9 11 12 13 15 6 9 10 11 12 14 15 17 7 10 11 13 14 16 17 18 8 12 13 14 15 18 19 20 9 13 14 16 17 19 21 23 smallest elements in submatrices: {1, 5, 6, 12}; median=6. largest elements in submatrices: {9, 15, 16, 23}; median=16. we compute g(6) = FALSE and g(16) = TRUE. we did not make progress.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 9 / 20

slide-47
SLIDE 47

Searching in a sorted matrix

1 2 3 4 5 6 7 8 2 3 5 6 7 8 9 10 3 6 7 8 10 11 12 13 4 7 8 9 11 12 13 15 6 9 10 11 12 14 15 17 7 10 11 13 14 16 17 18 8 12 13 14 15 18 19 20 9 13 14 16 17 19 21 23 smallest elements: {1, 3, 5, 6, 7, 8, 10, 12, 13, 15, 19}; median=8.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 10 / 20

slide-48
SLIDE 48

Searching in a sorted matrix

1 2 3 4 5 6 7 8 2 3 5 6 7 8 9 10 3 6 7 8 10 11 12 13 4 7 8 9 11 12 13 15 6 9 10 11 12 14 15 17 7 10 11 13 14 16 17 18 8 12 13 14 15 18 19 20 9 13 14 16 17 19 21 23 smallest elements: {1, 3, 5, 6, 7, 8, 10, 12, 13, 15, 19}; median=8. largest elements: {3, 6, 7, 8, 9, 10, 12, 13, 15, 16, 18, 19, 23}; median=12.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 10 / 20

slide-49
SLIDE 49

Searching in a sorted matrix

1 2 3 4 5 6 7 8 2 3 5 6 7 8 9 10 3 6 7 8 10 11 12 13 4 7 8 9 11 12 13 15 6 9 10 11 12 14 15 17 7 10 11 13 14 16 17 18 8 12 13 14 15 18 19 20 9 13 14 16 17 19 21 23 smallest elements: {1, 3, 5, 6, 7, 8, 10, 12, 13, 15, 19}; median=8. largest elements: {3, 6, 7, 8, 9, 10, 12, 13, 15, 16, 18, 19, 23}; median=12. we compute g(8) = FALSE and g(12) = TRUE.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 10 / 20

slide-50
SLIDE 50

Searching in a sorted matrix

1 2 3 4 5 6 7 8 2 3 5 6 7 8 9 10 3 6 7 8 10 11 12 13 4 7 8 9 11 12 13 15 6 9 10 11 12 14 15 17 7 10 11 13 14 16 17 18 8 12 13 14 15 18 19 20 9 13 14 16 17 19 21 23 smallest elements: {1, 3, 5, 6, 7, 8, 10, 12, 13, 15, 19}; median=8. largest elements: {3, 6, 7, 8, 9, 10, 12, 13, 15, 16, 18, 19, 23}; median=12. we compute g(8) = FALSE and g(12) = TRUE. we can discard 8 submatrices.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 10 / 20

slide-51
SLIDE 51

Searching in a sorted matrix

7 8 9 10 7 8 10 11 12 13 8 9 11 12 13 15 6 9 10 11 12 14 7 10 11 13 14 16 8 12 9 13 smallest elements: {1, 3, 5, 6, 7, 8, 10, 12, 13, 15, 19}; median=8. largest elements: {3, 6, 7, 8, 9, 10, 12, 13, 15, 16, 18, 19, 23}; median=12. we compute g(8) = FALSE and g(12) = TRUE. we can discard 8 submatrices.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 11 / 20

slide-52
SLIDE 52

Searching in a sorted matrix

7 8 9 10 7 8 10 11 12 13 8 9 11 12 13 15 6 9 10 11 12 14 7 10 11 13 14 16 8 12 9 13 remaining elements {7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; median=12.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 12 / 20

slide-53
SLIDE 53

Searching in a sorted matrix

7 8 9 10 7 8 10 11 12 13 8 9 11 12 13 15 6 9 10 11 12 14 7 10 11 13 14 16 8 12 9 13 remaining elements {7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; median=12. we compute g(12) = TRUE

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 12 / 20

slide-54
SLIDE 54

Searching in a sorted matrix

7 8 9 10 7 8 10 11 12 13 8 9 11 12 13 15 6 9 10 11 12 14 7 10 11 13 14 16 8 12 9 13 remaining elements {7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; median=12. we compute g(12) = TRUE we discard all elements > 12.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 12 / 20

slide-55
SLIDE 55

Searching in a sorted matrix

7 8 9 10 7 8 10 11 12 8 9 11 12 6 9 10 11 12 7 10 11 8 12 9 repeat until one value is left.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 13 / 20

slide-56
SLIDE 56

Searching in a sorted matrix

7 8 9 10 7 8 10 11 12 8 9 11 12 6 9 10 11 12 7 10 11 8 12 9 repeat until one value is left. O(log n) calls to the decision algorithm

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 13 / 20

slide-57
SLIDE 57

Searching in a sorted matrix

7 8 9 10 7 8 10 11 12 8 9 11 12 6 9 10 11 12 7 10 11 8 12 9 repeat until one value is left. O(log n) calls to the decision algorithm O(n log n) time for the rest of the algorithm, assuming each matrix element can be accessed in O(1) time.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 13 / 20

slide-58
SLIDE 58

Searching in a sorted matrix

7 8 9 10 7 8 10 11 12 8 9 11 12 6 9 10 11 12 7 10 11 8 12 9 repeat until one value is left. O(log n) calls to the decision algorithm O(n log n) time for the rest of the algorithm, assuming each matrix element can be accessed in O(1) time. Therefore, we can compute an optimal step function in O(n log n) time.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 13 / 20

slide-59
SLIDE 59

Path partitioning

INPUT: a path P with n weighted nodes, and an integer k

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 14 / 20

slide-60
SLIDE 60

Path partitioning

INPUT: a path P with n weighted nodes, and an integer k OUTPUT: a partition of P into k subpaths that minimizes the maximum weight of the subpaths.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 14 / 20

slide-61
SLIDE 61

Path partitioning

INPUT: a path P with n weighted nodes, and an integer k OUTPUT: a partition of P into k subpaths that minimizes the maximum weight of the subpaths. Example: weights {3, 1, 4, 3, 2, 4, 1}, k = 3.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 14 / 20

slide-62
SLIDE 62

Path partitioning

INPUT: a path P with n weighted nodes, and an integer k OUTPUT: a partition of P into k subpaths that minimizes the maximum weight of the subpaths. Example: weights {3, 1, 4, 3, 2, 4, 1}, k = 3. Answer: {3, 1}, {4, 3}, {2, 4, 1}. Max weight=7.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 14 / 20

slide-63
SLIDE 63

Path partitioning

INPUT: a path P with n weighted nodes, and an integer k OUTPUT: a partition of P into k subpaths that minimizes the maximum weight of the subpaths. Example: weights {3, 1, 4, 3, 2, 4, 1}, k = 3. Answer: {3, 1}, {4, 3}, {2, 4, 1}. Max weight=7. The path partitioning problem can be solved in O(n log n) time by sorted matrix searching.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 14 / 20

slide-64
SLIDE 64

Path partitioning

INPUT: a path P with n weighted nodes, and an integer k OUTPUT: a partition of P into k subpaths that minimizes the maximum weight of the subpaths. Example: weights {3, 1, 4, 3, 2, 4, 1}, k = 3. Answer: {3, 1}, {4, 3}, {2, 4, 1}. Max weight=7. The path partitioning problem can be solved in O(n log n) time by sorted matrix searching. Frederickson found an optimal O(n) time algorithm for path partitioning.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 14 / 20

slide-65
SLIDE 65

Path partitioning

INPUT: a path P with n weighted nodes, and an integer k OUTPUT: a partition of P into k subpaths that minimizes the maximum weight of the subpaths. Example: weights {3, 1, 4, 3, 2, 4, 1}, k = 3. Answer: {3, 1}, {4, 3}, {2, 4, 1}. Max weight=7. The path partitioning problem can be solved in O(n log n) time by sorted matrix searching. Frederickson found an optimal O(n) time algorithm for path partitioning. This algorithm works in the following, more general case:

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 14 / 20

slide-66
SLIDE 66

General framework

Σ an alphabet (e.g. Σ = {a, b} or Σ = R)

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 15 / 20

slide-67
SLIDE 67

General framework

Σ an alphabet (e.g. Σ = {a, b} or Σ = R) θ: Σ∗ → R+ with θ(e) = 0

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 15 / 20

slide-68
SLIDE 68

General framework

Σ an alphabet (e.g. Σ = {a, b} or Σ = R) θ: Σ∗ → R+ with θ(e) = 0 MIN-MAX PARTITION(θ) problem:

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 15 / 20

slide-69
SLIDE 69

General framework

Σ an alphabet (e.g. Σ = {a, b} or Σ = R) θ: Σ∗ → R+ with θ(e) = 0 MIN-MAX PARTITION(θ) problem:

◮ Given w ∈ Σ∗ and k > 0, compute a factorization w = w1w2 . . . wk

minimizing max

i∈{1,...,k} θ(wi)

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 15 / 20

slide-70
SLIDE 70

General framework

Σ an alphabet (e.g. Σ = {a, b} or Σ = R) θ: Σ∗ → R+ with θ(e) = 0 MIN-MAX PARTITION(θ) problem:

◮ Given w ∈ Σ∗ and k > 0, compute a factorization w = w1w2 . . . wk

minimizing max

i∈{1,...,k} θ(wi)

Frederickson’s problem is obtained with:

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 15 / 20

slide-71
SLIDE 71

General framework

Σ an alphabet (e.g. Σ = {a, b} or Σ = R) θ: Σ∗ → R+ with θ(e) = 0 MIN-MAX PARTITION(θ) problem:

◮ Given w ∈ Σ∗ and k > 0, compute a factorization w = w1w2 . . . wk

minimizing max

i∈{1,...,k} θ(wi)

Frederickson’s problem is obtained with:

◮ Σ = R+

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 15 / 20

slide-72
SLIDE 72

General framework

Σ an alphabet (e.g. Σ = {a, b} or Σ = R) θ: Σ∗ → R+ with θ(e) = 0 MIN-MAX PARTITION(θ) problem:

◮ Given w ∈ Σ∗ and k > 0, compute a factorization w = w1w2 . . . wk

minimizing max

i∈{1,...,k} θ(wi)

Frederickson’s problem is obtained with:

◮ Σ = R+ ◮ θ(a1 . . . ap) = a1 + . . . + ap

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 15 / 20

slide-73
SLIDE 73

General framework

Let Σ be an alphabet, and θ : Σ∗ → R+ be a mapping such that θ(e) = 0. Suppose that θ has the following properties:

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 16 / 20

slide-74
SLIDE 74

General framework

Let Σ be an alphabet, and θ : Σ∗ → R+ be a mapping such that θ(e) = 0. Suppose that θ has the following properties:

(i) θ is non-decreasing, that is, θ(v) θ(uvw) for all u, v, w ∈ Σ∗.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 16 / 20

slide-75
SLIDE 75

General framework

Let Σ be an alphabet, and θ : Σ∗ → R+ be a mapping such that θ(e) = 0. Suppose that θ has the following properties:

(i) θ is non-decreasing, that is, θ(v) θ(uvw) for all u, v, w ∈ Σ∗. (ii) We can preprocess a1 . . . an ∈ Σn in time π(n) so that, given any query (i, j), we can compute θ(ai . . . aj) in time κ(n).

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 16 / 20

slide-76
SLIDE 76

General framework

Let Σ be an alphabet, and θ : Σ∗ → R+ be a mapping such that θ(e) = 0. Suppose that θ has the following properties:

(i) θ is non-decreasing, that is, θ(v) θ(uvw) for all u, v, w ∈ Σ∗. (ii) We can preprocess a1 . . . an ∈ Σn in time π(n) so that, given any query (i, j), we can compute θ(ai . . . aj) in time κ(n).

Then MIN-MAX PARTITION(θ) can be solved in time O(π(n) + nκ(n)).

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 16 / 20

slide-77
SLIDE 77

General framework

Let Σ be an alphabet, and θ : Σ∗ → R+ be a mapping such that θ(e) = 0. Suppose that θ has the following properties:

(i) θ is non-decreasing, that is, θ(v) θ(uvw) for all u, v, w ∈ Σ∗. (ii) We can preprocess a1 . . . an ∈ Σn in time π(n) so that, given any query (i, j), we can compute θ(ai . . . aj) in time κ(n).

Then MIN-MAX PARTITION(θ) can be solved in time O(π(n) + nκ(n)). Example: path partitioning.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 16 / 20

slide-78
SLIDE 78

General framework

Let Σ be an alphabet, and θ : Σ∗ → R+ be a mapping such that θ(e) = 0. Suppose that θ has the following properties:

(i) θ is non-decreasing, that is, θ(v) θ(uvw) for all u, v, w ∈ Σ∗. (ii) We can preprocess a1 . . . an ∈ Σn in time π(n) so that, given any query (i, j), we can compute θ(ai . . . aj) in time κ(n).

Then MIN-MAX PARTITION(θ) can be solved in time O(π(n) + nκ(n)). Example: path partitioning.

◮ Preprocessing: compute Si = i

ℓ=1 ωℓ for all i.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 16 / 20

slide-79
SLIDE 79

General framework

Let Σ be an alphabet, and θ : Σ∗ → R+ be a mapping such that θ(e) = 0. Suppose that θ has the following properties:

(i) θ is non-decreasing, that is, θ(v) θ(uvw) for all u, v, w ∈ Σ∗. (ii) We can preprocess a1 . . . an ∈ Σn in time π(n) so that, given any query (i, j), we can compute θ(ai . . . aj) in time κ(n).

Then MIN-MAX PARTITION(θ) can be solved in time O(π(n) + nκ(n)). Example: path partitioning.

◮ Preprocessing: compute Si = i

ℓ=1 ωℓ for all i.

◮ Query: (i, j) → θ(ωi, . . . , ωj) = j

ℓ=i ωℓ = Sj − Si−1.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 16 / 20

slide-80
SLIDE 80

General framework

Let Σ be an alphabet, and θ : Σ∗ → R+ be a mapping such that θ(e) = 0. Suppose that θ has the following properties:

(i) θ is non-decreasing, that is, θ(v) θ(uvw) for all u, v, w ∈ Σ∗. (ii) We can preprocess a1 . . . an ∈ Σn in time π(n) so that, given any query (i, j), we can compute θ(ai . . . aj) in time κ(n).

Then MIN-MAX PARTITION(θ) can be solved in time O(π(n) + nκ(n)). Example: path partitioning.

◮ Preprocessing: compute Si = i

ℓ=1 ωℓ for all i.

◮ Query: (i, j) → θ(ωi, . . . , ωj) = j

ℓ=i ωℓ = Sj − Si−1.

◮ π(n) = O(n) and κ(n) = O(1), so running time O(n).

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 16 / 20

slide-81
SLIDE 81

Linear-time algorithm for fitting a step function

Application of previous theorem with:

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 17 / 20

slide-82
SLIDE 82

Linear-time algorithm for fitting a step function

Application of previous theorem with: Σ = R

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 17 / 20

slide-83
SLIDE 83

Linear-time algorithm for fitting a step function

Application of previous theorem with: Σ = R θ(a1 . . . ap) = 1

2 (max(a1, . . . , ap) − min(a1, . . . , ap))

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 17 / 20

slide-84
SLIDE 84

Linear-time algorithm for fitting a step function

Application of previous theorem with: Σ = R θ(a1 . . . ap) = 1

2 (max(a1, . . . , ap) − min(a1, . . . , ap))

Range maxima problem:

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 17 / 20

slide-85
SLIDE 85

Linear-time algorithm for fitting a step function

Application of previous theorem with: Σ = R θ(a1 . . . ap) = 1

2 (max(a1, . . . , ap) − min(a1, . . . , ap))

Range maxima problem:

◮ Preprocess a sequence of numbers (y1, . . . , yn) to allow efficient answer

to query (i, j) → max(yi, . . . , yj)

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 17 / 20

slide-86
SLIDE 86

Linear-time algorithm for fitting a step function

Application of previous theorem with: Σ = R θ(a1 . . . ap) = 1

2 (max(a1, . . . , ap) − min(a1, . . . , ap))

Range maxima problem:

◮ Preprocess a sequence of numbers (y1, . . . , yn) to allow efficient answer

to query (i, j) → max(yi, . . . , yj)

◮ Gabow, Bentley, and Tarjan (1984): O(1) query time and O(n) time

preprocessing.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 17 / 20

slide-87
SLIDE 87

Linear-time algorithm for fitting a step function

Application of previous theorem with: Σ = R θ(a1 . . . ap) = 1

2 (max(a1, . . . , ap) − min(a1, . . . , ap))

Range maxima problem:

◮ Preprocess a sequence of numbers (y1, . . . , yn) to allow efficient answer

to query (i, j) → max(yi, . . . , yj)

◮ Gabow, Bentley, and Tarjan (1984): O(1) query time and O(n) time

preprocessing.

Conclusion: the sorted case can be solved in O(n) time.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 17 / 20

slide-88
SLIDE 88

Weighted version

Given a set of points in the plane {(x1, y1), . . . , (xn, yn)} with positive weights µ1, . . . , µn and an integer k > 0, compute a k-step function f such that max

1in µi|f (xi) − yi|

is minimized.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 18 / 20

slide-89
SLIDE 89

Weighted version

Given a set of points in the plane {(x1, y1), . . . , (xn, yn)} with positive weights µ1, . . . , µn and an integer k > 0, compute a k-step function f such that max

1in µi|f (xi) − yi|

is minimized.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 18 / 20

slide-90
SLIDE 90

Weighted version

Given a set of points in the plane {(x1, y1), . . . , (xn, yn)} with positive weights µ1, . . . , µn and an integer k > 0, compute a k-step function f such that max

1in µi|f (xi) − yi|

is minimized. Data structure by Guha and Shim: preprocessing π(n) = O(n log n) and query time κ(n) = O(log4 n).

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 18 / 20

slide-91
SLIDE 91

Weighted version

Given a set of points in the plane {(x1, y1), . . . , (xn, yn)} with positive weights µ1, . . . , µn and an integer k > 0, compute a k-step function f such that max

1in µi|f (xi) − yi|

is minimized. Data structure by Guha and Shim: preprocessing π(n) = O(n log n) and query time κ(n) = O(log4 n). So we obtain an O(n log4 n) time algorithm.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 18 / 20

slide-92
SLIDE 92

Weighted version

Given a set of points in the plane {(x1, y1), . . . , (xn, yn)} with positive weights µ1, . . . , µn and an integer k > 0, compute a k-step function f such that max

1in µi|f (xi) − yi|

is minimized. Data structure by Guha and Shim: preprocessing π(n) = O(n log n) and query time κ(n) = O(log4 n). So we obtain an O(n log4 n) time algorithm. Guha and Shim gave an O(n log n + k2 log6 n) time algorithm.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 18 / 20

slide-93
SLIDE 93

Frederickson’s algorithm (sketch)

Partition a1a2 . . . an into n/r factors of length r, for r = ⌈log n⌉.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 19 / 20

slide-94
SLIDE 94

Frederickson’s algorithm (sketch)

Partition a1a2 . . . an into n/r factors of length r, for r = ⌈log n⌉. construct a collection of submatrices, each submatrix corresponding to one factor.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 19 / 20

slide-95
SLIDE 95

Frederickson’s algorithm (sketch)

Partition a1a2 . . . an into n/r factors of length r, for r = ⌈log n⌉. construct a collection of submatrices, each submatrix corresponding to one factor. apply the matrix searching technique on this collection of submatrices, until O(n/r2) elements remain.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 19 / 20

slide-96
SLIDE 96

Frederickson’s algorithm (sketch)

Partition a1a2 . . . an into n/r factors of length r, for r = ⌈log n⌉. construct a collection of submatrices, each submatrix corresponding to one factor. apply the matrix searching technique on this collection of submatrices, until O(n/r2) elements remain. using this information, we do some preprocessing on each subinterval that is not associated with any remaining matrix element.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 19 / 20

slide-97
SLIDE 97

Frederickson’s algorithm (sketch)

Partition a1a2 . . . an into n/r factors of length r, for r = ⌈log n⌉. construct a collection of submatrices, each submatrix corresponding to one factor. apply the matrix searching technique on this collection of submatrices, until O(n/r2) elements remain. using this information, we do some preprocessing on each subinterval that is not associated with any remaining matrix element. it gives us an O(n log log n/ log n) time decision algorithm.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 19 / 20

slide-98
SLIDE 98

Frederickson’s algorithm (sketch)

Partition a1a2 . . . an into n/r factors of length r, for r = ⌈log n⌉. construct a collection of submatrices, each submatrix corresponding to one factor. apply the matrix searching technique on this collection of submatrices, until O(n/r2) elements remain. using this information, we do some preprocessing on each subinterval that is not associated with any remaining matrix element. it gives us an O(n log log n/ log n) time decision algorithm. using it to search the whole matrix, we get an O(n log log n)

  • ptimization algorithm.
  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 19 / 20

slide-99
SLIDE 99

Frederickson’s algorithm (sketch)

Partition a1a2 . . . an into n/r factors of length r, for r = ⌈log n⌉. construct a collection of submatrices, each submatrix corresponding to one factor. apply the matrix searching technique on this collection of submatrices, until O(n/r2) elements remain. using this information, we do some preprocessing on each subinterval that is not associated with any remaining matrix element. it gives us an O(n log log n/ log n) time decision algorithm. using it to search the whole matrix, we get an O(n log log n)

  • ptimization algorithm.

It can be improved to O(n log∗ n) by cutting the factors recursively.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 19 / 20

slide-100
SLIDE 100

Frederickson’s algorithm (sketch)

Partition a1a2 . . . an into n/r factors of length r, for r = ⌈log n⌉. construct a collection of submatrices, each submatrix corresponding to one factor. apply the matrix searching technique on this collection of submatrices, until O(n/r2) elements remain. using this information, we do some preprocessing on each subinterval that is not associated with any remaining matrix element. it gives us an O(n log log n/ log n) time decision algorithm. using it to search the whole matrix, we get an O(n log log n)

  • ptimization algorithm.

It can be improved to O(n log∗ n) by cutting the factors recursively. It can be further improved to O(n), using careful counting arguments.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 19 / 20

slide-101
SLIDE 101

Conclusion

Our algorithms for the unweighted cases (sorted and unsorted) are

  • ptimal.
  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 20 / 20

slide-102
SLIDE 102

Conclusion

Our algorithms for the unweighted cases (sorted and unsorted) are

  • ptimal.

In the weighted case, there may be room for improvement.

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 20 / 20

slide-103
SLIDE 103

Conclusion

Our algorithms for the unweighted cases (sorted and unsorted) are

  • ptimal.

In the weighted case, there may be room for improvement. Are there other applications of the general formulation of Frederickson’s linear time algorithm?

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 20 / 20

slide-104
SLIDE 104

Conclusion

Our algorithms for the unweighted cases (sorted and unsorted) are

  • ptimal.

In the weighted case, there may be room for improvement. Are there other applications of the general formulation of Frederickson’s linear time algorithm?

◮ Is there a simple randomized algorithm?

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 20 / 20

slide-105
SLIDE 105

Conclusion

Our algorithms for the unweighted cases (sorted and unsorted) are

  • ptimal.

In the weighted case, there may be room for improvement. Are there other applications of the general formulation of Frederickson’s linear time algorithm?

◮ Is there a simple randomized algorithm?

L1-problem: minimize the sum of the vertical distances between P and f .

  • H. Fournier and A. Vigneron (UVSQ, INRA)

Fitting a Step Function to a Point Set December 4, 2008 20 / 20