Code to segmentation an image into k phase with MultiLayerGrap and K-means