update graph constructor