Code used in the paper "Clustering Time Series with Community Detection"