Presentation is loading. Please wait.

Presentation is loading. Please wait.

Bridges and Articulation Points

Similar presentations


Presentation on theme: "Bridges and Articulation Points"— Presentation transcript:

1 Bridges and Articulation Points

2 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

3 Articulation Points u is an articulation point if
u is root and has more than 2 children u isn't a root and there exists one of its subtrees that has no back edges for an ancestor of u 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).

4 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

5 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

6 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

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

8 How to implement? Let's define for each node v Example:
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 v Notice that low[e] = 3 and not 1 a b c d e f g h


Download ppt "Bridges and Articulation Points"

Similar presentations


Ads by Google