Tree Contraction Label leaf nodes 1 n Rake
Tree Contraction Label leaf nodes 1. . . n – Rake odd indexed leaf nodes – Left Compress – Right Compress Key: avoid memory conflicts
Tree Contraction for arithmetic expression • each node has an expression: two variables x, y, and four coefficients a, b, c, d, e, f, g • Rake: replace the variable with the corresponding value • Compress: – note that node v has two children x and y, and x is compressed to v, then the expression associated with x has only one variable. – v has expression is f(x, y), and x has expression g(x), – the expression of v => f(g(x), y) – general formula: Thus, compressing corresponds to computing the new coefficients.
Work Complexity of Compression • Efficient? each compress involves 20 operations • Note that the leaf node contains only variable or constant • The coefficients are mostly zero if the operations do not involve division • Worth while to compare this technique with other know optimization techniques (Cook etc. , )
Tree Compression Applications f • In general, let S be a set. s 2 s 1 • F {f | f : S S S} • If S is finite, any tree contraction can be done efficiently Use finite table • Number of children – rake x to v : add value of x to y – compress x to v : add value of x to y • Height?
Vertex Cover of a tree and Tree Contraction f Vertex cover of a tree F: not selected R: selected Mark all nodes with F Let x be the label of parent, y be the label of child f(x, y) : new label after raking or compressing the child Sequential algorithm: computing f s s
VC of a tree • How to do in parallel? – Apply tree contraction by applying f whenever rake or compress is done. • How to handle node degree more than 2? – Convert it into a binary tree – For VC, many dummy nodes. – Labeling function should be adjusted? => Not necessary a a b c d a 2 d a 1 a 0 c b
Other applications of Tree Contraction – Minimum Independent set for a tree – Dominating set for a tree For Eulerian tour technique – Biconnected components – Least Common Ancestor
Least Common Ancestor • To be prepared
Evaluating Straight Line Program in parallel (Dynamically) • Straight Line Program:
- Slides: 9