%% Compute Block-Cut Tree of Graph
% Compute the block-cut tree of a graph, view the resulting node properties, and then highlight the cut vertices in the graph plot.
% Create and plot a graph.

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 = graph(s,t);
p = plot(G);

%
% Compute the block-cut tree of the graph and view the node properties.

tree = bctree(G);
tree.Nodes

%
% 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 = plot(tree,'MarkerSize',9);
highlight(p2,5:7,'Marker','d','NodeColor','r')

% Copyright 2012 The MathWorks, Inc.