Here's a simple piece of code https://gist.github.com/innocentim/6849759 the reveals _BFSExecutor's inefficiency. Some optimizations are here to reduce the unecessary time complexity from O(n^2) to O(n).
I'll do a bootstrap and full testing before committing. Thanks! -- Tim Shen
a.patch
Description: Binary data