• No results found

On the Computation of the Permanent

N/A
N/A
Protected

Academic year: 2021

Share "On the Computation of the Permanent"

Copied!
37
0
0

Loading.... (view fulltext now)

Full text

(1)

1

On the Computation of the Permanent

Dana Moshkovitz

(2)

Overview

 Presenting the problem

 Introducing the Markov chain Monte-Carlo method.

(3)

3

Perfect Matchings in Bipartite Graphs

An undirected graph G=(UV,E) is bipartite if

UV= and EUV.

A 1-1 and onto function f:UV is a perfect matching if for any uU,

(u,f(u))E.

(4)

Finding Perfect Matchings is

Easy

(5)

5

What About Counting Them?

Let A=(a(i,j))1i,jn be the adjacency matrix of a bipartite graph

G=({u1,...,un}{v1,...,vn},E), i.e. -



n

i

i i

a A

per

1

)) ( , ( )

(

otherwise E v

j u i

a i j

0

) ,

( ) 1

, (

permanent sum over the permutations of {1,...,n}

The number of perfect matchings in the graph is





1 0 1 0

0 1 0 1

1 0 1 1

0 0 1 1

(6)

Cycle-Covers

• Given an undirected bipartite graph

G=({u1,...,un}{v1,...,vn},E), the corresponding directed graph is G’=({w1,...,wn},E), where (wi,wj)E iff (ui,vj)E.

• Definition: Given a directed graph G=(V,E), a set of node-disjoint cycles that together cover V is called a cycle-cover of G.

• Observation: Every perfect matching in G

corresponds to a cycle-cover in G’ and vice-versa.

(7)

7

Three Ways To View Our Problem

1) Counting the number of Perfect Matchings in a bipartite graph.

2) Computing the Permanent of a 0-1 matrix.

3) Counting the number of Cycle-Covers in a directed graph.

(8)

#P - A Complexity Class of Counting Problems

• LNP iff there is a polynomial time decidable binary relation R, s.t.

) , (

|)

(| x R x y p

|y|

y L

x     

• f #P iff f(x)=| { y | R(x,y) } | where R is a relation associated with some NP problem.

• We say a #P function is #P-Complete, if every #P function Cook-reduces to it.

• It is well known that #SAT (i.e - counting the

some polynomial

(9)

9

On the Hardness of Computing the Permanent

Claim [Val79]: Counting the number of cycle- covers in a directed graph is #P-Complete.

Proof: By a reduction from #SAT to a generalization of the problem.

(10)

The Generalization:

Integer Permanent

2

3

0 2 0

1 0 0

0 3 2

 Activity: an integer weight attached to each edge (u,v)E, denoted

(u,v).

The activity of a matching M is

(M)=(u,v)M(u,v).

The activity of a set of matchings S is (M)=MS(M).

The goal is to compute the total

2 2 3 1

(11)

11

Integer Permanent Reduces to 0-1 Permanent

2

the rest of the graph

1

1

We would have loved to do something of this sort...

(12)

Integer Permanent Reduces to 0-1 Permanent

the rest of the graph

So instead we do:

(13)

13

But this is really cheating!

The integers may be exponentially large, but we are forbidden to add

an exponential number of nodes!

(14)

The Solution

the rest of the graph

...

(15)

15

What About Negative Numbers?

 Without loss of generality, let us assume the only negative numbers are -1’s.

 We can reduce the problem to calculating the Permanent modulo (big enough) N of a 0-1 matrix by replacing each -1 with (N-1).

 Obviously, Perm mod N is efficiently reducible to calculating the Permanent.

(16)

Continuing With The Hardness Proof

 We showed that computing the permanent of an integer matrix reduces to computing the permanent of a 0-1 matrix.

 It remains to prove the reduction from

#SAT to integer Permanent.

 We start by presenting a few gadgets.

(17)

17

The Choice Gadget

Observation: in any cycle- cover the two nodes must be covered by either the left cycle (true) or the right

cycle (false).

x= true x= false

(18)

The Clause Gadget

Observation:

no cycle-cover of this graph contains all three external edges.

However, for every proper subset of the external

edges, there is exactly one cycle-cover containing it.

each external edge corresponds to one

literal

(19)

19

The Exclusive-Or Gadget

The Perm. of the whole matrix is 0.

The Perm. of the matrix

resulting if we delete the first (last) row and column is 0.

The Perm. of the matrix

resulting if we delete the first (last) row and the last (first) column is 4.

-1

-1

2

3 -1





0 3 1 0

2 1 1 0

1 1 1 1

1 1 1

0

(20)

Plugging in the XOR-Gadget

Observe a cycle-cover of the graph with a XOR- gadget plugged as in the below figure.

If e is traversed but not t (or vice versa), the Perm. is multiplied by 4.

Otherwise, the Perm. is added 0.

e

(21)

21

Putting It All Together

 One choice

gadget for every variable.

 One Clause

gadget for every clause.

x= true x= false if the

literal is x

x= true x= false if the

literal is x

(22)

Sum Up

 Though finding a perfect matching in a bipartite graph can be done in polynomial time,

 counting the number of perfect matchings is

#P-Complete, and hence believed to be impossible in polynomial time.

 So what can we do?

(23)

23

Our Goal - FPRAS for Perm

Describing an algorithm, which given a 0-1 nn matrix M and an >0, computes, in

time polynomial in n and in -1, a r.v Y, s.t Pr[(1-)Perm(M)  Y  (1+)Perm(M)]  1-,

where 0< ¼.

(24)

The Markov Chain Monte Carlo Method

 Let  be a very large (but finite) set of combinatorial structures,

 and let  be a probability distribution on .

 The task is to sample an element of  according to the distribution .

(25)

The Connection to Approximate Counting

U G The Monte-Carlo method:

Choose at random u1,...,uNU.

Let Y=|{i : uiG }|.

Output Y|U|/N.

|

| 4

|

| 2

2 1

|

| ) 1

