how to calculate spanning tree path cost