CS 584 Project Write up Poster session for final Due on day of final

Slides:



Advertisements
Similar presentations
Lecture 15. Graph Algorithms
Advertisements

Ananth Grama, Anshul Gupta, George Karypis, and Vipin Kumar
Graph Algorithms Carl Tropper Department of Computer Science McGill University.
Chen, Lu Mentor: Zhou, Jian Shanghai University, School of Management Chen213.shu.edu.cn.
IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture10.
Graphs: MSTs and Shortest Paths David Kauchak cs161 Summer 2009.
Graph II MST, Shortest Path. Graph Terminology Node (vertex) Edge (arc) Directed graph, undirected graph Degree, in-degree, out-degree Subgraph Simple.
1 Greedy 2 Jose Rolim University of Geneva. Algorithmique Greedy 2Jose Rolim2 Examples Greedy  Minimum Spanning Trees  Shortest Paths Dijkstra.
Applied Discrete Mathematics Week 12: Trees
Graph Algorithms: Minimum Spanning Tree We are given a weighted, undirected graph G = (V, E), with weight function w:
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Chapter 9 Graph algorithms Lec 21 Dec 1, Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
Parallel Programming – Graph Algorithms David Monismith CS599 Notes are primarily based upon Introduction to Parallel Programming, Second Edition by Grama,
Minimum Spanning Trees. Subgraph A graph G is a subgraph of graph H if –The vertices of G are a subset of the vertices of H, and –The edges of G are a.
TECH Computer Science Graph Optimization Problems and Greedy Algorithms Greedy Algorithms  // Make the best choice now! Optimization Problems  Minimizing.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Graph Algorithms: Minimum.
Graphs CS 400/600 – Data Structures. Graphs2 Graphs  Used to represent all kinds of problems Networks and routing State diagrams Flow and capacity.
1 GRAPHS - ADVANCED APPLICATIONS Minimim Spanning Trees Shortest Path Transitive Closure.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
1 Shortest Path Problem Topic 11 ITS033 – Programming & Algorithms C B A E D F Asst. Prof. Dr. Bunyarit Uyyanonvara IT Program,
SPANNING TREES Lecture 21 CS2110 – Spring
Chapter 2 Graph Algorithms.
COSC 2007 Data Structures II Chapter 14 Graphs III.
Graph Algorithms. Definitions and Representation An undirected graph G is a pair (V,E), where V is a finite set of points called vertices and E is a finite.
Dijkstra’s Algorithm. Announcements Assignment #2 Due Tonight Exams Graded Assignment #3 Posted.
Module 5 – Networks and Decision Mathematics Chapter 23 – Undirected Graphs.
Graph Algorithms Ananth Grama, Anshul Gupta, George Karypis, and Vipin Kumar Adapted for 3030 To accompany the text ``Introduction to Parallel Computing'',
Graphs. Definitions A graph is two sets. A graph is two sets. –A set of nodes or vertices V –A set of edges E Edges connect nodes. Edges connect nodes.
Minimum spanning trees (MST) Def: A spanning tree of a graph G is an acyclic subset of edges of G connecting all vertices in G. A sub-forest of G is an.
Graph Algorithms Ananth Grama, Anshul Gupta, George Karypis, and Vipin Kumar To accompany the text ``Introduction to Parallel Computing'', Addison Wesley,
1 Prim’s algorithm. 2 Minimum Spanning Tree Given a weighted undirected graph G, find a tree T that spans all the vertices of G and minimizes the sum.
SPANNING TREES Lecture 20 CS2110 – Fall Spanning Trees  Definitions  Minimum spanning trees  3 greedy algorithms (incl. Kruskal’s & Prim’s)
Graphs. Graphs Similar to the graphs you’ve known since the 5 th grade: line graphs, bar graphs, etc., but more general. Those mathematical graphs are.
Graph Algorithms Gayathri R To accompany the text ``Introduction to Parallel Computing'', Addison Wesley, 2003.
Graph Theory. undirected graph node: a, b, c, d, e, f edge: (a, b), (a, c), (b, c), (b, e), (c, d), (c, f), (d, e), (d, f), (e, f) subgraph.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
Minimum-Cost Spanning Tree weighted connected undirected graph cost of spanning tree is sum of edge costs find spanning tree that has minimum cost Network.
Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block.
Minimum Spanning Trees
Chapter 9 : Graphs Part II (Minimum Spanning Trees)
Introduction to Algorithms
Shortest Paths and Minimum Spanning Trees
Minimum Spanning Tree Chapter 13.6.
Minimum Spanning Trees
Parallel Graph Algorithms
Short paths and spanning trees
Shortest Paths C B A E D F
Data Structures & Algorithms Graphs
Graph Algorithm.
Minimum Spanning Tree.
Minimum Spanning Trees
Connected Components Minimum Spanning Tree
Minimum Spanning Tree.
Graphs Chapter 13.
Spanning Trees.
Chapter 13 Graph Algorithms
Chapter 11 Graphs.
MA/CSSE 473 Day 33 Student Questions Change to HW 13
Shortest Paths and Minimum Spanning Trees
Minimum Spanning Trees
Minimum Spanning Tree.
Weighted Graphs & Shortest Paths
Shortest Paths.
Parallel Graph Algorithms
Spanning Trees Lecture 20 CS2110 – Spring 2015.
Algorithm Course Dr. Aref Rashad
INTRODUCTION A graph G=(V,E) consists of a finite non empty set of vertices V , and a finite set of edges E which connect pairs of vertices .
Ananth Grama, Anshul Gupta, George Karypis, and Vipin Kumar
More Graphs Lecture 19 CS2110 – Fall 2009.
Presentation transcript:

