Bridges and Articulation Points

Slides:



Advertisements
Similar presentations
Graph Algorithms Algorithm Design and Analysis Victor AdamchikCS Spring 2014 Lecture 11Feb 07, 2014Carnegie Mellon University.
Advertisements

Chapter 9 Graphs.
Chapter 10: Trees. Definition A tree is a connected undirected acyclic (with no cycle) simple graph A collection of trees is called forest.
Graph Traversals Visit vertices of a graph G to determine some property: Is G connected? Is there a path from vertex a to vertex b? Does G have a cycle?
Graph Searching (Graph Traversal) Algorithm Design and Analysis Week 8 Bibliography: [CLRS] – chap 22.2 –
Tirgul 8 Graph algorithms: Strongly connected components.
Applications of graph traversals
16a-Graphs-More (More) Graphs Fonts: MTExtra:  (comment) Symbol:  Wingdings: Fonts: MTExtra:  (comment) Symbol:  Wingdings:
Applications of DFS: Articulation Points and Biconnected Components
Data Structures, Spring 2004 © L. Joskowicz 1 Data Structures – LECTURE 14 Strongly connected components Definition and motivation Algorithm Chapter 22.5.
Data Structures & Algorithms Graph Search Richard Newman based on book by R. Sedgewick and slides by S. Sahni.
CSE 780 Algorithms Advanced Algorithms Shortest path Shortest path tree Relaxation Bellman-Ford Alg.
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
A tree is a simple graph satisfying: if v and w are vertices and there is a path from v to w, it is a unique simple path. a b c a b c.
Applications of Depth-First Search
Lecture 15: Depth First Search Shang-Hua Teng. Graphs G= (V,E) B E C F D A B E C F D A Directed Graph (digraph) –Degree: in/out Undirected Graph –Adjacency.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 10 Instructor: Paul Beame.
Data Structures, Spring 2006 © L. Joskowicz 1 Data Structures – LECTURE 14 Strongly connected components Definition and motivation Algorithm Chapter 22.5.
Depth-First Search Idea: Keep going forward as long as there are unseen nodes to be visited. Backtrack when stuck. v G G G G is completely traversed.
Graph Algorithms Using Depth First Search Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Analysis of Algorithms.
Week 11 - Wednesday.  What did we talk about last time?  Graphs  Euler paths and tours.
Tree A connected graph that contains no simple circuits is called a tree. Because a tree cannot have a simple circuit, a tree cannot contain multiple.
Discrete Structures Lecture 12: Trees Ji Yanyan United International College Thanks to Professor Michael Hvidsten.
Graphs.
CSE 2331 / 5331 Topic 12: Shortest Path Basics Dijkstra Algorithm Relaxation Bellman-Ford Alg.
Discrete Structures Trees (Ch. 11)
5.5.2 M inimum spanning trees  Definition 24: A minimum spanning tree in a connected weighted graph is a spanning tree that has the smallest possible.
Trees : Part 1 Section 4.1 (1) Theory and Terminology (2) Preorder, Postorder and Levelorder Traversals.
1 Chapter 22: Elementary Graph Algorithms II. 2 About this lecture Depth First Search DFS Tree and DFS Forest Properties of DFS Parenthesis theorem (very.
1 Spanning Trees Longin Jan Latecki Temple University based on slides by David Matuszek, UPenn, Rose Hoberman, CMU, Bing Liu, U. of Illinois, Boting Yang,
Topological Sort: Definition
Introduction to Graph Theory Lecture 17: Graph Searching Algorithms.
Tree - in “math speak” An ________ graph is a set of vertices/nodes and a set of edges, each edge connects two vertices. Any undirected graph in which.
7 Finding Bridge in a Graph. What is a bridge ? A C D B F G E.
1 Trees : Part 1 Reading: Section 4.1 Theory and Terminology Preorder, Postorder and Levelorder Traversals.
CSC317 1 At the same time: Breadth-first search tree: If node v is discovered after u then edge uv is added to the tree. We say that u is a predecessor.
Graph Search Applications, Minimum Spanning Tree
Breadth-First Search (BFS)
Graphs and Algorithms (2MMD30)
Graphs-Part II Depth First Search (DFS)
Graph Graphs and graph theory can be used to model:
Computing Connected Components on Parallel Computers
Introduction to Trees Section 11.1.
Algorithms and Complexity
Graph Algorithms Using Depth First Search
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 10 Trees Slides are adopted from “Discrete.
Graph Search Applications
Biconnected Graph Articulation Points
CSE 421: Introduction to Algorithms
Biconnected Graph Articulation Points
Advanced Algorithms Analysis and Design
Elementary graph algorithms Chapter 22
Bridges and Articulation Points
Lectures on Graph Algorithms: searching, testing and sorting
2018, Fall Pusan National University Ki-Joune Li
Depth-First Search Graph Traversals Depth-First Search DFS.
2017, Fall Pusan National University Ki-Joune Li
CMSC 202 Trees.
Shortest path algorithm
CSE 421: Introduction to Algorithms
Spanning Trees Longin Jan Latecki Temple University based on slides by
Subgraphs, Connected Components, Spanning Trees
A Introduction to Computing II Lecture 13: Trees
Trees 11.1 Introduction to Trees Dr. Halimah Alshehri.
Strongly Connected Components
Elementary graph algorithms Chapter 22
Applications of DFS: Articulation Points and Biconnected Components
Heaps Chapter 6 Section 6.9.
Chapter 22: Elementary Graph Algorithms III
Presentation transcript:

Bridges and Articulation Points

Articulation Points Is a node u of a graph such as if you remove u from the graph then the number of components increases 3 components 1 component

Articulation Points u is an articulation point if u isn't a root and there exists one of its subtrees that has no back edges for an ancestor of u u is root and has more than 2 children p u Right Wrong The second and third subtree all have back edges to p (an ancestor of u), while the first one hasn't, therefore u is an articulation point (notice that if you remove it, the first subtree will be disconnected from the rest of the graph).

Bridges Is an edge uv of a graph such as if you remove uv from the graph then the number of components increases 2 components 1 component

Bridges uv is a bridge if and only if it doesn't belong to a cycle. Proof uv is a bridge => doesn't belong to a cycle uv doesn't belong to a cycle => uv is a bridge u v u v uv is not in a cycle so if uv is removed there is no other way to get from u to v, so you are cutting the graph into 2 components (one with u and another with v) If you remove uv there is another path that takes from u to v (the graph is still connected), so uv is not a bridge

Bridges The definition on the previous slide gives us that: uv is a bridge ⇔ there is no back edge from a descendant of u to an ancestor of u uv is a bridge => there is no back edge... uv doesn't have a back edge... => uv is a bridge u u v v Assume that uv is not a bridge, then once it’s removed it must have a path between u and v, but we are assuming that there is no back edge, contradiction. Assume that there is a back edge, then uv is part of a cycle and by the previous slide this is a contradiction

Interesting fact If you remove a bridge of a graph the number of components increases by exactly one but if you remove an articulation point the number of components can increase by more than one.

Naïve Implementation (not optimal) Find a vertex or an edge that when removed will disconnect the UNDIRECTED graph Calculate the number of connected components Try, one-by-one, removing each edge/vertex Recalculate number of CCs If more CCs, then it’s an articulation point or bridge.

A better approach Compute DFS, but also store two values per node: d: the order in which the node was reached during DFS Low: smallest d reachable from current subtree At a vertex, the Low value is the lowest of: Your own value (obviously, you can reach yourself) Any back edge The lowest returned from a recursive call on all children Notice: it does NOT include the parent If a neighbor vertex has a Low value greater or equal to your own d, then you’re at an articulation point Root node is special: it is an articulation point iff there are 2 (or more) children not part of the same branch (i.e. if during DFS, it has to start recursive calls on at least 2) If Low(u) > d(v), then u-v is a bridge Likewise, if Low(v) > d(u), then u-v is a bridge

How to implement? d[v] = time instant that you enter a node low[v] = the smallest d that v can reach through its descendants (including v itself) Example: d[a] = 1 d[b] = 2 d[c] = 3 d[d] = 8 d[e] = 4 d[f] = 7 d[g] = 5 d[h] = 6 low[a] = 1 low[b] = 1 low[c] = 1 low[d] = 8 low[e] = 3 low[f] = 2 low[g] = 3 low[h] = 6 u is an articulation point if low[v] >= d[u] for some children v uv is a bridge if low[v] > d[u] for some children of v Notice that low[e] = 3 and not 1 Notice that a has 2 children (b and c), but they are connected, so only 1 is a “child” in the DFS search tree a b c d e f g h

d Low 1 2 d is when visited Low is lowest seen in that subgraph 7 3 6 9 4 3 8 5 3

d Low 1 2 Articulation point if neighbor has a low value >= your d 7 3 6 9 4 3 8 5 3

d Low 1 2 Bridge if Low(u) > d(v) for some edge u-v 7 3 6 9 4 3 8 5 3