graph_swap() implemented