Source: https://www.cs.mcgill.ca/~ytamit/files/mst_sp.pdf