update vertex and graph