Make nodes hashable so they can be used in dictionaries.