function b = acyclic(adj_mat, directed)
%
% b = acyclic(adj_mat, directed)
% Returns true iff the graph has no (directed) cycles.

[d, pre, post, height, cycle] = dfs(adj_mat,1,directed);
b = ~cycle;
