Kernighan-Lin A quick implementation in Python using an object model instead of an adjacency matrix of the Kernighan-Lin algorithm for graph partition.