updating graph