removing nodes from graphs