%% Perform Depth-First Graph Search
% Create and plot a graph.

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

%
% Perform a depth-first search of the graph starting at node 7. The result indicates the order of node discovery.

v = dfsearch(G,7)

% Copyright 2015 The MathWorks, Inc.