assigning nodes to partitions based on entropy