Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in...

31
Chordal structure in computer algebra: Permanents Diego Cifuentes Laboratory for Information and Decision Systems Electrical Engineering and Computer Science Massachusetts Institute of Technology Joint work with Pablo A. Parrilo (MIT) SIAM Conference on Discrete Mathematics - 2016 Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 1 / 21

Transcript of Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in...

Page 1: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Chordal structure in computer algebra: Permanents

Diego Cifuentes

Laboratory for Information and Decision SystemsElectrical Engineering and Computer Science

Massachusetts Institute of Technology

Joint work with Pablo A. Parrilo (MIT)

SIAM Conference on Discrete Mathematics - 2016

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 1 / 21

Page 2: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Algebraic tools in discrete math

Several problems from discrete mathematics can be approached with toolsfrom computer algebra.

Sensor network localization:Find positions, given a few knownfixed anchors and pairwise distances.

‖xi − xj‖2 = d2ij ij ∈ A

‖xi − ak‖2 = e2ij ik ∈ B

This is a system of quadratic polyno-mial equations. Can be solved usingGrobner bases.

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 2 / 21

Page 3: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Algebraic tools in discrete math

Several problems from discrete mathematics can be approached with toolsfrom computer algebra.

Lattice walksLet A ⊂ Zn consist of integer vectors.Consider a graph with vertex set Nn inwhich α, β are adjacent if α− β ∈ A.Describe the connected components.

This can be solved using a primary de-composition.

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 3 / 21

Page 4: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Algebraic tools in discrete math

Several problems from discrete mathematics can be approached with toolsfrom computer algebra.

Permanents (this talk)Given a n × n matrix M, compute

Perm(M) :=∑π

∏i

Mi ,π(i)

sum over permutations π.Important case: sparse matrices.

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 4 / 21

Page 5: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Algebraic tools in discrete math

Many more problems can be naturally approached with algebraictools: graph colorings, independent sets, Hamiltonian cycles, cryptoproblems, etc.

However these problems are NP-hard, and these algebraic methods donot work well for relatively small problems.Idea: exploit the graphical structure (chordality) of the problem!Complexity aspects? Identify families of tractable instances.

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 5 / 21

Page 6: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Algebraic tools in discrete math

Many more problems can be naturally approached with algebraictools: graph colorings, independent sets, Hamiltonian cycles, cryptoproblems, etc.However these problems are NP-hard, and these algebraic methods donot work well for relatively small problems.

Idea: exploit the graphical structure (chordality) of the problem!Complexity aspects? Identify families of tractable instances.

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 5 / 21

Page 7: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Algebraic tools in discrete math

Many more problems can be naturally approached with algebraictools: graph colorings, independent sets, Hamiltonian cycles, cryptoproblems, etc.However these problems are NP-hard, and these algebraic methods donot work well for relatively small problems.Idea: exploit the graphical structure (chordality) of the problem!

Complexity aspects? Identify families of tractable instances.

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 5 / 21

Page 8: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Algebraic tools in discrete math

Many more problems can be naturally approached with algebraictools: graph colorings, independent sets, Hamiltonian cycles, cryptoproblems, etc.However these problems are NP-hard, and these algebraic methods donot work well for relatively small problems.Idea: exploit the graphical structure (chordality) of the problem!Complexity aspects? Identify families of tractable instances.

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 5 / 21

Page 9: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Permanent computation

General facts:(Ryser’63) Best general and exact method; complexity O(n 2n).(Valiant’79) Computing the permanent of a matrix is #P-hard.

Approximation algorithms:(Jerrum,Sinclair,Vigoda’04) FPRAS for nonnegative matrices.

Tractable under special structure:(Fisher,Kasteleyn,Temperley’67) Bipartite graph is planar.(Barvinok’96) Rank is bounded.(Courcelle et al’01) Treewidth is bounded.

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 6 / 21

Page 10: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Permanent computation

General facts:(Ryser’63) Best general and exact method; complexity O(n 2n).(Valiant’79) Computing the permanent of a matrix is #P-hard.

