Cut Property
Definition:
- For , consider where: for a MST T
- Take any subset S of vertices where No edge of X crosses
- Let be any minimum weight edge of E crossing
- Then: for a MST T’. (Thus is a partial MST)
Cut Property Proof
We know that for MST T. There are two cases or .
Case 1:
Since and
Then and is a MST
Case 2:
Say , add to T.
T is a tree so there is exactly 1 path P between y & z
Then, has a cycle C =
Union-Find Data Structure
The Union-Find data structure is a collection of sets where each set has a unique name.
Operations:
- Makeset(x): Creates set
- Find(x): Returns root
- Union(x,y): Points root of smaller rank root to larger rank root
Properties:
- Each set is a directed tree:
- Edges point up to the root
- The name of the set is the root element
- Each node has the following:
- rank(x) = height of subtree below x
- (x) = parent of x, note that x is the root the parent of x is x
- Rank only increases when merging two trees of same rank
Union Find Claims
Claim 1
The max depth of a subtree is
Proof:
Let l = # of nodes of rank = k
Then, so
Let then so no nodes of rank
Claim 2
Root of rank has 2 nodes in its subtree (including itself)
Proof:
Induct on .
Base case: , since count root then
Assume true for trees of rank
To get node of rank we merge two trees of rank , thus ’s subtree has