Optimized performance for greedy search