update graph