Articulation Points 1 of 2 (Ideas)

Slides:



Advertisements
Similar presentations
Minimum Spanning Trees (MSTs) Prim's Algorithm For each vertex not in the tree, keep track of the lowest cost edge that would connect it to the tree This.
Advertisements

Minimum Spanning Tree Sarah Brubaker Tuesday 4/22/8.
CS 312 – Graph Algorithms1 Graph Algorithms Many problems are naturally represented as graphs – Networks, Maps, Possible paths, Resource Flow, etc. Ch.
Breadth-First Search Seminar – Networking Algorithms CS and EE Dept. Lulea University of Technology 27 Jan Mohammad Reza Akhavan.
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 excerpts Graphs (breadth-first-search)
Applications of graph traversals
Data Structures, Spring 2004 © L. Joskowicz 1 Data Structures – LECTURE 14 Strongly connected components Definition and motivation Algorithm Chapter 22.5.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 9 Instructor: Paul Beame.
Breadth First Search (BFS) Part 2 COMP171. Graph / Slide 2 Shortest Path Recording * BFS we saw only tells us whether a path exists from source s, to.
Depth-First Search Lecture 24 COMP171 Fall Graph / Slide 2 Depth-First Search (DFS) * DFS is another popular graph search strategy n Idea is similar.
© Peter Andreae CS4HS Algorithms Searching for an item in a list Sorting a list Searching for a word in text Analysing Networks.
A Fast Algorithm To Determine Minimality of Strongly Connected Digraphs Under the direction of Dr. Robinson By Jianping Zhu.
COMP 261 Lecture 12 Disjoint Sets. Menu Kruskal's minimum spanning tree algorithm Disjoint-set data structure and Union-Find algorithm Administrivia –Marking.
Minimum Spanning Trees
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 Graphs.
CSE373: Data Structures & Algorithms Lecture 10: Disjoint Sets and the Union-Find ADT Lauren Milne Spring 2015.
COMP261 Lecture 6 Dijkstra’s Algorithm. Connectedness Is this graph connected or not? A Z FF C M N B Y BB S P DDGG AA R F G J L EE CC Q O V D T H W E.
Data Structures Chapter 6. Data Structure A data structure is a representation of data and the operations allowed on that data. Examples: 1.Array 2.Record.
M180: Data Structures & Algorithms in Java Trees & Binary Trees Arab Open University 1.
Binary Search Trees (BST)
© 2006 Pearson Addison-Wesley. All rights reserved 14 A-1 Chapter 14 Graphs.
Topological Sort: Definition
Introduction to Graph Theory Lecture 17: Graph Searching Algorithms.
Graph Connectivity This discussion concerns connected components of a graph. Previously, we discussed depth-first search (DFS) as a means of determining.
Graphs + Shortest Paths David Kauchak cs302 Spring 2013.
(c) University of Washington20c-1 CSC 143 Binary Search Trees.
Lecture #13. Topics 1.The Graph Abstract Data Type. 2.Graph Representations. 3.Elementary Graph Operations.
Code: BCA302 Data Structures with C Prof. (Dr.) Monalisa Banerjee By.
Graph Search Applications, Minimum Spanning Tree
COMP 261 Lecture 17 Test Revision.
Articulation Points 2 of 2 (Algorithm)
Graphs Chapter 20.
Thinking about Algorithms Abstractly
May 12th – Minimum Spanning Trees
COMP261 Lecture 6 Dijkstra’s Algorithm.
Discrete Mathematicsq
Binary search tree. Removing a node
Csc 2720 Instructor: Zhuojun Duan
Cse 373 April 14th – TreEs pt 2.
Lectures on Network Flows
COMP 6/4030 ALGORITHMS Prim’s Theorem 10/26/2000.
ITEC 2620M Introduction to Data Structures
i206: Lecture 13: Recursion, continued Trees
CS 3343: Analysis of Algorithms
CS120 Graphs.
CSE373: Data Structures & Algorithms Lecture 10: Disjoint Sets and the Union-Find ADT Linda Shapiro Spring 2016.
Comp 245 Data Structures Graphs.
Graph Search Applications
Biconnected Graph Articulation Points
Graph Algorithm.
CSE373: Data Structures & Algorithms Lecture 18: Dijkstra’s Algorithm
Lectures on Graph Algorithms: searching, testing and sorting
CSE373: Data Structures & Algorithms Lecture 19: Spanning Trees
CMSC 202 Trees.
Subgraphs, Connected Components, Spanning Trees
COMP171 Depth-First Search.
Chapter 14 Graphs © 2006 Pearson Addison-Wesley. All rights reserved.
Lecture 14 Shortest Path (cont’d) Minimum Spanning Tree
CSC 143 Java Trees.
CSC 143 Binary Search Trees.
Simple Graphs: Connectedness, Trees
Bridges and Articulation Points
Warm Up – Tuesday Find the critical times for each vertex.
Chapter 14 Graphs © 2011 Pearson Addison-Wesley. All rights reserved.
Find the value of g. Find the value of h. 105° h g 75°
Assignment 03 Algorithms & Examples.
Lecture 13 Shortest Path (cont’d) Minimum Spanning Tree
Lecture 11 Graph Algorithms
Data Structures Using C++ 2E
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 .
Presentation transcript:

