3

I have slides where 2 versions of local search algorithms are compared: greedy and steepest.

Greedy: generate solution x; repeat { for each y in N(x) in random order { if f(y) > f(x) then x = y; } } until no better solution was found

Steepest: generate solution x; repeat { find the best solution y in N(x); if f(y) > f(x) then x = y; } until no better solution was found

But everywhere on the Internet I read that greedy method searches for the best (not first better found) solution. So - what is the difference? And: which version is true?

Marcin Robaszyński
  • 772
  • 1
  • 11
  • 21

1 Answers1

3

I agree that greedy would also mean steepest as it attempts to make the locally optimal choice. To me the difference is that the notion of steepest descent / gradient descent is closely related with function optimization, while greedy is often heard in the context of combinatorial optimization. Both however describe the same "strategy".

In my opinion these notions are not very well suited to describe the behavior that you want to describe. I prefer the terms best improvement and first improvement local search. Both a greedy local search and the steepest descent method would be best improvement local search methods.

With regular expressions, greedy has a similar meaning: That of considering the largest possible match to a wildcard expression. It would be also wrong to state greedy matching would match on the first possibility.

Andreas
  • 6,447
  • 2
  • 34
  • 46
  • http://en.wikipedia.org/wiki/Hill_climbing: "In simple hill climbing, the first closer node is chosen, whereas in steepest ascent hill climbing all successors are compared and the closest to the solution is chosen" and http://en.wikipedia.org/wiki/Local_search_%28constraint_satisfaction%29 (hill climbing is greedy algorithm). It looks like steepest is some kind of greedy. – Marcin Robaszyński Oct 25 '11 at 23:38