Question:
What is the difference between the BRUTE-FORCE and GREEDY method the find the SHORTEST PATH?
Natalie O
2009-02-19 06:19:24 UTC
What are the merits and demerits of each method?
PLEASE provide DETAILED but SIMPLE explaination.
Four answers:
Matt
2009-02-19 06:27:05 UTC
Hi,



The breakdown of the pros and cons are below, but think about it this way. If you loose your keys, you can either search the entire house (brute force) and empty every drawer, cupboard, and cabinet...or you can retrace your steps and check the most logical places first (greedy). You might not find them the greedy way, but if you have some idea of what the solution should be, it's usually best to try first.



Hope that helps,

Matt



Bruce-force Algorithm

Solves a problem in the most simple, direct, or obvious way

• does not take advantage of structure or pattern in the problem

• usually involves exhaustive search of the solution space

• pro: often simple to implement

• con: usually not the most efficient way



Greedy Approach

Algorithm decides what is the best thing to do at each step

(local maxima), and never reconsiders its decisions

• pro: may run significantly faster than brute-force

• con: may not lead to the optimal (or even correct) solution (global maxima) Usually requires some initial pre-computation to set up the problem, to

take advantage of special structure/pattern in the problem or solution

space
?
2016-10-02 13:02:04 UTC
Brute Force Method
anonymous
2016-02-28 06:37:54 UTC
Brute Force Method is listing down in no particular order. Greedy Method is to choose the path which costs the least at every interval where you have more than one choice and you end up (sometimes) with the least cost path.
cheese.
2009-02-27 01:29:06 UTC
CHEAT. YOU'RE A CHEAT NAT.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...