Approximation algorithms:(Jerrum,Sinclair,Vigoda’04) FPRAS for nonnegative matrices.

Tractable under special structure:(Fisher,Kasteleyn,Temperley’67) Bipartite graph is planar.(Barvinok’96) Rank is bounded.(Courcelle et al’01) Treewidth is bounded.

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 6 / 21

Page 11: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Permanent computation

General facts:(Ryser’63) Best general and exact method; complexity O(n 2n).(Valiant’79) Computing the permanent of a matrix is #P-hard.

Approximation algorithms:(Jerrum,Sinclair,Vigoda’04) FPRAS for nonnegative matrices.

Tractable under special structure:(Fisher,Kasteleyn,Temperley’67) Bipartite graph is planar.(Barvinok’96) Rank is bounded.(Courcelle et al’01) Treewidth is bounded.

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 6 / 21

Page 12: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Graph abstractions of a matrix

The sparsity structure of a matrix M can be represented with a graph.Let a1, . . . , an denote the rows and x1, . . . , xn denote the columns.Consider these abstractions:

G , bipartite adjacency graph: (ai , xj) ∈ E iff Mi ,j 6= 0G s , (symmetrized) adjacency graph: (i , j) ∈ E iff |Mi ,j |+ |Mj,i | 6= 0GX , column graph: (xj , xk) ∈ E iff exists ai such that Mi ,jMi ,k 6= 0.Equivalently, the adjacency graph of MT M.

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 7 / 21

Page 13: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Graph abstractions of a matrix

x1 x2 x3 x4 x5 x6 x7 x8 x9

a1 0 1 0 2 0 0 0 0 0a2 0 0 1 0 2 0 0 0 0a3 0 0 3 0 0 2 0 0 0a4 0 0 0 0 1 0 2 0 0a5 0 0 0 0 0 1 0 2 0a6 0 3 0 0 0 0 0 0 2a7 0 0 0 0 0 0 3 1 0a8 0 0 0 3 0 0 0 0 1a9 3 0 0 0 0 0 0 0 0

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 8 / 21

Page 14: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Tree decompositions

Definition: A tree decomposition of a graph G = (X ,E ) is a pair (T , χ),where T is a tree and χ : T → {0, 1}X assigns some χ(t) ⊂ X to eachnode t of T , that satisfies the following conditions.

i. The union of {χ(t)}t∈T is the whole vertex set X .ii. For every (xi , xj) ∈ E , there is some node t of T with xi , xj ∈ χ(t).iii. For every xi ∈ X the set {t : xi ∈ χ(t)} forms a subtree of T .The width ω of the decomposition is the largest |χ(t)|.

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 9 / 21

Page 15: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Chordality and treewidth

The treewidth of G is the minimum width among all possible treedecompositions. The treewidth ω(G) of a graph G can be though of as ameasure of complexity: the smaller ω(G), the simpler the graph (closer toa tree).

Meta-theorem: NP-complete problems are “easy” on graphs of smalltreewidth.

Alternatively, we can define treewidth in terms of chordal completions ofthe graph (chordal completions are in correspondance with treedecompositions).

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 10 / 21

Page 16: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Chordality and treewidth

The treewidth of G is the minimum width among all possible treedecompositions. The treewidth ω(G) of a graph G can be though of as ameasure of complexity: the smaller ω(G), the simpler the graph (closer toa tree).

Meta-theorem: NP-complete problems are “easy” on graphs of smalltreewidth.

Alternatively, we can define treewidth in terms of chordal completions ofthe graph (chordal completions are in correspondance with treedecompositions).

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 10 / 21

Page 17: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Treewidth of matrix graphs

Simple fact:tw(G) ≤ 2 tw(G s).tw(G) ≤ tw(GX ) + 1.For a fixed tw(G) bothtw(G s), tw(GX ) areunbounded.

Previous tree decomposition methods are primarily based on thesymmetrized graph G s (Courcelle et al., Flarup et al., Meer), and they donot scale well with the treewidth O(n 2O(ω2)).

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 11 / 21

Page 18: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Treewidth of matrix graphs

