Title: Correctness of Constructing Optimal Alphabetic Trees Revisited
1Correctness of Constructing Optimal Alphabetic
Trees Revisited
Theoretical computer science 180 (1997) 309-324
- Marek Karpinski,
- Lawrence L. Larmore,
- Wojciech Rytter
2Outline
- Definitions
- General version of Garsia-Wachs (GW) algorithm
- Proof of GW
- Hu-Tacker (HT) algorithm
- Proof of HT by similarity to GW
3Definitions
Binary tree Every internal node has exactly two
sons
4Definitions
5The Move Operator
6The Move Operator
7The Move Operator
8The Move Operator
9Definitions
10Theorem 1 (correctness of GW)
11Garsia-Wachs Algorithm
12Definitions
13Theorem 2
14Shift Operations
15Shift Operations
16LeftShift Example
17LeftShift Example
18LeftShift Example
19LeftShift Example
20LeftShift Example
21LeftShift Example
22LeftShift Example
23LeftShift Example
24LeftShift Example
25Theorem 2
26Proof of Point 2 in Theorem 2
27Proof of Point 2 in Theorem 2
28Proof of Point 3 Theorem 2
29Definition of Well Shaped Segments
30Definition of Well Shaped Segments
Active Window
31Movability Lemma
If the segment i,,j is left well shaped, then
the active pair (i,i1) 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.
32Movability Lemma
33Movability Lemma
34Movability Lemma
35Movability Lemma
36Movability Lemma
37Theorem 3
38Point 1 in Theorem 2
39Hu-Tucker Algorithm
Transparent items and opaque items
Compatible pair No opaque items in the middle
Minimal compatible pair (mcp) compatible pair
(i,i1) where Weight(i) weight(i1) is minimal
Tie Breaking Rule
40Hu-Tucker Algorithm
41Hu-Tucker Algorithm
42Hu-Tucker Algorithm
43Hu-Tucker Algorithm
44GW Algorithm
gmp Globaly Minimal Pair
GW - the same as GW but always choose gmp
instead of some other lmp.
45Definitions
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)
46MoveTransparent
47MoveTransparent
48MoveTransparent
49MoveTransparent
50MoveTransparent
51MoveTransparent
52MoveTransparent
53MoveTransparent
54MoveTransparent
55MoveTransparent
56MoveTransparent
57MoveTransparent
58MoveTransparent
59MoveTransparent
60MoveTransparent
61MoveTransparent
62The Simulation Lemma
Assuming there are no ties
63Proof of the Simulation Lemma
Claim A
Claim B
64Proof of Claim A
By contradiction assume that w,u are not visible
to each other. This means there is an opaque item
q between them. Two cases
65Proof of Claim A
Contradiction no place for q
66Proof of Claim A
67Proof of Claim A
Contradiction no place for q
68Proof of Claim B
Claim B
Proof
69Proof of Claim B
The order of movements is from right to left,
thus w is Processed first then the items between
u and w, and then u. At this point u and w must
be adjacent, thus q must be processed later, and
thus it is to the left of u.
q is not visible from u because (u,w) is mcp
70Proof of Claim B
Let q be the opaque item between q and u visible
from u
Contradiction
71Conclusion
72Claim C
73Proof of claim C
74Proof of Simulation Lemma
The proof of the lemma is by induction
75Tie Braking Rule
Theorem 4 The Tie Breaking Rule (TBR) is correct
Proof
76Proof of TBR
Case 1 All weights are strictly positive
77Proof of TBR
Case 2 Some of the original weights are zero