%% Identify Cut Vertices
% Identify the cut vertices in a graph and then highlight those vertices in the graph plot.
% Create and plot a graph. 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 = graph(s,t);
p = plot(G);

%

[edgebins,iC] = biconncomp(G)

%
% Nodes 4, 6, and 7 are the cut vertices of graph G. Use highlight to enlarge the cut vertices referenced in iC.

highlight(p, iC)

% Copyright 2012 The MathWorks, Inc.