On the Connection between Greedy Algorithms and Imperfect Rationality