Presentation is loading. Please wait.

Presentation is loading. Please wait.

Articulation Points 1 of 2 (Ideas)

Similar presentations


Presentation on theme: "Articulation Points 1 of 2 (Ideas)"— Presentation transcript:

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

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

3 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

4 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

5 Applications Wireless sensor networks Road networks Social networks
Military

6 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 )

7 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?

8 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

9 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

10 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

11 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

12 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

13 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

14 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


Download ppt "Articulation Points 1 of 2 (Ideas)"

Similar presentations


Ads by Google