$ Tarjan $ brief study notes

$ QwQ $ because $ gql $ of $ tarjan $ has been very poor so been thinking about learning to write notes ,,, after a $ inf $ cushions day finally wrote hee hee.

First, let me basic definition of several important array.

$ Dfn $ too simple not to say $ QwQ $

But because there are not the same as a directed graph undirected graph $ low $ defined ,,, so I I I I distinguish defined under the two $ low $, $ QAQ $

The digraph $ low [x]:. $ Point in the stack and $ X $ subtrees can reach the minimum $ $ DFN

. Undirected graph of $ low [x]: $ point through a side not in the search tree and $ X $ subtree point Unicom $ $ DFN minimum.

$ Tarjan $ at first understand the core code to lie $ QwQ $

if (x y is the father of the search tree) low [x] = min (low [x], low [y])

else low[x]=min(low[x],dfn[y])

Not difficult to understand? Consider $ low_x $ is defined as the minimum value of $ dfn $ subtrees $ x $ and $ x $ can be traced in. So when $ y $ in $ x $ when the sub-tree can be directly used $ low $ update, otherwise, it can be updated with $ $ dfn.

And then say a few basic applications of under $ tarjan $

No cutting edge to FIG.

Undirected edges $ (x, y) $ are bridged, if and only if the search tree $ X $ $ Y $ a child node, meet $ dfn [x] <low [y] $.

Correctness is clearly not say.

Note here that since the conditions in the less-than sign updated so $ low [x] = min (low [x], dfn [y]) $ to ensure that when Y $ $ $ X $ is not the father.

But there is to be noted that if there are multiple edges do not need to guarantee $ y $ is not the father of the $ x $, $ QwQ $

Here the solution is determined edge $ (x, y) $ is not expanded to the point that the current and the presence of $ X $ paired side edge, at a flow similar to become engaged in the network.

Board $ code $

No cut point to FIG.

If $ X $ is not the root, then the $ X $ is cut point if and only if a node exists $ X $ $ Y $ search tree satisfies $ dfn_x \ leq low_y $

If the root is $ X $, $ X $ is the cut-point if and only if the search tree exist as two points as above $ Y $

Because the conditions here are so you do not need the equal sign as the previous sentence, as also some messy things spicy $ QwQ $

Board $ code $

Undirected graph point bis

Find similarities and cut, with a deposit with access to all of the current stack point, when there is $ dfn_x \ leq low_y $ shrink to a point when the double.

Note that the definition of strong point dual component link is not the same $ QAQ $, said dual-point means connected graph greatly cut point does not exist. Strongly connected graph is a great Unicom component refers to any two mutually reachable.

Board $ code $

No double edge to FIG.

Find all bridges, the bridge block is deleted each Unicom obtained a double edge.

Generally the first concrete realization traveled to $ tarjan $ mark all the bridges, then just get down on the bin.

Board $ code $

We have to strengthen the country Unicom component

If there is $ dfn_x = low_x $ $ X $ back in front, the stack constituting a strong link component from $ X $ to all nodes of the top of the stack.

Board $ code $

A small variant $ code $

Digraph point must pass through the directed graph must pass through & sides

$ QwQ $ use to dominate the tree ,,,?

Leave :)

Guess you like

Origin www.cnblogs.com/lqsukida/p/11785159.html
Recommended