• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            O(1) 的小樂

            Job Hunting

            公告

            記錄我的生活和工作。。。
            <2010年12月>
            2829301234
            567891011
            12131415161718
            19202122232425
            2627282930311
            2345678

            統(tǒng)計(jì)

            • 隨筆 - 182
            • 文章 - 1
            • 評(píng)論 - 41
            • 引用 - 0

            留言簿(10)

            隨筆分類(70)

            隨筆檔案(182)

            文章檔案(1)

            如影隨形

            搜索

            •  

            最新隨筆

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            雙連通圖 割點(diǎn)與橋 定義篇

            [點(diǎn)連通度與邊連通度]

            在一個(gè)無向連通圖中,如果有一個(gè)頂點(diǎn)集合,刪除這個(gè)頂點(diǎn)集合,以及這個(gè)集合中所有頂點(diǎn)相關(guān)聯(lián)的邊以后,原圖變成多個(gè)連通塊,就稱這個(gè)點(diǎn)集為割點(diǎn)集合。一個(gè)圖的點(diǎn)連通度的定義為,最小割點(diǎn)集合中的頂點(diǎn)數(shù)。

            A cut, vertex cut, or separating set of a connected graph G is a set of vertices whose removal renders G disconnected. Theconnectivity or vertex connectivity κ(G) is the size of a smallest vertex cut. A graph is called k-connected or k-vertex-connected if its vertex connectivity is k or greater. A complete graph with n vertices has no cuts at all, but by convention its connectivity is n-1. A vertex cut for two vertices u and v is a set of vertices whose removal from the graph disconnects u and v. The local connectivity κ(u,v) is the size of a smallest vertex cut separating u and v. Local connectivity is symmetric for undirected graphs; that is, κ(u,v)=κ(v,u). Moreover, except for complete graphs, κ(G) equals the minimum of κ(u,v) over all nonadjacent pairs of vertices u,v.

            2-connectivity is also called "biconnectivity" and 3-connectivity is also called "triconnectivity".

            Analogous concepts can be defined for edges. In the simple case in which cutting a single, specific edge would disconnect the graph, that edge is called a bridge. More generally, the edge cut of G is a group of edges whose total removal renders the graph disconnected. The edge-connectivity λ(G) is the size of a smallest edge cut, and the local edge-connectivity λ(u,v) of two vertices u,v is the size of a smallest edge cut disconnecting u from v. Again, local edge-connectivity is symmetric. A graph is called k-edge-connected if its edge connectivity is k or greater.

            類似的,如果有一個(gè)邊集合,刪除這個(gè)邊集合以后,原圖變成多個(gè)連通塊,就稱這個(gè)點(diǎn)集為割邊集合。一個(gè)圖的邊連通度的定義為,最小割邊集合中的邊數(shù)。

            [雙連通圖 割點(diǎn) 與橋]

            Point Biconnected Component 無向圖點(diǎn)2連通分量與    cut point 割點(diǎn)

            Edge Biconnected Component 無向圖邊2連通分量與    bridge 橋

            如果一個(gè)無向連通圖的點(diǎn)連通度大于1,則稱該圖是點(diǎn)雙連通的(point biconnected),簡(jiǎn)稱雙連通或重連通。一個(gè)圖有割點(diǎn),當(dāng)且僅當(dāng)這個(gè)圖的點(diǎn)連通度為1,則割點(diǎn)集合的唯一元素被稱為割點(diǎn)(cut point),又叫關(guān)節(jié)點(diǎn)(articulation point)。

            如果一個(gè)無向連通圖的邊連通度大于1,則稱該圖是邊雙連通的(edge biconnected),簡(jiǎn)稱雙連通或重連通。一個(gè)圖有橋,當(dāng)且僅當(dāng)這個(gè)圖的邊連通度為1,則割邊集合的唯一元素被稱為橋(bridge),又叫關(guān)節(jié)邊(articulation edge)。

            可以看出,點(diǎn)雙連通與邊雙連通都可以簡(jiǎn)稱為雙連通,它們之間是有著某種聯(lián)系的

            [雙連通分支] 

            在圖G的所有子圖G’中,如果G’是雙連通的,則稱G’為雙連通子圖。如果一個(gè)雙連通子圖G’它不是任何一個(gè)雙連通子圖的真子集,則G’為極大雙連通子圖。雙連通分支(biconnected component),或重連通分支,就是圖的極大雙連通子圖。特殊的,點(diǎn)雙連通分支又叫做塊。

             

            [求割點(diǎn)與橋]

            該算法是R.Tarjan發(fā)明的。對(duì)圖深度優(yōu)先搜索,定義DFS(u)為u在搜索樹(以下簡(jiǎn)稱為樹)中被遍歷到的次序號(hào)。定義Low(u)為u或u的子樹中能通過非父子邊追溯到的最早的節(jié)點(diǎn),即DFS序號(hào)最小的節(jié)點(diǎn)。根據(jù)定義,則有:

            Low(u)=Min
            {
            DFS(u)
            DFS(v) (u,v)為后向邊(返祖邊) 等價(jià)于 DFS(v)<DFS(u)且v不為u的父親節(jié)點(diǎn)
            Low(v) (u,v)為樹枝邊(父子邊)
            }

            一個(gè)頂點(diǎn)u是割點(diǎn),當(dāng)且僅當(dāng)滿足(1)或(2)
            (1) u為樹根,且u有多于一個(gè)子樹。
            (2) u不為樹根,且滿足存在(u,v)為樹枝邊(或稱父子邊,即u為v在搜索樹中的父親),使得DFS(u)<=Low(v)。

            一條無向邊(u,v)是橋,當(dāng)且僅當(dāng)(u,v)為樹枝邊,且滿足DFS(u)<Low(v)。

            [求雙連通分支]

            下面要分開討論點(diǎn)雙連通分支與邊雙連通分支的求法。

            對(duì)于點(diǎn)雙連通分支,實(shí)際上在求割點(diǎn)的過程中就能順便把每個(gè)點(diǎn)雙連通分支求出。建立一個(gè)棧,存儲(chǔ)當(dāng)前雙連通分支,在搜索圖時(shí),每找到一條樹枝邊或后向邊(非橫叉邊),就把這條邊加入棧中。如果遇到某時(shí)滿足DFS(u)<=Low(v),說明u是一個(gè)割點(diǎn),同時(shí)把邊從棧頂一個(gè)個(gè)取出,直到遇到了邊(u,v),取出的這些邊與其關(guān)聯(lián)的點(diǎn),組成一個(gè)點(diǎn)雙連通分支。割點(diǎn)可以屬于多個(gè)點(diǎn)雙連通分支,其余點(diǎn)和每條邊只屬于且屬于一個(gè)點(diǎn)雙連通分支。

            對(duì)于邊雙連通分支,求法更為簡(jiǎn)單。只需在求出所有的橋以后,把橋邊刪除,原圖變成了多個(gè)連通塊,則每個(gè)連通塊就是一個(gè)邊雙連通分支。橋不屬于任何一個(gè)邊雙連通分支,其余的邊和每個(gè)頂點(diǎn)都屬于且只屬于一個(gè)邊雙連通分支。

            [構(gòu)造雙連通圖]

            有橋的連通圖必然有割點(diǎn),有割點(diǎn)的連通圖不一定有橋(下圖可以很明顯得到)

            QQ截圖未命名

            如果一個(gè)圖有橋,則把此圖變成無橋的圖的最優(yōu)策略:

            一個(gè)有橋的連通圖(其必然有割點(diǎn)),如何把它通過加邊變成邊雙連通圖?方法為首先求出所有的橋,然后刪除這些橋邊,剩下的每個(gè)連通塊都是一個(gè)邊雙連通子圖。把每個(gè)雙連通子圖收縮為一個(gè)頂點(diǎn),再把橋邊加回來,最后的這個(gè)圖一定是一棵樹,邊連通度為1。

            統(tǒng)計(jì)出樹中度為1的節(jié)點(diǎn)的個(gè)數(shù),即為葉節(jié)點(diǎn)的個(gè)數(shù),記為leaf。則至少在樹上添加(leaf+1)/2條邊,就能使樹達(dá)到邊二連通,所以至少添加的邊數(shù)就是(leaf+1)/2。具體方法為,首先把兩個(gè)最近公共祖先最遠(yuǎn)的兩個(gè)葉節(jié)點(diǎn)之間連接一條邊,這樣可以把這兩個(gè)點(diǎn)到祖先的路徑上所有點(diǎn)收縮到一起,因?yàn)橐粋€(gè)形成的環(huán)一定是雙連通的。然后再找兩個(gè)最近公共祖先最遠(yuǎn)的兩個(gè)葉節(jié)點(diǎn),這樣一對(duì)一對(duì)找完,恰好是(leaf+1)/2次,把所有點(diǎn)收縮到了一起。

             

            QQ截圖未命名

            如果一個(gè)圖無橋有割點(diǎn),則把此圖變成雙連通的最優(yōu)策略:

            QQ截圖未命名

            如果一個(gè)圖既有橋,又有割點(diǎn),則把此圖變成雙連通的策略:(不是最優(yōu)。。。)

            1 首先把圖變成無橋的

            2 把有割點(diǎn)無橋的圖變成雙連通

            (顯然這個(gè)算法不是最優(yōu)的。。關(guān)鍵問題是把圖變成無橋的圖的時(shí)候的策略選擇!這個(gè)需要高手指點(diǎn)。。。)

            A biconnected component (or 2-connected component) in graph theory is a maximalbiconnected subgraph. Any connected graph decomposes into a tree of biconnected components called the block tree of the graph. The blocks are attached to each other at shared vertices called cut vertices or articulation points. Specifically, a cut vertex is any vertex that when removed increases the number of connected components.

            算法的基本描述:

            The classic sequential algorithm for computing biconnected components in a connected undirected graph due to John Hopcroft andRobert Tarjan (1973) [1] runs in linear time, and is based on depth-first search. This algorithm is also outlined as Problem 22-2 of Introduction to Algorithms (both 2nd and 3rd edition).

            The idea is to run a depth-first search while maintaining the following information:

            1. the depth of each vertex in the depth-first-search tree (once it gets visited), and
            2. for each vertex v, the lowest depth of neighbors of all descendants of v in the depth-first-search tree, called thelowpoint.

            The depth is standard to maintain during a depth-first search. The lowpoint of v can be computed after visiting all descendants of v (i.e., just before v gets popped off the depth-first-search stack) as the minimum of the depth of all neighbors of v (other than v's parent in the depth-first-search tree) and the lowpoint of all children of v in the depth-first-search tree.

            The key fact is that a nonroot vertex v is a cut vertex (or articulation point) separating two biconnected components if and only if v's lowpoint is at least as large as v's depth. This property can be tested once the lowpoint of v is computed (i.e., just before v gets popped off the depth-first-search stack), and if true, v separates the graph into different biconnected components. This can be represented by computing one biconnected component out of the descendants of v (by traversing the depth-first-search tree), and henceforth pretending that v had no children in the depth-first-search tree, so that the subgraph abovev will not descend into v's ancestors.

            The root vertex must be handled separately: it is a cut vertex if and only if it has at least two children. Thus, it suffices to simply build one component out of each child subtree of the root (including the root).

             

             

            An example graph with biconnected components marked

            Each color corresponds to a biconnected component. Multi-colored vertices are cut vertices, and thus belong to multiple biconnected components.

             

            引入割點(diǎn)的目的: 如果我們?nèi)サ魣D中的某個(gè)點(diǎn)之后,那么這個(gè)圖是否還是連通的!

            引入2連通分量(塊)的目的:圖的某個(gè)子圖是否可以去掉一個(gè)點(diǎn)之后,仍然是連通的。也就是說相對(duì)于這個(gè)子圖,沒有割點(diǎn)。此圖的割含有兩個(gè)點(diǎn)。

            (注意一個(gè)圖的割和割點(diǎn)不是一個(gè)概念!)

            Reference :

            http://www.byvoid.com/blog/biconnect/         byvoid的NX文章

            Wiki 配圖

            中科院研究生院算法分析設(shè)計(jì)講義(陳老師)

            posted on 2010-09-28 21:45 Sosi 閱讀(931) 評(píng)論(0)  編輯 收藏 引用


            只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            統(tǒng)計(jì)系統(tǒng)
            久久精品国产亚洲AV不卡| 国产精品久久久久久久久| 久久青草国产手机看片福利盒子| 久久亚洲日韩看片无码| 久久精品国产福利国产琪琪| 伊人久久大香线蕉精品| 国产激情久久久久影院小草 | 久久久久一本毛久久久| 2021国产成人精品久久| 国产激情久久久久影院| 日韩AV毛片精品久久久| 国产精品久久久久久久久软件| 性做久久久久久久久久久| 久久天天婷婷五月俺也去| 欧美黑人激情性久久| 国产成年无码久久久久毛片| 国产精品禁18久久久夂久| 国产69精品久久久久9999| 亚洲国产精品成人久久蜜臀| 狠狠色综合网站久久久久久久高清| 婷婷综合久久中文字幕蜜桃三电影| 国产人久久人人人人爽| 91麻豆精品国产91久久久久久| 日韩十八禁一区二区久久| 99久久精品国产一区二区| 精品久久久久久| 国产精品99久久久久久宅男小说| 精品国际久久久久999波多野| 女人香蕉久久**毛片精品| 中文字幕久久亚洲一区| 狠狠色婷婷综合天天久久丁香 | 亚洲AⅤ优女AV综合久久久| 欧美国产成人久久精品| 亚洲狠狠久久综合一区77777| 久久人搡人人玩人妻精品首页 | 无码乱码观看精品久久| 久久99国产综合精品| 国产精品久久久久久久久软件| 久久婷婷国产麻豆91天堂| 久久久久亚洲精品日久生情 | 久久精品国产99久久久古代|