Replace node.neighbours in the search function by a 'generic' neighbours(x) function