mst and ssp(dag) algorithms