counting perfect matchings in planar graphs

24
1 FKT Algorithm by PlusOne Counting perfect matchings in planar graphs With the FKT algorithm

Upload: others

Post on 10-Jan-2022

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Counting perfect matchings in planar graphs

1FKT Algorithm by PlusOne

Counting perfect matchings in planar graphsWith the FKT algorithm

Page 2: Counting perfect matchings in planar graphs

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

3FKT Algorithm by PlusOne

1 2

3

4

56

7

8

Def Cycle Cover

Page 4: Counting perfect matchings in planar graphs

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

FKT Algorithm by PlusOne 24

Graph GRun FKT to find

orientation GCompute det 𝐴 PM = det(𝐴)

How to count perfect matchings?