作者Leon (Achilles)
站內Prob_Solve
標題Re: [問題] 在O(|V|)的時間內找到non-cut點
時間Thu Aug 1 00:40:02 2013
※ 引述《c2251393 (mrgc)》之銘言:
: 這樣是O(|V|)嗎?
: 如果你只是把逆邊砍掉的話這樣還是O(|V|+|E|)啊
我分成兩篇寫了.
在第一篇有提到說 I don't go throught the edges in {V_1, V_{k}}.
Because I am generating a spanning tree,
so no need for circule.
: 因為你只是把遍歷的的時間 sum(deg(v))變成 sum(deg(v))/2
: 所以原本sum(deg(v)) = 2|E| 而現在是sum(deg(v))/2 = |E|
: 現在假設有一張4階完全圖
: 0 1 1 1
: 1 0 1 1
: 1 1 0 1
: 1 1 1 0
: 從V_1開始跑 花3個時間
: 然後圖變成了這樣
: 0 0 0 0
: 0 0 1 1
: 0 1 0 1
: 0 1 1 0
Yes, and now the node I have visited is {V_1, V_2, V_3, V_4}
: 然後是V_2 花2個時間
: 圖變成
: 0 0 0 0
: 0 0 0 0
: 0 0 0 1
: 0 0 1 0
This is not what I mean. In this step, you have no edge needed to go
because all nodes have beend visited.
What I am thinking now, is the data structure to achieve this.
It can be represented by
visit_edge ( (j node have been visited?) && E_{i,j} )
--
一簫一劍平生意
負盡狂名十五年
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 99.70.221.70
→ scwg:and exactly how are you implementing such data structure 08/01 00:59
→ scwg:to achieve amortized o(|E|) ? 08/01 00:59
→ scwg:Sorry, my bad, o(|E|) is too strict, the complexity that 08/01 01:02
→ scwg:you need is amortized O(|V|) and how do you do that? 08/01 01:02
推 rebaudiana:這樣的資結感覺不存在 08/01 02:09
推 ledia:如果存在的話很多問題的 order 應該可以再下修 08/01 21:31