Agglomerative clustering tool for network-x graphs