Adds minimal spanning tree algorithm