Simple fact:tw(G) ≤ 2 tw(G s).tw(G) ≤ tw(GX ) + 1.For a fixed tw(G) bothtw(G s), tw(GX ) areunbounded.

Previous tree decomposition methods are primarily based on thesymmetrized graph G s (Courcelle et al., Flarup et al., Meer), and they donot scale well with the treewidth O(n 2O(ω2)).

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 11 / 21

Page 19: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Our results

A tree decomposition method to compute permanents, based on thebipartite graph G , with complexity O(n 2ω).The algorithm naturally extends to higher dimensional problems:mixed discriminants, hyperdeterminants. Complexity O(n2 + n 3ω).Hardness results for the case of mixed volumes.

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 12 / 21

Page 20: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Our results

Det Perm

MDisc MVol

HDet

matrix matrix

n matrices n zonotopes

tensorMVol

n polytopes

Easy (small ω)

HardHard (small ω)Easy

(known)

(this paper)

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 13 / 21

Page 21: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Basic idea

For block matrices

Perm(

A A′0 B

)= Perm(A) Perm(B) = Perm

(0 AB B′

)

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 14 / 21

Page 22: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Permanent expansion: column graphSimilarly, for the matrix

M =

A1,1 0 A1,3 A1,4 0A2,1 0 A2,3 A2,4 0

0 C3,2 C3,3 C3,4 00 B4,2 B4,3 0 B4,50 B5,2 B5,3 0 B5,5

we have the following formula

Perm(M) = Perm(

A1,1 A1,3A2,1 A2,3

)Perm

(C3,4

)Perm

(B4,2 B4,5B5,2 B5,5

)

+ Perm(

A1,1 A1,4A2,1 A2,4

)Perm

(C3,3

)Perm

(B4,2 B4,5B5,2 B5,5

)

+ Perm(

A1,1 A1,4A2,1 A2,4

)Perm

(C3,2

)Perm

(B4,3 B4,5B5,3 B5,5

).

To evaluate we need 14 multiplications: four 2× 2 permanetns.Compare with: 4× 5! = 480 multiplications using definition.

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 15 / 21

Page 23: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Permanent expansion: column graph

This simple formula exists because its column graph has a simple structure

M1,1 0 M1,3 M1,4 0M2,1 0 M2,3 M2,4 0

0 M3,2 M3,3 M3,4 00 M4,2 M4,3 0 M4,50 M5,2 M5,3 0 M5,5

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 16 / 21

Page 24: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

ResultsLemma: Let (T , χ) be a tree decomposition of GX . Let c1, . . . , ck be thechildren of a node t ∈ T . Then

perm(ATt ,Y ) =∑Y

perm(At ,Yt)k∏

j=1perm(ATcj

,Ycj )

where the sum is over all Y = (Yt ,Yc1 , . . . ,Yck ) such that:

Y = Yt t (Yc1 t · · · t Yck )χ(Tcj ) \ χ(t) ⊂ Ycj ⊂ χ(Tcj ) Yt ⊂ χ(t).

Lemma: The above formula can be evaluated in O(k 2ω).

Proof: Rewrite the equation as

Pt(Y ) =∑

YttYc1t···tYck =Y

Qt(Yt)k∏

j=1Qcj (Ycj )

and use the fast subset convolution (Bjorklund et al. 07).

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 17 / 21

Page 25: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

ResultsLemma: Let (T , χ) be a tree decomposition of GX . Let c1, . . . , ck be thechildren of a node t ∈ T . Then

perm(ATt ,Y ) =∑Y

perm(At ,Yt)k∏

j=1perm(ATcj

,Ycj )

where the sum is over all Y = (Yt ,Yc1 , . . . ,Yck ) such that:

Y = Yt t (Yc1 t · · · t Yck )χ(Tcj ) \ χ(t) ⊂ Ycj ⊂ χ(Tcj ) Yt ⊂ χ(t).

Lemma: The above formula can be evaluated in O(k 2ω).Proof: Rewrite the equation as

Pt(Y ) =∑

YttYc1t···tYck =Y

Qt(Yt)k∏

