[PATCH] D31694: [ADT] Generic BFS graph iterator

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 23:09:56 PDT 2017


dberlin added a comment.

In https://reviews.llvm.org/D31694#718809, @dberlin wrote:

> I'm trying to understand how you are level numbering.
>  The level numbering can't be done on a cyclic graph without help (or, at the very least, if it is defined as "the minimum depth from root we ever saw this node as" or sometihng, so you would use min(current, last level)".
>  It works fine for free.


Forget it, i'm being dumb.
It's unweighted bfs, so if there was a shorter path, we would have already hit it, so if we revisit something, it can't change the lowest level.


https://reviews.llvm.org/D31694





More information about the llvm-commits mailing list