| (

| |

| ) 1

(

Pr U

G N

e N G

Y U G





Analysis: By standard Chernoff bound,

|

|

|

| 1 ln 2

4 2

G

N U

(26)

Randomized Self Reducibility

Let M denote the set of perfect matchings.

For any eE let me be the number of perfect matchings containing e.

Let mne be the number of perfect matchings not containing e.

Claim: If |E|>n+1>2 and |M|>0, then eE, s.t mne/|M|1/n.

(27)

27

Counting Reduces to Sampling

PermFPRAS(G)

Input: a bipartite graph G=(VU,E).

Output: an approximation for |M|.

1. if |E|n+1 or n<2, compute |M| exactly.

2. for each eE do

3. sample 4n|E|2ln(2|E|/)/2 perfect matchings 4. Y  fraction of matchings not containing e.

5. if Y1/n, return PermFPRAS(VU,E\{e})/Y

(28)

Markov Chains

Definition: A sequence of random variables {Xt}t0 is a Markov Chain (MC) with state space , if Pr[ Xt+1=y | Xt=xt,...,X0=x0 ] = Pr [ Xt+1=y | Xt=xt] for any natural t and x0,...,xt.

We only deal with time-homogeneous MCs, i.e Pr[ Xt+1=y | Xt=xt] is independent of t.

(29)

29

Graph Representation of MC

Conceptually, A Markov chain is a HUGE directed weighted graph.

The nodes correspond to the objects in .

Xt = position in step t.

The weight of (x,y)

is P(x,y)=Pr[X1=y|X0=x].

0.5

0.15

0.5

0.05

0.5 0.1

0.1 0.1 0.6

0.2

0.05

0.2

0.1 0.85 0.15

0.55 0.1

0.8

(30)

Iterated Transition

Definition: For any natural t,

i.e - Pt(x,y)=Pr[Xt=y|X0=x].



( , ') ( ,' ) 0

0 )

, ( )

, (

'

1 x y P y y t

P

t y

x I y

x P

y t t

(31)

31

More Definitions

A MC is irreducible, if for every pair of states x,y, there exists tN, s.t.

Pt(x,y)>0.

A MC is aperiodic, if gcd{t : Pt(x,x) > 0}=1 for any x.

A finite MC is ergodic if it is both irreducible and aperiodic.

0.5 0.3

0.5

0.2

0.5 0.1

0.1

0.9

(32)

Stationary Distribution

Definition: A probability distribution :[0,1] is a stationary distribution of a MC with transition matrix P, if (y)=x(x)P(x,y).

Proposition: An ergodic MC converges to a unique stationary distribution :(0,1], i.e. -

) ( )

, (

.P x y y

x

y t t 

(33)

33

Time Reversible Chains

Definition: Markov chains for which some distribution  satisfies for all M,M’,

(the detailed balance condition)

are called (time) reversible. Moreover, that  is the stationary distribution.

) ' , ( : ) ,'

( ) ' ( )

' , ( )

(M P M M M P M M Q M M

(34)

Mixing Time

Definition: Given a MC with transitions

matrix P and stationary distribution , we define the mixing time as

x()=min{ t : ½y |Pt(x,y)-(y)| }

Definition: A MC is rapidly mixing, if for any fixed >0. x() is bounded above by a

(35)

35

Conductance

Definition: the conductance of a reversible MC is defined as =minS(S), where

Theorem: For an ergodic, reversible Markov chain with self loops probabilities P(y,y)½ for all states x,

) ( ) (

) , ( )

( ) (

) , ) (

( S S

y x Q S

S S S

S Q x S y S



) ln

) ( 2 (ln

)

( 2 1 1

x x

(36)

Framework

MC: ,

irreducible aperiodic

ergodic

½ self loops

detailed balance condition

stationary

reversible

rapid mixing

1/poly

(37)

37

Our Markov Chain

The state space  will consist of all perfect and near-perfect (size n-1) matchings in the graph.

 The stationary distribution  will be

uniform over the perfect matchings and will assign them probability O(1/n2).

References

Related documents

The use of sodium polyacrylate in concrete as a super absorbent polymer has promising potential to increase numerous concrete properties, including concrete

The paper assessed the challenges facing the successful operations of Public Procurement Act 2007 and the result showed that the size and complexity of public procurement,

The daily, monthly and annual precipitation totals and temperature observed at korem meteorological station were used for the period of 1981-2010 for Precipitation and 1985 – 2010

Based on the idea, we have put forward novel routing strategies for Barrat- Barthelemy- Vespignani (BBV) weighted network. By defining the weight of edges as

The ethno botanical efficacy of various parts like leaf, fruit, stem, flower and root of ethanol and ethyl acetate extracts against various clinically

COMPETENCIES AND STATUS A software developer’s open source activities serve as a signal to prospec- tive employers that the developer has a certain collection of competencies

Applications of Fourier transform ion cyclotron resonance (FT-ICR) and orbitrap based high resolution mass spectrometry in metabolomics and lipidomics. LC–MS-based holistic metabolic

The objective of this review was to evaluate the effect- iveness and safety of all orphan drugs that have been granted marketing licenses in Europe, determine the annual costs of