%% Highlight Path of Maximum Flow
% Create and plot a directed graph. Return a handle to the GraphPlot object, h.

G = digraph(bucky);
h = plot(G);

%
% Compute the maximum flow between nodes 1 and 56. Specify two outputs to maxflow to return a directed graph of the nonzero flows, GF.

[mf,GF] = maxflow(G,1,56)

%
% Use highlight to change the color of the edges that contain nonzero flow values. Also change the color of source node 1 and target node 56 to green.

highlight(h,GF,'EdgeColor',[0.9 0.3 0.1],'NodeColor',[0.9 0.3 0.1])
highlight(h,[1 56],'NodeColor','g')

% Copyright 2015 The MathWorks, Inc.