Counting perfect matchings in planar graphs
Transcript of Counting perfect matchings in planar graphs
![Page 1: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/1.jpg)
1FKT Algorithm by PlusOne
Counting perfect matchings in planar graphsWith the FKT algorithm
![Page 2: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/2.jpg)
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
![Page 3: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/3.jpg)
3FKT Algorithm by PlusOne
1 2
3
4
56
7
8
Def Cycle Cover
![Page 4: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/4.jpg)
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
![Page 5: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/5.jpg)
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)
![Page 6: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/6.jpg)
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
![Page 7: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/7.jpg)
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
![Page 8: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/8.jpg)
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.
![Page 9: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/9.jpg)
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 (πππ πππππ’π‘ππ‘πππ)
![Page 10: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/10.jpg)
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,
![Page 11: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/11.jpg)
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.
π, π π β ππππ < π, π π >
![Page 12: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/12.jpg)
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
![Page 13: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/13.jpg)
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 =
π
πππ π πππ(π) =
π·πΆπΆ
πππ π πππ(π)
![Page 14: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/14.jpg)
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
![Page 15: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/15.jpg)
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
=
π·πΆπΆ
πππ π πππ(π)
=
πΈπ·πΆπΆ
πππ π πππ(π) +
πππ‘ ππ£ππ π·πΆπΆ
πππ π πππ(π)
=
πΈπ·πΆπΆ
πππ π πππ(π)
![Page 16: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/16.jpg)
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
![Page 17: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/17.jpg)
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!
![Page 18: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/18.jpg)
1. Find a spanning tree for G.Call this tree T1.
18FKT Algorithm by PlusOne
Alg FKT Algorithm: Finding an Orientation
![Page 19: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/19.jpg)
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
![Page 20: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/20.jpg)
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).
![Page 21: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/21.jpg)
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.
![Page 22: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/22.jpg)
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
![Page 23: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/23.jpg)
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
![Page 24: Counting perfect matchings in planar graphs](https://reader030.fdocuments.net/reader030/viewer/2022012020/61db3be409477e57b44b3216/html5/thumbnails/24.jpg)
FKT Algorithm by PlusOne 24
Graph GRun FKT to find
orientation GCompute det π΄ PM = det(π΄)
How to count perfect matchings?