简体   繁体   中英

Why greedy algorithm is heuristic, not meta-heuristic?

AFAIK, heuristic algorithm is problem-dependent and meta-heuristic are problem-independent, according to this answer. 1

But greedy algorithm can apply to many problems, such as minimum spanning tree and shortest path problem. My question is that why is it problem-dependent, not problem-independent?

There are a lot of greedy algorithms for different problems, greedy algorithm is not the one particular algorithm, it's a class of algorithms that use the same approach to the problem. Dijkstra's algorithm, Prim's algorithm, Kruskal's algorithm, etc. are completely different, but they are all greedy .

In Dijkstra's algorithm you take an untouched node with minimal distance to it. In Prim's algorithm you take an edge, that connects tree node with not-tree node, with minimal weight. In Kruskal's algorithm you take an edge, that connects two different trees, with minimal weight. And there are many greedy algorithms that don't even work with graphs.

All these heuristics are different and problem-specific, because these algorithms solve completely different problems.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM