spanningtrees.py