Source: https://web.stanford.edu/class/cs345a/slides/12-clustering.pdf