solve random_neighbor bug 1