How do I guarantee that a DAG stays acyclic after insertion of a node?

You could also store reverse links and just check that the terminus node of the edge being added does not appear in any of the parent nodes of the origin node. This would be faster than doing a full cycle detection. Essentially this would be a shortest path algorithm on the reverse links, which for a DAG ought to be a linear operation.

If all of the new edges are from the new vertex you won't ever create cycles.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions