Displays a permutation matrix and two Standard Young Tableaux (P and Q) built step by step via the RSK correspondence. Shows animated or instant row-bumping insertion with color-coded cells. Enter a permutation or generate random ones with uniform or block-structured sampling, then run forward RSK with adjustable animation speed.
Skip to simulation visualization
RSK Algorithm Interactive Visualization
About the RSK Algorithm
The Robinson-Schensted-Knuth (RSK) correspondence is a bijection between permutations and pairs of Standard Young Tableaux (SYT) of the same shape.
This visualization demonstrates both directions:
- Forward RSK: Permutation → (P-tableau, Q-tableau)
- Inverse RSK: (P-tableau, Q-tableau) → Permutation
For large permutations (N > 100), the simulation automatically uses a WebAssembly module for optimal performance.
Current Permutation
P-Tableau (Insertion Tableau)
Q-Tableau (Recording Tableau)
code
(note: parameters in the code might differ from the ones in simulation results below)-
Link to code(This simulation is interactive, written in JavaScript, see the source code of this page at the link) -
Link to code(C++ code for WASM module (handles permutations up to size 10000))