Updating heap & graph