Reordering graphs