Main Content

bctree

块状树图

描述

例子

tree= bctree(G返回图形的块状树G,使每个节点在treerepresents either abiconnected componentor切顶点ofG。A node representing a cut vertex is connected to all nodes representing biconnected components that contain that cut vertex.

例子

[[tree,,,,一世nd] = bctree(G还返回一个数字节点索引映射的向量G进入节点tree

例子

全部收缩

计算图的块切割树,查看所得的节点属性,然后突出显示图图中的切割顶点。

创建并绘制图形。

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);

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

计算图形的块状树并查看节点属性。

树= bctree(g);tree.Nodes
ans =7×3 tableIsComponent ComponentIndex CutVertexIndex ___________ ______________ ______________ true 1 0 true 2 0 true 3 0 true 4 0 false 0 4 false 0 6 false 0 7

Plot the block-cut tree using red diamond markers for the nodes that represent cut vertices. The circular nodes represent the biconnected components in the original graph.

p2 =图(树,'MarkerSize',9);亮点(P2,5:7,'Marker',,,,'D',,,,'nodeColor',,,,'r'

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

创建并绘制图形。

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);

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

计算块状树tr的图,并指定第二个输出ix返回节点索引。

[tr,ix] = bctree(g)
tr =带有属性的图形:边缘:[6x1表]节点:[7x3表]
ix=1×104 4 4 4 5 3 6 7 1 1 2

Each indexix(j)指示代表节点的块切割树中的节点j在输入图中。例如,节点4在tr代表一个组件Gthat contains nodes 1, 2, and 3, so the first three entries inix都是4。

输入参数

全部收缩

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

Example:G= graph(1,2)

输出参数

全部收缩

块状树图,返回为图形目的。tree在每个切割顶点中包含一个节点Gand a node for each biconnected component inG。节点表tree.Nodes包含其他节点属性来描述每个节点的代表:

  • tree.nodes.iscomponent(i)- 值等于逻辑1((true)一世f node一世代表双连接组件。Otherwise, the value is equal to and logical0((错误的)。

  • tree.nodes.componentIndex(i)- 指示由节点表示的组件的索引一世。值如果节点为零一世represents a cut vertex.

  • tree.Nodes。CutVertexIndex(i)- 指示由节点表示的切割顶点的索引一世。值如果节点为零一世代表双连接组件。

节点索引,返回为数字向量。一世nd(i)输出图中的节点是tree代表节点一世在输入图中G

  • 如果节点一世一世s a cut vertex in graphG, 然后一世nd(i)是关联的节点tree

  • 如果节点一世不是切割的顶点,而是属于图中的双连接组件之一G, 然后一世nd(i)是节点treerepresenting that biconnected component.

  • 如果节点一世是图中的一个孤立节点G, 然后一世nd(i)为零。

更多关于

全部收缩

Biconnected Components

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

将图分解到其双连接组件中有助于测量该图的良好连接。您可以将任何连接的图分解为双连接组件的树,称为block-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中引入