Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How is it a greedy algorithm? He didn't say anything about the "intuitive" decisions maximizing immediate gain at every decision point.


I'm sure the users he describes can be trusted to make locally optimal choices.


Greedy algorithms run the same way every time given the same choices. Why? Because, if options are received in a deterministic order, it'll make the locally optimal choice.

With iterate and repair, people are using an internal heuristic to make a choice and refining that over time. These are not necessarily the locally optimal choice.


They won't run the same way if you start from a different node in the search graph, which is probably what the players are doing.


I was being nice before, but it's obvious that you don't know what a greedy algorithm is.

Please don't make offensive comments like, "I guess the algorithms course is no longer required at MIT?!"


A greedy algorithm is an algorithm that makes locally optimal choices. The classic example, if you've taken an algorithms course, is the travelling salesman problem with the nearest neighbor heuristic. This starts at an arbitrary node, and will usually generate different solutions based on the node that is chosen to start at.

The very presence of the "internal heuristic" that you mention is usually enough to make the algorithm greedy.

Otherwise, thanks for being nice, and try to take less offense at what people say on the Internet.


It is not the presence of an internal heuristic that makes an algorithm greedy, it is the choosing of locally optimal solutions. For your claim to hold, you would need to demonstrate that people make locally optimal solutions, at least in the context of this problem.

That is most likely a wrong assumption. Greedy algorithms usually do not find globally optimal solutions, yet the people solving these problems are finding -the- solution. That is enough to suggest that the heuristic people are using is much more complex than merely choosing local optimums.


It was interesting to read both of you guys. I can see a lot of ego on both sides... But that's a good thing :)

No one is wrong or right. It just depends on what you believe users are doing. One thing is certain: users use "local search" techniques as opposed to "systematic" search. The salesman problem describes this: the algorithm operates using a single current node and moves only to neighbors of that node.

However, depending on the "local search" algorithm used, those may be greedy or not: - "Hill Climbing" is greedy. The algorithm is affected by local maxima, ridges and plateaux. - "Simulated annealing" is not greedy. It uses "gradient descent" and does not always pick the "best" neighbors.

I believe the heuristics used by the users: - are not very precise ("Well, it is better, right?") - may change over time ("Oh, look at this!") That's why, I think it is not a "greedy" algorithm with deterministic results, but it is NOT complete anyway (hence, the clear process).

I can't wait for you guys to kick my butt :) ps: I'm a business major...




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: