Started spanning tree method

Still some problems, feel free to modify, I’m sure there’s a better way
to do it…