In one of my projects I had to go one step further: directed graphs with two sets of edges (called red and black) where cycles of black edges is allowed but any cycle including a red edge is forbidden. You can check whether or not a graph fits these criteria using Tarjan's algorithm for strongly connected components.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In one of my projects I had to go one step further: directed graphs with two sets of edges (called red and black) where cycles of black edges is allowed but any cycle including a red edge is forbidden. You can check whether or not a graph fits these criteria using Tarjan's algorithm for strongly connected components.