implement kernighan_lin_algorithm and MyPriorityQueue