Prune nodes in deadlock pattern detection