Lecture notes for the course Clustering and Persistence SF2704, KTH