%% Determine if Directed Graph is Acyclic
% Create and plot a directed graph, and then test the graph to determine if it is acyclic.

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

%

plot(G)

%

tf = isdag(G)

% Copyright 2015 The MathWorks, Inc.