CS 584 Project Write up Poster session for final Due on day of final HTML format Email a tar zipped file to me I will post Poster session for final 4 page poster

Graphs A graph G is a pair (V, E) Graphs can be directed or undirected V is a set of vertices E is a set of edges Graphs can be directed or undirected Terms path adjacent incident

Graph Algorithms We will consider the following algorithms Minimum Spanning Tree Single Source Shortest Paths All pairs shortest paths Transitive closure

Minimum Spanning Tree A spanning tree is a subgraph of G that is a tree containing all the nodes of G. A minimal spanning tree is a spanning tree of minimal weight If the graph G is not connected, it does not have a spanning tree. It has a spanning forest.

Prim’s MST Algorithm Procedure PRIM_MST(V, E, w, r) VT = {r}; d[r] = 0; for all v in (V - VT) do if E[r,v] exists set d[v] = w[r, v] else set d[v] = infinite end for while VT != V find a vertex u such that d[u] = min(d[v] | v in (V - VT)) VT = VT union {u} d[v] = min(d[v], w[u, v]) end while end Procedure

Parallelizing Prim’s Algorithm Since the value of d[v] for a vertex v may change every time a vertex is added, it is impossible to select more than one vertex at a time. So the iterations of the while loop cannot be done in parallel. What about parallelizing a single iteration?

Parallelizing Prim’s Algorithm Consider the calculation of the next node to add to the set. Calculates the min distance from any of the nodes already in the tree. Have all processors calculate a min of their nodes and then do a global min.

Data Decomposition | n/p | d[1..n] n

Analysis Computation ---> O(n2/p) Communication per iteration Global min ---> log2p Bcast min ---> log2p

Single Source Shortest Paths Find the shortest paths from a vertex to all other vertices. A shortest path is a minimum cost path Similar to Prim’s algorithm Note: Instead of storing distances, we store the min cost to a vertex from the vertices in the set.

Dijkstra’s Algorithm Procedure DIJKSTRA_SSP(V, E, w, s) VT = {s}; for all v in (V - VT) do if E[s,v] exists set L[v] = w[r, v] else set L[v] = infinite end for while VT != V find a vertex u such that L[u] = min(L[v] | v in (V - VT)) VT = VT union {u} L[v] = min(L[v], L[u] + w[u, v]) end while end Procedure

Parallelizing Dijkstra’s Algorithm Parallelized exactly the same way as Prim’s algorithm Exact same cost as Prim’s algorithm

All pairs shortest paths Find the shortest paths between all pairs of vertices. Three algorithms presented. Matrix Multiplication Dijkstra’s Floyd’s We will consider Dijkstra’s

Dijkstra’s Algorithm Two ways to parallelize source partitioned Partition the nodes Each processor computes Dijkstra’s sequential algorithm source parallel Run the parallel single source shortest path algorithm for all nodes Can subdivide the processors into sets and also divide the nodes into sets.

Analysis Source Partitioned Source Parallel No communication Each vertex requires O(n2) The algorithm can use at most n processors Source Parallel Communication is O(n log2 n) Each vertex requires O(n2/p) Can efficiently use more processors

Transitive Closure Determine if any two vertices are connected Computed by first computing all pairs shortest path if there is a shortest path, there is a path Parallelize the all pairs shortest path