CS 290H Lecture 8 Directed graphs and triangular solves - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

CS 290H Lecture 8 Directed graphs and triangular solves

Description:

Directed Acyclic Graph. If A is triangular, G(A) has no cycles ... When G is acyclic, postorder(v) postorder(w) for every edge (v, w) Sparse Triangular Solve ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 11
Provided by: JohnGi84
Category:

less

Transcript and Presenter's Notes

Title: CS 290H Lecture 8 Directed graphs and triangular solves


1
CS 290H Lecture 8Directed graphs and triangular
solves
  • Pick up course reader in CS department office
    Friday
  • Reading assignment
  • Sparse matrices in Matlab (course reader 1)
  • Sparse partial pivoting in time proportional to
    arithmetic ops (course reader 3).
  • Final project
  • Either an algorithms experiment, or an
    application experiment, or a survey paper
    and talk
  • Experiments can be solo or group surveys are
    solo
  • Suggested term projects on course web site
  • Choose a project by next week email me or come
    talk about it

2
Symmetric positive definite systems ALLT
  • Preorder
  • Independent of numerics
  • Symbolic Factorization
  • Elimination tree
  • Nonzero counts
  • Supernodes
  • Nonzero structure of R
  • Numeric Factorization
  • Static data structure
  • Supernodes use BLAS3 to reduce memory traffic
  • Triangular Solves

O(nonzeros in L)
O(flops)
  • Result
  • Modular gt Flexible
  • Sparse Dense in terms of time/flop

3
Triangular solve x L \ b
  • Column oriented
  • x(1n) b(1n)for j 1 n x(j)
    x(j) / L(j, j)
  • x(j1n) x(j1n)
    L(j1n, j) x(j) end
  • Row oriented
  • for i 1 n x(i) b(i)
  • for j 1 (i-1)
  • x(i) x(i) L(i, j) x(j) end
    x(i) x(i) / L(i, i)end
  • Either way works in O(nnz(L)) time
  • If b and x are dense, flops nnz(L) so no
    problem
  • If b and x are sparse, how do it in O(flops) time?

4
Directed Graph
A
G(A)
  • A is square, unsymmetric, nonzero diagonal
  • Edges from rows to columns
  • Symmetric permutations PAPT

5
Directed Acyclic Graph
A
G(A)
  • If A is triangular, G(A) has no cycles
  • Lower triangular gt edges from higher to lower s
  • Upper triangular gt edges from lower to higher s

6
Directed Acyclic Graph
A
G(A)
  • If A is triangular, G(A) has no cycles
  • Lower triangular gt edges from higher to lower s
  • Upper triangular gt edges from lower to higher s

7
Depth-first search and postorder
  • dfs (starting vertices)
  • marked(1 n) false
  • p 1
  • for each starting vertex v do visit(v)
  • visit (v)
  • if marked(v) then return marked(v)
    true
  • for each edge (v, w) do
    visit(w)
  • postorder(v) p p p 1
  • When G is acyclic, postorder(v) gt postorder(w)
    for every edge (v, w)

8
Sparse Triangular Solve
G(LT)
L
x
b
  • Symbolic
  • Predict structure of x by depth-first search from
    nonzeros of b
  • Numeric
  • Compute values of x in topological order

Time O(flops)
9
Sparse-sparse triangular solve x L \ b
  • Column oriented
  • dfs in G(LT) to predict nonzeros of xx(1n)
    b(1n)for j nonzero indices of x in
    topological order x(j) x(j) / L(j, j)
  • x(j1n) x(j1n) L(j1n, j) x(j)
    end
  • Depth-first search calls visit once per flop
  • Runs in O(flops) time even if its less than
    nnz(L) or n
  • Except for one-time O(n) SPA setup

10
Structure Prediction for Sparse Solve

G(A)
A
x
b
  • Given the nonzero structure of b, what is the
    structure of x?
  • Vertices of G(A) from which there is a path to a
    vertex of b.
Write a Comment
User Comments (0)
About PowerShow.com