Implementation of a BFS stepwise algorithm that can perform steps in a bottom-up fashion.

Note that this does not yet include switching between top-down and bottom-up steps.
move to the line above if it fits