shared neigbors merge and cut algorithms done, alex