%% All Cycles in Directed Graph
% Create a directed graph with nine nodes. Plot the graph.

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

%
% Calculate all cycles in the graph.

cycles = allcycles(G)

% Copyright 2020 The MathWorks, Inc.