Post on 27-May-2015
Permutation Graphs and Applications
Joe Krall
West Virginia University
In this Presentation:
Overview Permutation Graphs
Applications
Sorting Permutations
4/26/2011Permutation Graphs and Applications2
⇨ Let us consider the sequence of natural numbers:
N = [1, 2, 3, …, n]
⇨ Then a permutation is a sequence as follows:
π = [π1, π2, π3, …, πn], Where, πi = Nj
⇨ Ex: N = [1, 2, 3, 4], π = [3, 4, 2, 1].
Note there are many permutations for N.
IntroductionPermutationsInversion GraphsPermutation GraphsProperties
4/26/2011Permutation Graphs and Applications3
⇨ Given a permutation π, we can construct a graph:
⇨ Example:
N = [1, 2, 3, 4, 5, 6]
π = [4, 3, 6, 1, 5, 2]
Given a permutation π, then G[π] is called the Inversion Graph of π. There is an edge between πi and πj IFF their order is inverted.
1 2
4
3
6
5
IntroductionPermutationsInversion GraphsPermutation GraphsProperties
4/26/2011Permutation Graphs and Applications4
⇨ Consider an ordinary graph, G.
A permutation always exists.
But, the inversion graph may not be isomorphic to G.
An undirected graph G is called a Permutation Graph if there exists a permutation π, such that G ≅ G[π].
IntroductionPermutationsInversion GraphsPermutation GraphsProperties
4/26/2011Permutation Graphs and Applications5
⇨ Interesting Properties
Reversing the order of π gives us the complement
The complement is also a permutation graph
Transitively Orientable
Orient each edge towards its “larger” endpoint
Permutation Graphs are Perfect
Also:
Theorem 7.1: A graph is a permutation graph IFF G
and G’ are comparability graphs.
IntroductionPermutationsInversion GraphsPermutation GraphsProperties
Applications
4/26/2011Permutation Graphs and Applications6
⇨ Matching Diagram
Suppose a parallel listing of numbers in both N and π.
Matching Diagrams characterize Permutation Graphs
Because adjacencies only happen due to inversions
1 2 43 65
1 24 3 6 5
1 2
4
3
6
5
Matching Diagram of π = [4, 3, 6, 1, 5, 2] Permutation Graph for π = [4, 3, 6, 1, 5, 2]
A Matching Diagram is drawn by adjoining pairs of matching elements from the sets N
and π. Intersections depict adjacency.
Applications
4/26/2011Permutation Graphs and Applications7
⇨ Flight Altitudes Problem
Suppose two collections of cities - airports
⇨ Assign flight altitudes to connecting cities
Prevent intersecting flights colliding mid-air
Omaha Des Moines Chicago Fort Wayne Cleveland New York
Kansas City St. Louis Louisville Charleston Richmond
Applications
4/26/2011Permutation Graphs and Applications8
⇨ Draw a matching diagram
Each edge of the flight diagram is an “element”
Gives us a permutation and a graph
1 2 43 65 7 8 9 10 11
1 24 3 65 78 910 11
1
2
4 3
6
5
7
8 910
11
Applications
4/26/2011Permutation Graphs and Applications9
⇨ This is now a coloring problem
Distinct colors need distinct altitudes
⇨ An algorithm is given later
Topic of sorting a permutation
⇨ Digression:
Flying Cars?
Problem of mid-air collisions
Solvable with “dynamic” coloring
Car knows to change altitude
Using a little radar from surroundings
1
2
4 3
6
5
7
8 910
11
Sorting a Permutation
⇨ Consider the problem of sorting a permutation
⇨ We use n-many queues in parallel to demonstrate:
⇨ Each element goes into one of the n-queues But cannot go “behind” a larger element
5 4 6 1 3 2
4/26/201110 Permutation Graphs and Applications
Sorting a Permutation
⇨ The “unpacking” stage is simple
Pull out elements in proper order
5
4
6
1 3
2
4/26/201111 Permutation Graphs and Applications
Sorting a Permutation
4/26/2011Permutation Graphs and Applications12
⇨ How does this relate to Coloring Problem?
⇨ Proof (Prop 7.3):
We only allow non-inverted pairs in same queue
⇨ Decreasing Subsequence:
Proposition 7.3: There is a one-to-one
correspondence between the proper k-colorings of p
and the sorting strategies.
6 1
Corollary 7.4: The following are equivalent:I. The chromatic number
II. Minimum number of queues needed to sort
III. Length of longest decreasing subsequence
4/26/2011Permutation Graphs and Applications13
⇨ Proof (Corollary 7.4):
Equivalence of (i) and(ii): (Prop 7.3)
Equivalence of (i) and (iii): (Perfect Graph Theorem)
Clique Number = Longest Decreasing Subsequence
Clique Number = Chromatic Number
Perfect Graph Theorem
4/26/2011Permutation Graphs and Applications14
⇨ Algorithm:
Input: A permutation
Output: A coloring of the vertices
Algorithm 7.1:begin𝑘 ← 0;For 𝑗 ← 1 to 𝑛 do
begin𝑖 ← FIRST allowable queue;COLOR(π𝑗) ← 𝑖;LAST(i) ← π𝑗;𝑘 ← max{𝑘, 𝑖};
endχ ← 𝑘;
end
procedure FIRST allowable queuebegin𝑖 ← 1; 𝑡 ← 𝑘 +1;until 𝑖 = 𝑡 do
begin𝑟 ← ⌊(𝑖 + 𝑡)/2⌋;if π𝑗 ≥ LAST(𝑟)
then 𝑡 ← 𝑟;else 𝑖 ← 𝑟 + 1;
endreturn 𝑖;
end
4/26/2011Permutation Graphs and Applications15
⇨ Pass 1
⇨ Pass 2
𝑘
j
𝑖
1
1
1
1 2 3 4 5 6
4 0 0 0 0 0
LAST
3 6 1 5 24π𝑗 4 Queue #1
𝑘
j
𝑖
2
2
1
1 2 3 4 5 6
4 3 0 0 0 0
LAST
6 1 5 24π𝑗 3 Queue #1
3Queue #2