Source: https://www.bowdoin.edu/~ltoma/teaching/cs231/spring16/Lectures/13-MST/mst.pdf