RSK bumping trees and a fast RSK algorithmOverview 1 Robinson-Schensted-Knuth algorithm 2 Bumping...

28
RSK bumping trees and a fast RSK algorithm Vasilii Duzhin 1 , Artem Kuzmin 1 , Nikolay Vassiliev 1,2 1 Saint Petersburg Electrotechnical University ”LETI” 2 Saint Petersburg Department of Steklov Mathematical Institute of Russian Academy of Sciences Polynomial Computer Algebra ’19 April 20, 2019 V. Duzhin , A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 1 / 20

Transcript of RSK bumping trees and a fast RSK algorithmOverview 1 Robinson-Schensted-Knuth algorithm 2 Bumping...

RSK bumping trees and a fast RSK algorithm

Vasilii Duzhin1, Artem Kuzmin1, Nikolay Vassiliev1,2

1Saint Petersburg Electrotechnical University ”LETI”

2Saint Petersburg Department of Steklov Mathematical Institute of Russian Academy ofSciences

Polynomial Computer Algebra ’19April 20, 2019

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 1 / 20

Overview

1 Robinson-Schensted-Knuth algorithm

2 Bumping routes, bumping trees & bumping forest

3 A fast RSK algorithm

4 The comparison of efficiency of RSK algorithms

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 2 / 20

Robinson-Schensted-Knuth (RSK) correspondence

The Robinson-Schensted-Knuth correspondence is a bijection betweena set of permutations of integers and a set of pairs of Young tableaux ofthe same shape: insertion tableau P and recording tableau Q.

For example, the permutation

(13, 2, 16, 4, 7, 9, 12, 1, 3, 20, 11, 6, 18, 14, 5, 19, 17, 10, 8, 15)

corresponds to the following pair of Young tableaux:

P :

1 2 7 12 13

3 4 11 16 20

5 6 18

8 9 19

10 17

14

15

Q :

1 2 8 12 15

3 4 9 18 19

5 11 14

6 13 20

7 17

10

16

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 3 / 20

RSK algorithm

A permutation (s1, s2, ..., sn) generates a tableau P consisting of columns(P1,P2, ...,Pm) of heights (h(P1), h(P2), ..., h(Pm)) as follows.

P = s1For si , i ∈ [2,m]:

If si−1 > max1≤k≤h(Pi )

{Pi ,k}, si −→ the top of Pi . i = i + 1.

Else k = min1≤k≤h(Pi )

{Pi ,k > si}; si −→ Pi ,k . Pi ,k is bumped to the column

Pi+1 by the same principle.

Tableau Q records the changes of shapes of the intermediate tableaux P.

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 4 / 20

RSK algorithm: an example

See RSKexample.pdf

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 5 / 20

RSK: finding the nearest larger value

A problem: low efficiency of the standard algorithm (the complexity ofsearch of position for bumping is proportional to the column heights).

4 22

24

2713

2918

21

31

12

11

8

9

20

28

30

3

19

23

26

2

1

10

14

17

16

25

6 7

52

1

7

3

9

5

4 6

10

8 15

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 6 / 20

Motivation

There are various problems that need to be computed on a largenumber of very long permutations (105 numbers and more).

The performance of the standard RSK is not enough to solve manycomputational tasks.

The computational costs of the standard RSK are mainly caused bysearching a position where the next number should be bumped intableau P.

The goal of this work is to implement a special variant of RSK whichworks significantly faster than the original algorithm.

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 7 / 20

Bumping routes

A bumping route is a sequence of positions in insertion tableau wherebumping occures during the RSK transformation.

2

1

10

4

9

5

3 6

7

8 2

1

10

4

9

5

3 6

7

8 2

1

10

4

9

5

3 6

7

8

The idea: to remember all bumping routes of tableau in advance. In thatcase, we do not need to search a position where the next number shouldbe bumped.

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 8 / 20

Bumping trees

1 2 4 6 12 14 18 22 24 28 41 44 64 71 75 84 87 99

