Implemented a method to check if a node is a valid surrogate neighbor to another node.