add mst to graphalg and test valgrind sucess