3 5 7 11 20 25 30 33 46 48 51 83 88

8 9 10 15 31 34 42 54 57 68 77 91

13 16 21 23 38 45 53 62 81 92

17 19 26 47 49 56 63 73

27 35 36 55 61

29 37 50 69 80

32 40 60 70 85

39 43 66 76 95

52 65 78

58 67 79

59 82

72 86

74 96

89

90

93

94

97

98

100

A bumping tree is a unionof bumping routes convergingto a same position wherethe shape of tableau can bechanged.

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 9 / 20

Bumping trees

1 2 4 6 12 14 18 22 24 28 41 44 64 71 75 84 87 99

3 5 7 11 20 25 30 33 46 48 51 83 88

8 9 10 15 31 34 42 54 57 68 77 91

13 16 21 23 38 45 53 62 81 92

17 19 26 47 49 56 63 73

27 35 36 55 61

29 37 50 69 80

32 40 60 70 85

39 43 66 76 95

52 65 78

58 67 79

59 82

72 86

74 96

89

90

93

94

97

98

100

A bumping tree is a unionof bumping routes convergingto a same position wherethe shape of tableau can bechanged.

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 9 / 20

Bumping trees

1 2 4 6 12 14 18 22 24 28 41 44 64 71 75 84 87 99

3 5 7 11 20 25 30 33 46 48 51 83 88

8 9 10 15 31 34 42 54 57 68 77 91

13 16 21 23 38 45 53 62 81 92

17 19 26 47 49 56 63 73

27 35 36 55 61

29 37 50 69 80

32 40 60 70 85

39 43 66 76 95

52 65 78

58 67 79

59 82

72 86

74 96

89

90

93

94

97

98

100

A bumping tree is a unionof bumping routes convergingto a same position wherethe shape of tableau can bechanged.

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 9 / 20

Bumping trees

1 2 4 6 12 14 18 22 24 28 41 44 64 71 75 84 87 99

3 5 7 11 20 25 30 33 46 48 51 83 88

8 9 10 15 31 34 42 54 57 68 77 91

13 16 21 23 38 45 53 62 81 92

17 19 26 47 49 56 63 73

27 35 36 55 61

29 37 50 69 80

32 40 60 70 85

39 43 66 76 95

52 65 78

58 67 79

59 82

72 86

74 96

89

90

93

94

97

98

100

A bumping tree is a unionof bumping routes convergingto a same position wherethe shape of tableau can bechanged.

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 9 / 20

Bumping trees

1 2 4 6 12 14 18 22 24 28 41 44 64 71 75 84 87 99

3 5 7 11 20 25 30 33 46 48 51 83 88

8 9 10 15 31 34 42 54 57 68 77 91

13 16 21 23 38 45 53 62 81 92

17 19 26 47 49 56 63 73

27 35 36 55 61

29 37 50 69 80

32 40 60 70 85

39 43 66 76 95

52 65 78

58 67 79

59 82

72 86

74 96

89

90

93

94

97

98

100

A bumping tree is a unionof bumping routes convergingto a same position wherethe shape of tableau can bechanged.

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 9 / 20

Bumping trees

1 2 4 6 12 14 18 22 24 28 41 44 64 71 75 84 87 99

3 5 7 11 20 25 30 33 46 48 51 83 88

8 9 10 15 31 34 42 54 57 68 77 91

13 16 21 23 38 45 53 62 81 92

17 19 26 47 49 56 63 73

27 35 36 55 61

29 37 50 69 80

32 40 60 70 85

39 43 66 76 95

52 65 78

58 67 79

59 82

72 86

74 96

89

90

93

94

97

98

100

A bumping tree is a unionof bumping routes convergingto a same position wherethe shape of tableau can bechanged.

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 9 / 20

Bumping trees

1 2 4 6 12 14 18 22 24 28 41 44 64 71 75 84 87 99

3 5 7 11 20 25 30 33 46 48 51 83 88

8 9 10 15 31 34 42 54 57 68 77 91

13 16 21 23 38 45 53 62 81 92

