Create an algorithms module, move traversal there.
Define spanning trees and ancestors/descendants for trees
TODO