Hierarchical agglomerative clustering starts with each point in a cluster of its own and repeatedly merges the two clusters at the least linkage distance, until one cluster is left. The single, complete and average linkages of two clusters are the least, the largest and the mean distance between a point of one and a point of the other. The merges, drawn as a tree whose leaves are the points and whose internal nodes sit at the height of their merge, form the dendrogram; cutting it after merges gives clusters.
figs.py from hac.py. Cutting between the heights 2.26 and 2.41 leaves three clusters: D joins E, F, G and H through its nearest neighbour, at 2.26, before A, B, C reach them at 2.41. Complete linkage puts D with A, B and C instead.