add the minimal spanning tree array version