Title: Final Project
1Final Project
- On algorithms for permuting large entries to the
diagonal of a sparse matrix - Iain S. Duff and Jacko Koster
Arturo Gonzalez-Gutierrez
2Agenda
- Introduction
- Matching
- Weighted Matching
- Boottleneck Matching
- Scaling
- Experimental Results
3Introduction
Bipartite Matching Algorithms ( 5 3 1 2 4)
4Objective
- Compute a matching that corresponds to
- a permutation of a sparse matrix such that the
product (or sum) of the diagonal entries is
maximized. - a permutation of rows and columns such that the
smallest ratio between the absolute value of a
diagonal entry and the maximum absolute value in
its column is maximized (a permutation of the
matrix such that the smallest diagonal entry is
maximized)
5Matrix/Maximum Matching
M7lt9
6M-Alternating path/M-Augmenting path
M7
M8lt9
1
1
1
1
2
2
2
2
3
3
3
3
4
4
4
4
5
5
5
5
6
6
6
6
7
7
7
7
8
8
8
8
9
9
9
9
7Non-singular Matrix/Matching
8Non-singular Matrix/Perfect Matching
M9
1
1
2
2
3
3
4
4
5
5
6
6
7
7
8
8
9
9
9If Anxn is non-singular then there exists a
perfect matching M for GA and a permutation
matrix P.
10AP, PA
11If M is a matching and P is an M-augmenting path
then M?P(M\P)?(P\M) is a matching.
Proof
M7
M8
1
1
2
2
3
3
4
4
5
5
6
6
7
7
8
8
9
9
12- If P is an M-augmenting path then M?PM1
- If P is an M-alternating cycle path then
M?PM
Proof
(a)
(b)
13Algorithm
j0 unmatched
j0 unmatched
i0 unmatched
i0
j1
M-augmenting path
i1
j2
ik-2
Jk-1
ik-1
Jk
14Algorithm
- for j0?Vc do
- jj0 pjnull iapnull
- B?
- repeat
- if there exists i?COL(j) and i is unmatched
then - iapi
- else
- if there exists i?COL(j)\B then
- BBi
- kmi pkj jk
- else
- jpj
- end if
- end if
- until iap?null or jnull
- if iap?null then augmented along path from node
iap to node j0 - end for
15Weighted Matching
MAXIMIZATION MULTIPLICATIVE PROBLEM Find M that
corresponds to a permutation s that maximizes
MINIMIZATION ADDITIVE PROBLEM
min
BIPARTITE WEIGHTED MATCHING PROBLEM Find a
minimum weight perfect matching in an edge
weighted bipartite graph
16Bipartite Weighted Matching Problem
- C(cij) ? ?nxn ? GC(Vr,Vc,E) bipartite graph
where each edge (i,j) ? E has weight cij - If M is a minimum weight perfect matching then
c(M)?c(M) for all possible maximum matching M. - An M-augmenting path P starting at an unmatched
column node j is called shortest if
c(M?P)?c(M?P) for all other possible
M-augmenting paths P starting at node j.
17Length of alternating path Pl(P)
c(M?P)-c(M)c(P\M)-c(M?P)
1
1
2
2
3
3
l(P)c9,7-c5,7c5,6-c7,6c7,9
4
4
5
5
6
6
7
7
8
8
9
9
18Bipartite Weighted Matching Problem
- M is extreme matching ? M doesnt allow any
alternative cycle path with negative length - If M is extreme then M is a perfect matching with
minimum weight. - If M is extreme and P is a shortest M-augmenting
path then M?P is extreme also.
19Bipartite Weighted Matching Problem (LP)
Minimize
Subject to
If there is a solution to LP then there is one
for which xij?0,1 and there exists a
permutation matrix X such that M(i,j)xij1 is
a minimum weight perfect matching.
20- M has minimum weight ?? dual variables ui and vj
with - uivi?cij for (i,j)?E
- uivicij for (i,j)?M
- Reduced weight matrix
- Reduced weight of matching M
- Reduced length of any M-alternating path P
- If (M?P) is a matching then its reduced weight
21Weighted Matching
22- Since for every edge (i,j)?M and
contains no alternating paths P with negative
length then for every
principal leading subpath P of P. - Shortest Augmenting Paths in a weighted bipartite
graph G(Vr,Vc,E) can be obtained by a shortest
alternating path tree. - A shortest alternating path tree T is an
alternating tree where each of whose paths is a
short path in G.
23- For any node i?Vr?Vc, di is the length of the
shortest path in T from node i to root. - T is a shortest alternating path tree ?
24Dijkstra Algorithm (sparse variant)
25Complexity of the Algorithm
- Dijkstras Algorithm
- for dense graphs
- O(n2)
- for sparse problems
- O(n(n logk n t logk n n k logk n))
- O(n(tnk) logk n)
26Bottleneck matchingPermute rows and columns of
a sparse matrix A
- MAXIMIZATION PROBLEM
- Compute a permutation s that maximizes
MINIMIZATION PROBLEM
min
27- Given a matching M in the bipartite graph
GC(Vr,Vc,E), the bottleneck of M is defined as
c(M)max(i,j)?M cij - Find Perfect (or maximum) bottleneck matching M
for which c(M) is minimal c(M)?c(M) for all
possible maximum matchings M. - M is extreme matching ?M does not allow any
alternating cycle path P for which c(M?P)ltc(M)
28A large initial extreme matching
j unmatched
i matched
j1 matched
i1 unmatched
29Dijkstra Algorithm (sparse variant)
j0 unmatched
j0 unmatched
j0 unmatched
j
j
j with lsp
i matched max(dj , )ltdi
i max(dj , )gtlsap
i unmatched max(dj , )ltlsap
new shorter alternating path
new shorter augmenting path
30Scaling
- By using the dual solution produced by the
weighted matching algorithm - uivi?cij for (i,j)?E
- uivicij for (i,j)?M
31- Reduce the amount of pivoting in the context of
dense Gaussian elimination the more dominant the
diagonal, the higher the chance that diagonal
entries are stable enough to serve as pivots for
elimination - For iterative methods (Gershgorins theorem)
- This guarantees that iterative methods like
Jacobi and Gauss Seidel will converge
32Time (secs) for matching algorithms
33IMPCOL E Chemical Engineering Plant Models,
Hydrocarbon separation problem. 225x225, 1308
entries.
34MAHINDASAustralian Economic Models. 1258x1258,
7682 entries.
35WEST0497 Chemical engineering plant
modelsRigorous flash unit with recycling.
497x497, 1727 entries.
36Number of iterations required by preconditioned
iterative methods after permutation
37Number of iterations required by some
ILUT-preconditioned iterative methods after the
matching reordering with and without reverse
Cuthill-McKee
38Reverse Cuthill-McKee ordering