add spanning tree method