Articulation Points 1 of 2 (Ideas) COMP261 Lecture 8 Articulation Points 1 of 2 (Ideas)

Outline What/Why articulation point Find articulation points (bad algorithm) Find articulation points (a better idea)

Connectedness Is this graph connected or not? Use DFS to traverse graph D BB C U A FF W T E N I V S H AA K Z B X F L R G M Y CC Q J EE P DD GG O

Articulation points This graph is connected, but is it “fragile”? Would deleting one node disconnect it? Articulation point: node whose removal would disconnect part of the graph. D BB C T A U W E FF V I N H B AA K F L X Z G CC R Q Y J EE M P GG O DD

Applications Wireless sensor networks Road networks Social networks Military

Articulation Points: a bad algorithm Take each node out in turn, and test for connectedness articulationPoints ← empty set for each node in graph node.visited ← true; for all other nodes nd: nd.visited ← false recDFS(first neighbour of node) for each remaining neighbour of node if not neighbour.visited then add node to articulationPoints recDFS(node): if not node.visited then node.visited ← true, for each neighbour of node if not neighbour.visited then recDFS(neighbour )

Why is it bad? Cost of DFS: O(e) = O(n2) for very dense graphs Cost of Alg: O(ne) = O(n3) for very dense graphs Why do we have to traverse the whole graph n times, once for each node? Why not do a single traversal, identifying all articulation points as we go?

Articulation Points What are we looking for? Nodes in a graph that separate the graph into two groups, so that all paths from nodes in one group to nodes in the other group go through the node. Group 1 M P R S U Group 2 N Q W T

Articulation Points: DFS Traverse the graph using DFS, keep track of the count number of each node in the search tree A 1 In the graph but not in the search tree B A B 2 C 3 C D D F 4 G 7 5 E G E F 6

Articulation Points: DFS In the search tree, each node separates all the nodes into two subsets The subtree nodes The non-subtree nodes Check if each subtree node is connected to the non-subtree nodes if the node breaks down (whether there are alternative paths) Do we need to check {D,E,F} and {G}? No Alternative path from {D,E,F} to {A,B} Alternative path from {G} to {A,B} ⇒ Alternative path from {D,E,F} to {G} A 1 B 2 C 3 D 4 G 7 5 E F 6

Articulation Points: DFS A node is an articulation point if there exists a subtree node that is connected to non-subtree nodes only through the node, i.e. there is not alternative path An alternative path uses the edges that are in the graph but not in the search tree (back edges) How to check that the back edge connects to non-subtree node? The other end-node has a smaller count number All the nodes with smaller count numbers are non-subtree nodes

Articulation Points: DFS C (count = 3) is an articulation point, because there is not back edge from G to A (count = 1) or B (count = 2) B (count = 2) is not an articulation point, because all the subtree nodes {C, D, E, F, G} can connect via a back edge (D,A) to A (count = 1) D? E? Is it all? We haven’t checked the root A 1 B 2 C 3 D 4 G 7 5 E F 6

Articulation Points: DFS DFS with another root D How to check for D? No non-subtree node Whether there are more than one sub-trees D 1 B A A E 6 2 B F 3 7 C D F C 4 G E G 5

Articulation Points Key ideas of algorithm: Record count number of nodes as you search From each recursive search of a subtree, return the minimum count number that the subtree nodes can "reach back" to. Compare the "reach back" of each subtree to count number of this node, if smaller then there is an alternative path