j=1Qcj (Ycj )

and use the fast subset convolution (Bjorklund et al. 07).Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 17 / 21

Page 26: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Permanent expansion: bipartite graph

Perm(M) = perm({a1, a2}, {x1, x4}) perm({a3, a4, a5}, {x2, x3, x5})+ perm({a1, a2, a3}, {x1, x3, x4}) perm({a4, a5}, {x2, x5})−M3,3 perm({a1, a2}, {x1, x4}) perm({a4, a5}, {x2, x5})

perm({a1, a2, a3}, {x1, x3, x4}) = M3,3 perm({a1, a2}, {x1, x4}) + M3,4 perm({a1, a2}, {x1, x3})perm({a3, a4, a5}, {x2, x3, x5}) = M3,3 perm({a4, a5}, {x2, x5}) + M3,2 perm({a4, a5}, {x3, x5})

To evaluate we need 16 multiplications.

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 18 / 21

Page 27: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Results

Theorem: Let M be a matrix with associated bipartite graph G . Then wecan compute Perm(M) in O(n 2ω) where ω = tw(G).

The mixed discriminant of n matrices of size n × n is

Disc(A1, . . . ,An) :=∑π,ρ

sgn(π)sgn(ρ)∏

iAiπ(i),ρ(i)

where the sum is over pairs of permutations π, ρ.

Theorem: Let M be a list of matrices with associated tripartite graph G .Then we can compute Disc(M) in O(n2 + n 3ω), where ω = tw(G).

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 19 / 21

Page 28: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Results

Theorem: Let M be a matrix with associated bipartite graph G . Then wecan compute Perm(M) in O(n 2ω) where ω = tw(G).

The mixed discriminant of n matrices of size n × n is

Disc(A1, . . . ,An) :=∑π,ρ

sgn(π)sgn(ρ)∏

iAiπ(i),ρ(i)

where the sum is over pairs of permutations π, ρ.

Theorem: Let M be a list of matrices with associated tripartite graph G .Then we can compute Disc(M) in O(n2 + n 3ω), where ω = tw(G).

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 19 / 21

Page 29: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Further generalizations

The first Cayley hyperdeterminant is the simplest generalization of thedeterminant to multidimensional arrays.

Theorem: Let M be a square d-dimensional tensor of length n, withd-partite graph G . We can compute its hyperdeterminant in O(n2 + n 3ω).

The mixed volume is a geometric generalization of determinants andpermanents to arbitrary convex bodies on Rn.

Theorem: Computing mixed volumes of n zonotopes remains #P-hardwhen their associated graph has bounded treewidth.

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 20 / 21

Page 30: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Further generalizations

The first Cayley hyperdeterminant is the simplest generalization of thedeterminant to multidimensional arrays.

Theorem: Let M be a square d-dimensional tensor of length n, withd-partite graph G . We can compute its hyperdeterminant in O(n2 + n 3ω).

The mixed volume is a geometric generalization of determinants andpermanents to arbitrary convex bodies on Rn.

Theorem: Computing mixed volumes of n zonotopes remains #P-hardwhen their associated graph has bounded treewidth.

Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 20 / 21

Page 31: Chordal structure in computer algebra: Permanentsdiegcif/files/2016-Permanents.pdfAlgebraic tools in discrete math Several problems from discrete mathematics can be approached with

Summary

Det Perm

MDisc MVol

HDet

matrix matrix

n matrices n zonotopes

tensorMVol

n polytopes

Easy (small ω)

HardHard (small ω)Easy

(known)

(this paper)

D. Cifuentes, P.A. Parrilo, An efficient tree decomposition method for permanents andmixed discriminants. arXiv:1507.03046.D. Cifuentes, P.A. Parrilo, Exploiting chordal structure in polynomial ideals: a Grobnerbasis approach. arXiv:1411.1745.D. Cifuentes, P.A. Parrilo, Chordal networks of polynomial ideals. arXiv:1604.02618 .

Thanks for your attention!Cifuentes (MIT) Chordal structure and permanents SIAM-DM’16 21 / 21