Post on 10-Jan-2022
1FKT Algorithm by PlusOne
Counting perfect matchings in planar graphsWith the FKT algorithm
Perfect Matching
2
Z
FKT Algorithm by PlusOne
Given a graph G = (V,E), a matching M in G is a set of pairwise non-adjacent edges. M is said to be perfect if every vertex of G is included in M.
Def
3FKT Algorithm by PlusOne
1 2
3
4
56
7
8
Def Cycle Cover
4FKT Algorithm by PlusOne
A set of disjoint cycles in G that contain all vertices of G.
1 2
3
4
56
7
8
Def Cycle Cover
5FKT Algorithm by PlusOne
A cycle cover that satisfiesβ¦β’ All cycles have even number of vertices.β’ Every cycle has a direction (clockwise or counter-clockwise).
1 2
3
4
56
7
Non-even Directed Cycle Cover
1 2
3
4
56
7
8
Even Directed Cycle Cover
DefEven Directed Cycle Cover (EDCC)
6FKT Algorithm by PlusOne
M1
1 2
3
4
56
7
81 2
3
4
56
7
8
M2
ObsEvery ordered pair of perfect matchings can be uniquely mapped to an EDCC.
<M1, M2>
1 2
3
4
56
7
8
7FKT Algorithm by PlusOne
ObsEvery ordered pair of perfect matchings can be uniquely mapped to an EDCC.
Itβs easy to see that every EDCC can also be decomposed into an ordered pair of perfect matchings.
<M1, M2>
1 2
3
4
56
7
8
Counting Perfect Matchings
8FKT Algorithm by PlusOne
|ππ|2 = |πΈπ·πΆπΆ|
The number of perfect matchings
The number of even directed cycle
covers
So counting perfect matchings can be converted into counting EDCCs.
9FKT Algorithm by PlusOne
π 1 2 3 4 5 6 7 8
π(π) 6 3 4 5 2 7 8 1
Recall Discrete Mathematics II and Linear Algebra.
Tip Permutations
The parity of a permutation = the parity of # swaps from the original sequence
sgn(π): sign of a permutation +1 (ππ£ππ πππππ’π‘ππ‘πππ)β1 (πππ πππππ’π‘ππ‘πππ)
10FKT Algorithm by PlusOne
A: adjacency matrix π΄ππ =
+1 (if edge i β j)β1 (if edge j β i)
0 (if no edge between i, j)
sgn(π): sign of a permutation +1 (εΆζε)
β1 (ε₯ζε)val π βΆ π΄π,π(π)
Def Determinant of Oriented GraphIs the determinant of the adjacency matrix!
π·ππ‘ π΄ = ππππ π β πππ(π)
By definition,
11FKT Algorithm by PlusOne
1 2
3
4
56
7
8
π 1 2 3 4 5 6 7 8
π(π) 6 3 4 5 2 7 8 1
ObsEvery Directed Cycle Cover (DCC) corresponds to a permutation.
π, π π β ππππ < π, π π >
12FKT Algorithm by PlusOne
1 2
3
4
56
7
8
π 1 2 3 4 5 6 7 8
π(π) 6 3 4 5 2 7 8 1
ObsFor a permutation π, if β π, π π β πΈ, we can map π to a DCC.
π, π π β ππππ < π, π π >
1 2
3
4
56
7
8
π 1 2 3 4 5 6 7 8
π(π) 7 3 4 5 2 1 8 6
13FKT Algorithm by PlusOne
ObsFor a permutation π, if β π, π π β πΈ, we can map π to a DCC.
π, π π β ππππ < π, π π >
The inverse proposition : for a permutation π , if it cannot be mapped to a DCC, then β π, π π β πΈ.
β π΄π,π π = 0
β val π = 0
Det A =
π
πππ π πππ(π) =
π·πΆπΆ
πππ π πππ(π)
Non-even DCCs will be cancelled out.
14FKT Algorithm by PlusOne
You can always find another DCC with an opposite direction for the odd cycle.
π
πβ²
π ππ π = π ππ(πβ²)
Remember that π΄ππ = βπ΄ππ
So πππ π = β1 π β πππ πβ²
(k is the number of edges in the cycle)
Therefore: π ππ π π£ππ π + π ππ π π£ππ πβ² = 0
Obs
Only EDCCs contribute to Det(A)
15FKT Algorithm by PlusOne
Det A
=
π
πππ π πππ(π)
Our goal: Find an orientation that makes all π ππ π π£ππ π = 1(then ππ2 = πΈπ·πΆπΆ = π·ππ‘(π΄))
Permutations that are not DCC, val(π)=0
This depends on the orientation!
β€ |πΈπ·πΆπΆ|This is equal when all
π ππ(π)π£ππ(π)=1
=
π·πΆπΆ
πππ π πππ(π)
=
πΈπ·πΆπΆ
πππ π πππ(π) +
πππ‘ ππ£ππ π·πΆπΆ
πππ π πππ(π)
=
πΈπ·πΆπΆ
πππ π πππ(π)
16FKT Algorithm by PlusOne
Alg FKT Algorithm: Finding an Orientation
Planar Graph: a graph that can be drawn in the 2D plane so that its edges intersect only at its vertices.
Not Planar Planar
FKT Algorithm by PlusOne
Alg FKT Algorithm: Finding an Orientation
Planar Graph: a graph that can be drawn in the 2D plane so that its edges intersect only at its vertices.
Face: a planar graph can be seen as a mesh of faces.
Face!
1. Find a spanning tree for G.Call this tree T1.
18FKT Algorithm by PlusOne
Alg FKT Algorithm: Finding an Orientation
1. Find a spanning tree for G.Call this tree T1.
2. Orient the edges arbitrarily.
3. Construct a second tree T2, whose vertices are the faces of T1.Put an edge between faces that share an edge that is not in T1.4. Starting with the leaves of T2, orient these edges of G such that each face has an odd number of edges oriented clockwise. 19FKT Algorithm by PlusOne
Alg FKT Algorithm: Finding an Orientation
20FKT Algorithm by PlusOne
Eulerβs Formula
For any cycle C, e = v + f β 1, where e is the number of edges inside C, v is the number of vertices inside C, and f is the number of faces inside C.
π£ = 4
π = 5
Lemma
If all faces have an odd number of clockwise edges then all cycles in an EDCC are oddly oriented.
Cycle πΆ, π = 8.
ππ: the number of clockwise lines on the boundary of face.
π: the number of clockwise lines on Cycle (C).
Proofβ’ Let πΆ be a nice cycle, let ππ be the number of clockwise lines on
the boundary of face i in πΆ, and π be the number of clockwise lines on πΆ.
β’ We oriented each face to have an odd number of clockwise lines,
so ππ β‘ 1πππ 2, so π β‘ π=1π
ππ πππ 2.
β’ But also π=1π
ππ = π + π (each interior line is counted as clockwise once).
β’ So π β‘ π + (π£ + π β 1) πππ 2, so π β‘ (π£ β 1) πππ2.
β’ But π£ β‘ 0 πππ 2 ,as C is a nice cycle.
β’ So πΆ, and hence every nice cycle, is oddly oriented.
21FKT Algorithm by PlusOne
Eulerβs Formula
For any cycle C, e = v + f β 1, where e is the number of edges inside C, v is the number of vertices inside C, and f is the number of faces inside C.
1 2
3
4
56
7
8
= ((β1) Γ (β1))π
= 1
22FKT Algorithm by PlusOne
π ππ π π£ππ π
Lemma
If all cycles in an EDCC are oddly oriented then π ππ π π£ππ π = 1 for all corresponding π.
Even cycle
sgn(π): sign of a permutation +1 (εΆζε)
β1 (ε₯ζε)
val π βΆ π΄π,π(π)
= π ππ πΆπ β π£ππ πΆπ
= π ππ πΆπ π£ππ(πΆπ)
C1 C2
C3
Oddly oriented
The FKT algorithms finds a feasible orientation!
FKT Algorithm by PlusOne 23
Lemma
If all cycles in an EDCC are oddly oriented then π ππ π π£ππ π = 1 for all corresponding π.
LemmaIf all faces have an odd number of clockwise edges then all cycles in an EDCC are oddly oriented.
Det (A) = |EDCC|
FKT algorithm
FKT Algorithm by PlusOne 24
Graph GRun FKT to find
orientation GCompute det π΄ PM = det(π΄)
How to count perfect matchings?