Fall 2006EE 5301 - VLSI Design Automation I II-1 EE 5301 – VLSI Design Automation I Kia Bazargan University of Minnesota Part II: Algorithms.

Slides:



Advertisements
Similar presentations
IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture10.
Advertisements

Lecture 12: Revision Lecture Dr John Levine Algorithms and Complexity March 27th 2006.
More Graph Algorithms Minimum Spanning Trees, Shortest Path Algorithms.
Chapter 3 The Greedy Method 3.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
1 Spanning Trees Lecture 20 CS2110 – Spring
Approximation Algorithms: Combinatorial Approaches Lecture 13: March 2.
ICS 252 Introduction to Computer Design Routing Fall 2007 Eli Bozorgzadeh Computer Science Department-UCI.
VLSI Layout Algorithms CSE 6404 A 46 B 65 C 11 D 56 E 23 F 8 H 37 G 19 I 12J 14 K 27 X=(AB*CD)+ (A+D)+(A(B+C)) Y = (A(B+C)+AC+ D+A(BC+D)) Dr. Md. Saidur.
3 -1 Chapter 3 The Greedy Method 3 -2 The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each.
VLSI Layout Algorithms CSE 6404 A 46 B 65 C 11 D 56 E 23 F 8 H 37 G 19 I 12J 14 K 27 X=(AB*CD)+ (A+D)+(A(B+C)) Y = (A(B+C)+AC+ D+A(BC+D)) Dr. Md. Saidur.
Chapter 9: Greedy Algorithms The Design and Analysis of Algorithms.
ICS 252 Introduction to Computer Design winter 2005 Eli Bozorgzadeh Computer Science Department-UCI.
The Theory of NP-Completeness
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Fall 2003EE VLSI Design Automation I 37 EE 5301 – VLSI Design Automation I Kia Bazargan University of Minnesota Part II: Algorithms.
Analysis of Algorithms CS 477/677
CSE 421 Algorithms Richard Anderson Lecture 4. What does it mean for an algorithm to be efficient?
Chapter 11: Limitations of Algorithmic Power
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
CPSC 411, Fall 2008: Set 4 1 CPSC 411 Design and Analysis of Algorithms Set 4: Greedy Algorithms Prof. Jennifer Welch Fall 2008.
1 Minimum Spanning Trees Longin Jan Latecki Temple University based on slides by David Matuszek, UPenn, Rose Hoberman, CMU, Bing Liu, U. of Illinois, Boting.
General Routing Overview and Channel Routing
1 Minimum Spanning Trees Longin Jan Latecki Temple University based on slides by David Matuszek, UPenn, Rose Hoberman, CMU, Bing Liu, U. of Illinois, Boting.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Graph Algorithms: Minimum.
Minimum Spanning Trees
1 GRAPHS - ADVANCED APPLICATIONS Minimim Spanning Trees Shortest Path Transitive Closure.
Algorithmic Foundations COMP108 COMP108 Algorithmic Foundations Greedy methods Prudence Wong
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
Algorithms: Design and Analysis Summer School 2013 at VIASM: Random Structures and Algorithms Lecture 3: Greedy algorithms Phan Th ị Hà D ươ ng 1.
MCS312: NP-completeness and Approximation Algorithms
Chapter 11 Limitations of Algorithm Power. Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples:
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
SPANNING TREES Lecture 21 CS2110 – Spring
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Chapter 2 Graph Algorithms.
Theory of Computing Lecture 15 MAS 714 Hartmut Klauck.
Advanced Algorithm Design and Analysis (Lecture 13) SW5 fall 2004 Simonas Šaltenis E1-215b
Minimum Spanning Trees CSE 2320 – Algorithms and Data Structures Vassilis Athitsos University of Texas at Arlington 1.
© 2015 JW Ryder CSCI 203 Data Structures1. © 2015 JW Ryder CSCI 203 Data Structures2.
1 COMP3040 Tutorial 1 Analysis of algorithms. 2 Outline Motivation Analysis of algorithms Examples Practice questions.
Télécom 2A – Algo Complexity (1) Time Complexity and the divide and conquer strategy Or : how to measure algorithm run-time And : design efficient algorithms.
Prims’ spanning tree algorithm Given: connected graph (V, E) (sets of vertices and edges) V1= {an arbitrary node of V}; E1= {}; //inv: (V1, E1) is a tree,
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Lecture 11 Algorithm Analysis Arne Kutzner Hanyang University / Seoul Korea.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
SPANNING TREES Lecture 20 CS2110 – Fall Spanning Trees  Definitions  Minimum spanning trees  3 greedy algorithms (incl. Kruskal’s & Prim’s)
CSE 589 Part V One of the symptoms of an approaching nervous breakdown is the belief that one’s work is terribly important. Bertrand Russell.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
Lecture. Today Problem set 9 out (due next Thursday) Topics: –Complexity Theory –Optimization versus Decision Problems –P and NP –Efficient Verification.
Introduction to NP Instructor: Neelima Gupta 1.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
COMP108 Algorithmic Foundations Greedy methods
Introduction to Algorithms
Minimum Spanning Trees
Lecture 10 Algorithm Analysis
ICS 353: Design and Analysis of Algorithms
CSE 373 Data Structures and Algorithms
ICS 252 Introduction to Computer Design
Chapter 11 Limitations of Algorithm Power
Minimum Spanning Trees
CSE 373: Data Structures and Algorithms
Time Complexity and the divide and conquer strategy
北京航空航天大学微电子学院 CADET实验室 成元庆 主讲
Presentation transcript:

