-和尚-

导航

2012年8月1日 #

有关求学习强连通的心得!

摘要: 现在学了求强连通的两个算法(Tarjan算法和Kosaraju算法);其实还有其他一个算法的!没学所以就不写上来了!Tarjan算法:这个算法是在一次的dfs遍历的情况下完成的!每个节点都只有一次的访问的机会!我们在这个算法要用到栈!每碰到未访问的节点就进栈!如果不符合上述的条件就退栈!(怎么那么像走迷宫的?其实不是啊!相似而已,莫激动)!在这里我们用到low[n],dfs[n],这两个数组!dfs(u)为节点u搜索的次序编号(时间戳),low(u)为u或u的子树能够追溯到的最早的栈中节点的次序号。算法伪代码如下tarjan(u){ DFN[u]=Low[u]=++Index // 为节点u设 阅读全文

posted @ 2012-08-01 19:00 -和尚- 阅读(141) 评论(0) 推荐(0) 编辑

Sightseeing

摘要: 题目:DescriptionTour operator Your Personal Holiday organises guided bus trips across the Benelux. Every day the bus moves from one citySto another cityF. On this way, the tourists in the bus can see the sights alongside the route travelled. Moreover, the bus makes a number of stops (zero or more) at 阅读全文

posted @ 2012-08-01 18:45 -和尚- 阅读(286) 评论(0) 推荐(0) 编辑

The Bottom of a Graph

摘要: 题目:DescriptionWe will use the following (standard) definitions from graph theory. LetVbe a nonempty and finite set, its elements being called vertices (or nodes). LetEbe a subset of the Cartesian productVx V, its elements being called edges. ThenG=(V,E)is called a directed graph.Letnbe a positive in 阅读全文

posted @ 2012-08-01 18:44 -和尚- 阅读(153) 评论(0) 推荐(0) 编辑