770 likes | 923 Views
Correctness of Constructing Optimal Alphabetic Trees Revisited. Theoretical computer science 180 (1997) 309-324. Marek Karpinski, Lawrence L. Larmore, Wojciech Rytter. Outline. Definitions General version of Garsia-Wachs (GW) algorithm Proof of GW Hu-Tacker (HT) algorithm
E N D
Correctness of Constructing Optimal Alphabetic Trees Revisited Theoretical computer science 180 (1997) 309-324 Marek Karpinski, Lawrence L. Larmore, Wojciech Rytter
Outline • Definitions • General version of Garsia-Wachs (GW) algorithm • Proof of GW • Hu-Tacker (HT) algorithm • Proof of HT by similarity to GW
Definitions Binary tree: Every internal node has exactly two sons
Definition of Well Shaped Segments Active Window
Movability Lemma If the segment [i,…,j] is left well shaped, then the active pair (i,i+1) can be moved to the other side of the segment by locally rearranging sub-trees in the active window without changing the relative order of the other items and without changing the level function of the tree.
Hu-Tucker Algorithm Transparent items and opaque items Compatible pair – No opaque items in the middle Minimal compatible pair (mcp) – compatible pair (i,i+1) where Weight(i) + weight(i+1) is minimal Tie Breaking Rule
GW` Algorithm gmp – Globaly Minimal Pair GW`- the same as GW but always choose gmp instead of some other lmp.
Definitions Normal sequence – sequence of weights Special sequence – sequence of weights, each one is either transparent or opaque MoveTransparent operator – converts a special sequence into a normal sequence and moves all transparent items to their RightPos. (first it moves the rightmost item, then the one to its left, etc…)