Tarjan algorithm notes

Tarjan algorithm notes series

0 Overview

\ (\ text {Tarjan} \ ) core idea: \ (\ text DFN} {\) sequence and \ (\ text {low} \ ) array

Thus, \ (\ text Tarjan} {\) algorithm is a standard framework \ (\ text {dfs} \ ) process

\ (\ text {Juanzhang} \ ) once said:

I still do not understand \ (\ text {Tarjan} \ ) Some of these esoteric things

I wish I could see \ (\ text {Juanzhang} \ ) see things

Notes compiled the following algorithm:

  1. Cut point and bridge
  2. Point, the edge component Unicom bis
  3. Unicom strong component
  4. Yuan Fang tree

1 dfn and low

1.1 dfn

\ (\ text {dfn} \ ) array recorded that the figure, starting from a point of \ (\ text {dfs} \ ) this process, \ (\ text {dfn} \ ) it is \ (\ text {dfs} \ ) to each point of the time stamp (from the \ (1 \) starts)

Do simple questions used in the recording \ (\ text {dfn} \ ) properties:

  1. In (\ text {dfs} \) \ in the process, \ (\ text {dfn} \ ) a certain point than \ (\ text {dfn} \ ) subtree large point and the point of each of the match point (you can easily determine whether or not within the sub-tree)

In my opinion, \ (\ text {dfn} \ ) meaning that, due to the nature \ (1 \) , we recorded \ (\ text {dfn} \ ) in fact implies some information that has the following effect :

  1. To each point given a unique number
  2. Record some information about the sub-tree

1.2 low

\ (\ text {low} [ \ text {i}] \) represents for the first \ (\ text {i} \ ) nodes, in \ (\ text {dfs} \ ) tree, with its root sub tree, removing all neighbor nodes of its own node, \ (\ text {dfn} \ ) minimum

Do question used in simple recording \ (\ text {low} \ ) properties:

  1. Readily appreciate if a tree, then any node of this tree, there are \ (\ text {dfn} [ \ text {i}] = \ text {low} [\ text {i}] \)
  2. However, if the original is not even a casual tree edge \ ((u, v) \ )

2 cut point and bridge

Cut definition of points:

After the point of the cut off, i.e. remove this point all edges adjacent thereto and to increase the number of points referred to in FIG Unicom block cutpoint

Bridge definition:

After deleting the edge, increasing the number of the blocks of FIG Unicom called side edge

Guess you like

Origin www.cnblogs.com/blackwhitetony/p/11025810.html