随笔分类 - 资料
一些算法的理论知识
摘要:Cheriyan–Mehlhorn/Gabow algorithm这个算法的思路和tarjan算法差不多,效率要比tarjan算法快一点。算法需要两个栈来进行维护。下面这个伪代码是tarjan的伪代码修改过来的。从结构上看非常的相似。 1 algorithm gabow is 2 3 input: graph G = (V, E) 4 5 output: set of strongly connected components (sets of vertices) 6 7 8 9 index := 110 11 S1 := empty12 13 S2 := empty14 15 for eac
阅读全文
摘要:Tarjan's strongly connected components algorithmPku 2186,2553,1236,2762,都是可以用强连通分量算法来解决的。Kosaraju的算法在大部分情况下还是够用的,至少对于这四个题时间都还行。但是既然有更好的算法,那也学习一下吧。Thealgorithm takes a directedgraph as input, and produces a partition of the graph's vertices into the graph's strongly connectedcomponents. E
阅读全文
摘要:Strongly connected component主要说下强连通分量,一般简称为sccA directedgraph is called strongly connected if there is a path from each vertex in the graph to every other vertex. Inparticular, this means paths in each direction; a path from a to band also a path from b to a.如果一个有向图的每个顶点到其余的顶点都有一条路径,那么这个有向图就叫强连通的。尤其
阅读全文
浙公网安备 33010602011771号