Source: https://web.engr.oregonstate.edu/~glencora/wiki/uploads/MST-algs.pdf