17 19 26 47 49 56 63 73

27 35 36 55 61

29 37 50 69 80

32 40 60 70 85

39 43 66 76 95

52 65 78

58 67 79

59 82

72 86

74 96

89

90

93

94

97

98

100

A bumping tree is a unionof bumping routes convergingto a same position wherethe shape of tableau can bechanged.

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 9 / 20

Bumping trees

1 2 4 6 12 14 18 22 24 28 41 44 64 71 75 84 87 99

3 5 7 11 20 25 30 33 46 48 51 83 88

8 9 10 15 31 34 42 54 57 68 77 91

13 16 21 23 38 45 53 62 81 92

17 19 26 47 49 56 63 73

27 35 36 55 61

29 37 50 69 80

32 40 60 70 85

39 43 66 76 95

52 65 78

58 67 79

59 82

72 86

74 96

89

90

93

94

97

98

100

A bumping tree is a unionof bumping routes convergingto a same position wherethe shape of tableau can bechanged.

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 9 / 20

Bumping forest

1 2 4 6 12 14 18 22 24 28 41 44 64 71 75 84 87 99

3 5 7 11 20 25 30 33 46 48 51 83 88

8 9 10 15 31 34 42 54 57 68 77 91

13 16 21 23 38 45 53 62 81 92

17 19 26 47 49 56 63 73

27 35 36 55 61

29 37 50 69 80

32 40 60 70 85

39 43 66 76 95

52 65 78

58 67 79

59 82

72 86

74 96

89

90

93

94

97

98

100

A bumping forest is a unionof all possible bumping routesof a tableau.

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 10 / 20

Bumping forest

A bumping forest is a unionof all possible bumping routesof a tableau.

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 10 / 20

A fast RSK algorithm

Fast RSK is based on maintaining the structure of the bumping forest.The following actions are performed to insert a value si in a tableau P:

Place si in the first column (samely as in the standard algorithm).

While the shape of tableau P has not expanded,

Follow the link and write there the bumped value of s ′. Put the oldvalue into the buffer b.Consequently compare b with the values in the previous column,starting at si and upper.Check the references for all values < b.

Tableau Q is constructed as in the standard algorithm.

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 11 / 20

A fast RSK algorithm: an example

See FastRSK.avi

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 12 / 20

Bumping routes

0

2000

4000

6000

8000

10000

12000

14000

16000

18000

20000

0 2000 4000 6000 8000 10000 12000 14000 16000 18000 20000

Some bumping routesof the random Youngtableau of size 108.

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 13 / 20

Limit shapes of bumping routes

The asymptotic behaviour of limit shapes of bumping routes was studiedin [Romik, Sniady ’14].

Bumping routes (n = 104) Limit shapes

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 14 / 20

The comparison of efficiency of RSK algorithms

Blue curve is the running time of standard algorithm,Red curve is the running time of fast algorithm.

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 15 / 20

The comparison of efficiency of RSK algorithms

Permutation size Elapsed time by Elapsed time bystandard RSK (in sec) fast RSK (in sec)

100.000 4.78 0.49200.000 14.90 1.32300.000 28.69 2.41400.000 47.34 3.70500.000 72.03 5.26600.000 102.37 6.93700.000 137.873 8.78800.000 178.28 10.79900.000 223.23 12.96

1.000.000 272.63 15.35

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 16 / 20

The speed of the fast RSK algorithm

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 17 / 20

Fast RSK: pros and cons

+

1 No need to search the places forbumping.

2 A bumping forest of an insertiontableau is provided.

1 Need to maintain thestructure of a bumpingforest.

2 A bumping forestconsumes extra memory.

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 18 / 20

Future plans

Implementation of the fast inverse RSK algorithm.

Theoretical estimation of speed of fast algorithms.

Massive computations using developed algorithms.

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 19 / 20

Thanks for your attention!

V. Duzhin, A. Kuzmin, N. Vassiliev Bumping trees and a fast RSK algorithm April 20, 2019 20 / 20