Main Content

biconncomp

双连接的图形组件

Description

例子

垃圾箱= biconncomp(G返回双连接组件G作为垃圾箱。箱数表示图形中的每个边缘属于哪个双连接组件。每个边缘G属于单个双连接组件,而节点在G可以属于多个双连接组件。如果从图中删除任何一个节点,则两个节点属于相同的双连接组件,不会断开它们。

例子

垃圾箱= biconncomp(G,,,,“输出形式”,,,,形式, 在哪里形式'细胞',将输出返回为单元格数组垃圾箱{J}包含组件中所有节点的节点IDj。The default for形式'向量'

例子

[[垃圾箱,,,,我知道了] = biconncomp(___另外返回节点索引我知道了indicating which nodes arecut vertices(也称为发音点)。

例子

全部收缩

创建并绘制图形。基于每个边缘所属的双连接组件的边缘颜色。

s = [1 1 2 2 3 4 4 5 6 6 7 7 8];t = [2 3 3 4 4 5 7 6 7 10 8 9 9];G =图(S,T);p =图(g,'行宽',2);

图包含一个轴对象。轴对象包含类型图形图的对象。

p.edgecdata = biconncomp(g);

图包含一个轴对象。轴对象包含类型图形图的对象。

此示例显示了如何从图作为子图的图中提取双连接的组件,然后使用原始图中的节点索引在每个子图中标记每个子图中的节点。

创建并绘制图形。

s = [1 1 2 2 3 4 4 5 6 6 7 7 8];t = [2 3 3 4 4 5 7 6 7 10 8 9 9];G =图(S,T);plot(G)

图包含一个轴对象。轴对象包含类型图形图的对象。

Group the graph nodes into bins based on which biconnected component(s) each node belongs to. Then, loop through each of the bins and extract a subgraph for each biconnected component. Label the nodes in each subgraph using their original node indices.

bincell = Biconncomp(g,“输出形式”,,,,'细胞'); n = length(bincell);为了ii = 1:n subplot(2,2,ii) plot(subgraph(G, bincell{ii}),'Nodelabel',,,,bincell{ii});结尾

Figure contains 4 axes objects. Axes object 1 contains an object of type graphplot. Axes object 2 contains an object of type graphplot. Axes object 3 contains an object of type graphplot. Axes object 4 contains an object of type graphplot.

标识图中的切割顶点,然后在图图中突出显示这些顶点。

创建并绘制图形。Calculate which biconnected component each graph edge belongs to, and specify a second output to return a vector identifying the cut vertices.

s = [1 1 2 2 3 4 4 5 6 6 7 7 8];t = [2 3 3 4 4 5 7 6 7 10 8 9 9];G =图(S,T);p =图(g);

图包含一个轴对象。轴对象包含类型图形图的对象。

[Edgebins,IC] = BiconnComp(G)
Edgebins =1×134 4 4 4 4 3 3 3 3 2 1 1 1
ic =1×34 6 7

Nodes 4, 6, and 7 are the cut vertices of graphG。利用highlightto enlarge the cut vertices referenced in我知道了

highlight(p, iC)

图包含一个轴对象。轴对象包含类型图形图的对象。

输入参数

全部收缩

输入图,指定为图形目的。利用图形创建一个无向图对象。

Example:G= graph(1,2)

输出类型,,,,specified as one of these values:

Option 输出
'向量'(默认) 垃圾箱是一个数字向量,指示每个边缘属于哪个双连接组件。
'细胞' 垃圾箱是一个单元格数组,垃圾箱{J}包含属于组件的所有节点的节点IDj

输出参数

全部收缩

双连接组件,作为向量或单元格数组返回。垃圾箱编号将图中的每个边缘或节点分配给双连接组件:

  • 如果输出Form'向量'(默认), 然后垃圾箱是一个数字向量,指示每个边缘属于哪个连接的组件(bin)。自绳的边缘被分配给bin0,因为它们不属于任何双连接组件。

  • 如果输出Form'细胞', 然后垃圾箱是一个单元格阵列,带有垃圾箱{J}containing the node IDs for all nodes that belong to componentj

切割顶点的索引,返回为数字节点ID的向量。

更多关于

全部收缩

Biconnected Components

图的双连接组件是最大双连接子图。如果图形不包含任何切割顶点,则将图形连接。

Decomposing a graph into its biconnected components helps to measure how well-connected the graph is. You can decompose any connected graph into a tree of biconnected components, called theblock-cut tree。The blocks in the tree are attached at shared vertices, which are the cut vertices.

插图描绘了:

  • (a)11节点的无向​​图。

  • (b)图的五个双连接组件,其原始图的切割顶点为它们所属的每个组件彩色。

  • (c)图的块状树,其中包含每个双连接组件的节点(作为大圆圈)和每个切割顶点的节点(作为较小的多色圆圈)。在块切割树中,一个边缘将每个切割顶点连接到其所属的每个组件。

An undirected graph, the biconnected components of the graph, and the block-cut tree of the graph

切成顶点

Also known as发音点,,,,cut vertices are graph nodes whose removal increases the number of connected components. In the previous illustration, the cut vertices are those nodes with more than one color: nodes 4, 6, and 7.

版本历史记录

在R2016b中引入