update graph: add write() and normalize()