Fall 2006EE VLSI Design Automation I II-1 EE 5301 – VLSI Design Automation I Kia Bazargan University of Minnesota Part II: Algorithms

Fall 2006EE VLSI Design Automation I II-2 References and Copyright Textbooks referred (none required)  [Mic94] G. De Micheli “Synthesis and Optimization of Digital Circuits” McGraw-Hill,  [CLR90] T. H. Cormen, C. E. Leiserson, R. L. Rivest “Introduction to Algorithms” MIT Press,  [Sar96] M. Sarrafzadeh, C. K. Wong “An Introduction to VLSI Physical Design” McGraw-Hill,  [She99] N. Sherwani “Algorithms For VLSI Physical Design Automation” Kluwer Academic Publishers, 3 rd edition, 1999.

Fall 2006EE VLSI Design Automation I II-3 References and Copyright (cont.) Slides used: (Modified by Kia when necessary)  [©Sarrafzadeh] © Majid Sarrafzadeh, 2001; Department of Computer Science, UCLA  [©Sherwani] © Naveed A. Sherwani, 1992 (companion slides to [She99])  [©Keutzer] © Kurt Keutzer, Dept. of EECS, UC-Berekeley  [©Gupta] © Rajesh Gupta UC-Irvine

Fall 2006EE VLSI Design Automation I II-4 Combinatorial Optimization Problems with discrete variables  Examples: oSORTING: given N integer numbers, write them in increasing order oKNAPSACK: given a bag of size S, and items {(s 1, w 1 ), (s 2, w 2 ),..., (s n, w n )}, where s i and w i are the size and value of item i respectively, find a subset of items with maximum overall value that fit in the bag. oMore examples:  A problem vs. problem instance Problem complexity:  Measures of complexity  Complexity cases: average case, worst case  Tractability ­ solvable in polynomial time [©Gupta]

Fall 2006EE VLSI Design Automation I II-5 Algorithm An algorithm defines a procedure for solving a computational problem  Examples: oQuick sort, bubble sort, insertion sort, heap sort oDynamic programming method for the knapsack problem Definition of complexity  Run time on deterministic, sequential machines  Based on resources needed to implement the algorithm oNeeds a cost model: memory, hardware/gates, communication bandwidth, etc. oExample: RAM model with single processor  running time  # operations [©Gupta]

