A node becomes alive when it is visited and can be killed when all of it’s children have been visited. A child can only be visited if all of it’s parents have been visited For example for this graph
If we went in the order of
[1 2 3 4 5 6 7 8]
The amount of alive nodes would be:
[1 2 2 3 4 3 1 1]
One of the optimal patterns would be
[2 4 1 3 6 5 7 8]
With amount of alive nodes each step:
[1 2 3 3 2 3 1 1]
Are there any known algorithms that implement this behavior?