adding connected component color (require library networkx)