FlattenBFSIdx

Pushing the implementation that we did for the flatten bfs with indexes