Fall 2006EE VLSI Design Automation I II-6 Algorithm (cont.) Definition of complexity (cont.)  Example: Bubble Sort  Scalability with respect to input size is important oHow does the running time of an algorithm change when the input size doubles? oFunction of input size (n). Examples: n 2 +3n, 2 n, n log n,... oGenerally, large input sizes are of interest (n > 1,000 or even n > 1,000,000) oWhat if I use a better compiler? What if I run the algorithm on a machine that is 10x faster? [©Gupta] for (j=1 ; j< N; j++) { for (i=; i < N-j-1; i++) { if (a[i] > a[i+1]) { hold = a[i]; a[i] = a[i+1]; a[i+1] = hold; } for (j=1 ; j< N; j++) { for (i=; i < N-j-1; i++) { if (a[i] > a[i+1]) { hold = a[i]; a[i] = a[i+1]; a[i+1] = hold; }

Fall 2006EE VLSI Design Automation I II-7 Function Growth Examples

Fall 2006EE VLSI Design Automation I II-8 Asymptotic Notions Idea:  A notion that ignores the “constants” and describes the “trend” of a function for large values of the input Definition  Big-Oh notation f(n) = O ( g(n) ) if constants K and n 0 can be found such that:  n  n 0, f(n)  K. g(n) g is called an “upper bound” for f (f is “of order” g: f will not grow larger than g by more than a constant factor) Examples: 1/3 n 2 = O (n 2 ) (also O(n 3 ) ) 0.02 n n = O (n 2 )

Fall 2006EE VLSI Design Automation I II-9 Asymptotic Notions (cont.) Definition (cont.)  Big-Omega notation f(n) =  ( g(n) ) if constants K and n 0 can be found such that:  n  n 0, f(n)  K. g(n) g is called a “lower bound” for f  Big-Theta notation f(n) =  ( g(n) ) if g is both an upper and lower bound for f Describes the growth of a function more accurately than O or  Example: n n   (n 2 ) 4 n =  (n 2 )

Fall 2006EE VLSI Design Automation I II-10 Asymptotic Notions (cont.) How to find the order of a function?  Not always easy, esp if you start from an algorithm  Focus on the “dominant” term o4 n n 2 + log n  O(n 3 ) on + n log(n)  n log (n)  n! = K n > n K > log n > log log n > K  n > log n, n log n > n, n! > n 10. What do asymptotic notations mean in practice?  If algorithm A has “time complexity” O(n 2 ) and algorithm B has time complexity O(n log n), then algorithm B is better  If problem P has a lower bound of  (n log n), then there is NO WAY you can find an algorithm that solves the problem in O(n) time.

Fall 2006EE VLSI Design Automation I II-11 Problem Tractability Problems are classified into “easier” and “harder” categories  Class P: a polynomial time algorithm is known for the problem (hence, it is a tractable problem)  Class NP (non-deterministic polynomial time): ~ polynomial solution not found yet (probably does not exist)  exact (optimal) solution can be found using an algorithm with exponential time complexity Unfortunately, most CAD problems are NP  Be happy with a “reasonably good” solution Reading material on time complexity and NP- completeness:  Textbook section 3.3, Chapter 4  See the “Useful Links” slides at the end [©Gupta] Also in case anybody cares, it is incorrect to describe an optimization problem as NP- complete. Only decision problems with "Yes/No" (e.g. "does a solution exist of size K") answers can properly be termed NP- complete. Optimization problems (e.g. "find the best solution") are usually "NP-Hard". In polite company (and most journals) incorrect but well intentioned uses of "NP-complete" are accepted. -Craig Chase

Fall 2006EE VLSI Design Automation I II-12 Algorithm Types Based on quality of solution and computational effort  Deterministic  Probabilistic or randomized  Approximation  Heuristics: local search Problem vs. algorithm complexity [©Gupta]

Fall 2006EE VLSI Design Automation I II-13 Deterministic Algorithm Types Algorithms usually used for P problems  Exhaustive search! (aka exponential)  Dynamic programming  Divide & Conquer (aka hierarchical)  Greedy  Mathematical programming  Branch and bound Algorithms usually used for NP problems (not seeking “optimal solution”, but a “good” one)  Greedy (aka heuristic)  Genetic algorithms  Simulated annealing  Restrict the problem to a special case that is in P

Fall 2006EE VLSI Design Automation I II-14 Dynamic Programming (read the first two examples in the document written by Michael A. Trick – see the “Useful Links (cont.)” slide)  Plant proposals  Shortest path 0-1 Knapsack problem:  Given N discrete items of size s i and value v i, how to fill a knapsack of size M to get the maximum value? There is only one of each item that can be either taken in whole or left out. Solution to the knapsack problem: 

Fall 2006EE VLSI Design Automation I II-15 Dynamic Programming: Knapsack Partial solution constructed for items 1..(i-1) for knapsack sizes from 0..M : cwcw c0c0 c1c1 c2c2 c M-1 cMcM … i M-1M For each knapsack size, how to extend the solution from 1..(i-1) to include i ? i-1 w cwcw i Option 1: do not take item i i-1 w c w-si +v i i Option 2: take item i w-s i

Fall 2006EE VLSI Design Automation I II-16 Graph Definition Graph: set of “objects” and their “connections” Formal definition:  G = (V, E), V={v 1, v 2,..., v n }, E={e 1, e 2,..., e m }  V: set of vertices (nodes), E: set of edges (links, arcs)  Directed graph: e k = (v i, v j )  Undirected graph: e k ={v i, v j }  Weighted graph: w: E  R, w(e k ) is the “weight” of e k. a c de b a c de b

Fall 2006EE VLSI Design Automation I II-17 Graph Representation: Adjacency List acdebacdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· b · c · d · e · a · b·d·a·a·b·e·d·

Fall 2006EE VLSI Design Automation I II-18 Graph Representation: Adjacency Matrix acdebacdeb b c d e a bcdea b c d e a bcdea

Fall 2006EE VLSI Design Automation I II-19 Edge / Vertex Weights in Graphs Edge weights  Usually represent the “cost” of an edge  Examples: oDistance between two cities oWidth of a data bus  Representation oAdjacency matrix: instead of 0/1, keep weight oAdjacency list: keep the weight in the linked list item Node weight  Usually used to enforce some “capacity” constraint  Examples: oThe size of gates in a circuit oThe delay of operations in a “data dependency graph” acdeb a-+*b

Fall 2006EE VLSI Design Automation I II-20 Hypergraphs Hypergraph definition:  Similar to graphs, but edges not between pairs of vertices, but between a set of vertices  Directed / undirected versions possible  Just like graphs, a node can be the source (or be connected to) multiple hyperedges Data structure?

Fall 2006EE VLSI Design Automation I II-21 Graph Search Algorithms Purpose: to visit all the nodes Algorithms  Depth-first search  Breadth-first search  Topological Examples [©Sherwani] A B G F D E C A B DE F C G B A E GF C D

Fall 2006EE VLSI Design Automation I II-22 Depth-First Search Algorithm struct vertex {... int mark; }; dfs ( v ) v.marked  1 print v for each (v, u)  E if (u.mark != 1) // not visited yet? dfs (u) Algorithm DEPTH_FIRST_SEARCH ( V, E ) for each v  V v.marked  0 // not visited yet for each v  V if (v.marked == 0) dfs (v)

Fall 2006EE VLSI Design Automation I II-23 Breadth-First Search Algorithm bfs ( v, Q) v.marked  1 for each (v, u)  E if (u.mark != 1) // not visited yet? Q  Q + u Algorithm BREADTH_FIRST_SEARCH ( V, E ) Q  {v 0 } // an arbitrary node while Q != {} v  Q.pop() if (v.marked != 1) print v bfs (v) // explore successors There is something wrong with this code. What is it?

Fall 2006EE VLSI Design Automation I II-24 Distance in (non-weighted) Graphs Distance d G (u,v):  Length of a shortest u--v path in G. uv d(u,v)=2 x y d(x,y) = 

Fall 2006EE VLSI Design Automation I II-25 Moor’s Breadth-First Search Algorithm Objective:  Find d(u,v) for a given pair (u,v) and a shortest path u--v How does it work?  Do BFS, and assign (w) the first time you visit a node. (w)=depth in BFS. Data structure  Q a queue containing vertices to be visited  (w)length of the shortest path u--w (initially  )   (w)parent node of w on u--w

Fall 2006EE VLSI Design Automation I II-26 Moor’s Breadth-First Search Algorithm Algorithm: 1.Initialize o (w)   for w  u o (u)  0 oQ  Q+u 2.If Q  , x  pop(Q) else stop: “no path u--v” 3.  (x,y)  E, oif (y)= ,  (y)  x o (y)  (x)+1 oQ  Q+y 4.If (v)=  return to step 2 5.Follow  (w) pointers from v to u.

Fall 2006EE VLSI Design Automation I II-27 Moor’s Breadth-First Search Algorithm u v1v1 v2v2 v3v3 v4v4 v5v5 v6v6 v7v7 v8v8 v9v9 v 10 Q = u Nodeuv 1 v 2 v 3 v 4 v 5 v 6 v 7 v 8 v 9 v 10 0  

Fall 2006EE VLSI Design Automation I II-28 Moor’s Breadth-First Search Algorithm u v1v1 v2v2 v3v3 v4v4 v5v5 v6v6 v7v7 v8v8 v9v9 v 10 Q = v 1, v 2, v 5 Nodeuv 1 v 2 v 3 v 4 v 5 v 6 v 7 v 8 v 9 v  1   -uu--u-----

Fall 2006EE VLSI Design Automation I II-29 Moor’s Breadth-First Search Algorithm u v1v1 v2v2 v3v3 v4v4 v5v5 v6v6 v7v7 v8v8 v9v9 v 10 Q = v 4, v 3, v 6, v 10 Nodeuv 1 v 2 v 3 v 4 v 5 v 6 v 7 v 8 v 9 v  2  -uuv 2 v 1 uv 5 ---v 5

Fall 2006EE VLSI Design Automation I II-30 Moor’s Breadth-First Search Algorithm u v1v1 v2v2 v3v3 v4v4 v5v5 v6v6 v7v7 v8v8 v9v9 v 10 Q = v 7 Nodeuv 1 v 2 v 3 v 4 v 5 v 6 v 7 v 8 v 9 v  2  -uuv 2 v 1 uv 5 v 4 --v 5

Fall 2006EE VLSI Design Automation I II-31 Notes on Moor’s Algorithm Why the problem of BREADTH_FIRST_SEARCH algorithm does not exist here? Time complexity? Space complexity?

Fall 2006EE VLSI Design Automation I II-32 Distance in Weighted Graphs Why a simple BFS doesn’t work any more?  Your locally best solution is not your globally best one  First, v 1 and v 2 will be visited u v1v1 v2v =3  =u =11  =u v 2 should be revisited u v1v1 v2v =3  =u =5  =v 1

Fall 2006EE VLSI Design Automation I II-33 Dijkstra’s Algorithm Objective:  Find d(u,v) for all pairs (u,v) (fixed u) and the corresponding shortest paths u--v How does it work?  Start from the source, augment the set of nodes whose shortest path is found.  decrease (w) from  to d(u,v) as you find shorter distances to w.  (w) changed accordingly. Data structure:  S the set of nodes whose d(u,v) is found  (w)current length of the shortest path u--w   (w)current parent node of w on u—w

Fall 2006EE VLSI Design Automation I II-34 Dijkstra’s Algorithm O(e) O(v 2 ) Algorithm: 1.Initialize o (v)   for v  u o (u)  0 oS  {u} 2.For each v  S’ s.t. u i v  E, oIf (v) > (u i ) + w(u i v), (v)  (u i ) + w(u i v)  (v)  u i 3.Find m=min{ (v)|v  S’ } and (v j )==m oS  S  {v j } 4.If |S|<|V|, goto step 2

Fall 2006EE VLSI Design Automation I II-35 Dijkstra’s Algorithm - why does it work? Proof by contradiction  Suppose v is the first node being added to S such that (v) > d(u 0,v) (d(u 0,v) is the “real” shortest u 0 --v path)  The assumption that (v) and d(u 0,v) are different, means there are different paths with lengths (v) and d(u 0,v)  Consider the path that has length d(u 0,v). Let x be the first node in S’ on this path  d(u 0,v) (x) contradiction u0u0 v x

Fall 2006EE VLSI Design Automation I II-36 Static Timing Analysis Finding the longest path in a general graph is NP-hard, even when edges are not weighted Polynomial for DAG (directed acyclic graphs) In circuit graphs, “static timing analysis (STA)”…  …refers to the problem of finding the max delay from the input pins of the circuit (esp nodes) to each gate  Max delay of the output pins determines clock period  In sequential circuits, FF input acts as output pin, FF output acts as input pin  Critical path is a path with max delay among all paths  In addition to the “arrival time” of each node, we are interested in knowing the “slack” of each node / edge

Fall 2006EE VLSI Design Automation I II-37 STA Example: Arrival Times eg b h c f d a Assumptions:  All inputs arrive at time 0  All gate delays = 1  All wire delays = 0 Question: Arrival time of each gate? Circuit delay? t i = max {t j } + d i

Fall 2006EE VLSI Design Automation I II-38 STA Example: Required Times Assumptions:  All inputs arrive at time 0  All gate delays = 1, wire delay = 0  Clock period = 7 Question: maximum required time (RT) of each gate? (i.e., if the gate output is generated later than RT, clk period is violated) eg b h c f d a r i = min {r j -d j }

Fall 2006EE VLSI Design Automation I II-39 STA Example: Slack Assumptions:  All inputs arrive at time 0  All gate delays = 1, wire delay = 0  Clock period = 7 Question: What is the maximum amount of delay each gate can be slower not to violate timing? eg b h c f d a s i = r i -t i 2-0=22-0=2 2-0=22-0=2 2-0=22-0=2 3-0=33-0=3 5-0=55-0=5 5-0=55-0=5 3-1=23-1=2 3-1=23-1=2 4-2=24-2=2 4-2=24-2=2 5-3=25-3=2 6-1=56-1=5 6-4=26-4=2 7-4=37-4=3 7-5=27-5=2 7-5=27-5=2 7-3=47-3=4

Fall 2006EE VLSI Design Automation I II-40 STA: Issues STA can be done in linear time  How to implement? What would change if wires have non-zero delays? If the delay of one gate changes, what is the time complexity of updating the slack of all nodes? How can slack be used? How to distribute a path’s slack to different edges? (the budgeting problem) How to maintain a list of K-most critical paths?  Why important?  Variation: paths of delay > D  What is the upper bound on the number of such paths?

Fall 2006EE VLSI Design Automation I II-41 Minimum Spanning Tree (MST) Tree (usually undirected):  Connected graph with no cycles  |E| = |V| - 1 Spanning tree  Connected subgraph that covers all vertices  If the original graph not tree, graph has several spanning trees Minimum spanning tree  Spanning tree with minimum sum of edge weights (among all spanning trees)  Example: build a railway system to connect N cities, with the smallest total length of the railroad

Fall 2006EE VLSI Design Automation I II-42 Difference Between MST and Shortest Path Why can’t Dijkstra solve the MST problem?  Shortest path: min sum of edge weight to individual nodes  MST: min sum of TOTAL edge weights that connect all vertices Proposal:  Pick any vertex, run Dijkstra and note the paths to all nodes (prove no cycles created) Debunk: show a counter example a b c Draw on your slides!

Fall 2006EE VLSI Design Automation I II-43 Minimum Spanning Tree Algorithms Basic idea:  Start from a vertex (or edge), and expand the tree, avoiding loops (i.e., add a “safe” edge)  Pick the minimum weight edge at each step Known algorithms  Prim: start from a vertex, expand the connected tree  Kruskal: start with the min weight edge, add min weight edges while avoiding cycles (build a forest of small trees, merge them)

Fall 2006EE VLSI Design Automation I II-44 Prim’s Algorithm for MST Data structure:  Sset of nodes added to the tree so far  S’set of nodes not added to the tree yet  Tthe edges of the MST built so far  (w)current length of the shortest edge (v, w) that connects w to the current tree   (w)potential parent node of w in the final MST (current parent that connects w to the current tree)

Fall 2006EE VLSI Design Automation I II-45 Prim’s Algorithm  Initialize S, S’ and T oS  {u 0 }, S’  V \ {u 0 } // u 0 is any vertex oT  { } o  v  S’, (v)    Initialize and  for the vertices adjacent to u 0 oFor each v  S’ s.t. (u 0,v)  E, (v)   ((u 0,v))  (v)  u 0  While (S’ !=  ) oFind u  S’, s.t.  v  S’, (u)  (v) oS  S  {u}, S’  S’ \ {u}, T  T  { (  (u), u) } oFor each v s.t. (u, v)  E, If (v) >  ((u,v)) then (v)   ((u,v))  (v)  u

Fall 2006EE VLSI Design Automation I II-46 Other Graph Algorithms of Interest... Min-cut partitioning Graph coloring Maximum clique, independent set Min-cut algorithms Steiner tree Matching...

Fall 2006EE VLSI Design Automation I II-47 Useful Links (Also Linked from Course WebPage) Algorithms and Visualization  Compaq's JCAT: allows users to run a number of algorithms in their web browsers and visualize the progress of the program.  SGI's Standard Template Library (click on the "Index" link. "Table of contents" is very useful too).  Microsoft MSDN library (If you don't know where to go, type "fopen" in the "Search for" textbox and click "GO" for normal C functions, and then navigate using the tree on the left. For STL documentation, search for "vector::push_back".) Books on STL and templtes (thanks to Arvind U of M for suggesting thebooks) :  Nicolai M. Josuttis, “The C++ Standard Library: A Tutorial and Reference”, Addison-Wesley, 1999, ISBN:  David Vanevoorde and Nicolai M. Josuttis, “C++ Templates, the Complete Guide”, Addison-Wesley, 2003, ISBN:

Fall 2006EE VLSI Design Automation I II-48 Useful Links (cont.) Time Complexity and Asymptotic Notations   Asymptotic bounds: definitions and theorems s/Asymptotic/asymptotic/asymptotic.html   CMSC 341 (at CSEE/UMBC) Lecture /Lectures/AA/AsymptoticAnalysis.ppt  Michael A. Trick, “A Tutorial on Dynamic Programming”,

Fall 2006EE VLSI Design Automation I II-49 Papers C. J. Alpert, A. Devgan, S. T. Quay, “Buffer insertion with accurate gate and interconnect delay computation”, Design Automation Conference, pp. 479–484,  Shows that the Elmore model overesimates delay, offers a new, more accurate model. Uses this model to optimize the buffer insertion

Fall 2006EE VLSI Design Automation I II-50 From: [Dynamic programming, data.3, primal, table, no bounds]