Greedy search algorithm

Multi tool use
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
Currently I am a new to the Artificial Intelligent. I have a problem on greedy search algorithm. One of the question I saw on tutorial but cant understand how to answer them. Please help me. Any help much appreciated.
Consider the given figure 1. The values in each node represent the heuristic cost from that node
to goal node (G) and the values within the arcs represent the path cost between two nodes.
[

Lavish KothariLavish Kothari
974816
974816
@MohamedNasik I've already explained in the answer how I've chosen the paths for both Greedy and A* algorithm. If you are asking me how I'm choosing my strategy for Greedy, it's just one of the strategy. You can go with Dijkstra algorithm which is also greedy (and always gives optimal solution for single source non-negative weight edges). But for here I think the strategy I described will suffice.
– Lavish Kothari
Nov 25 '18 at 3:27
Another question i want to ask from you my dear, In the example (top original) which I mentioned above, difficult to find the optimal solution. It takes higher value. How to proof which can be a not an optimal solution
– user9947358
Nov 25 '18 at 3:39
For a general graph, you can do an exhaustive search and find the optimal solution, but most of the times (as it is in your case) you can find the optimal solution using Dijkstra Algorithm. Note that, neither greedy not A* assures that it will give you an optimal solution. HTH :)
– Lavish Kothari
Nov 25 '18 at 3:49
add a comment |
@MohamedNasik I've already explained in the answer how I've chosen the paths for both Greedy and A* algorithm. If you are asking me how I'm choosing my strategy for Greedy, it's just one of the strategy. You can go with Dijkstra algorithm which is also greedy (and always gives optimal solution for single source non-negative weight edges). But for here I think the strategy I described will suffice.
– Lavish Kothari
Nov 25 '18 at 3:27
Another question i want to ask from you my dear, In the example (top original) which I mentioned above, difficult to find the optimal solution. It takes higher value. How to proof which can be a not an optimal solution
– user9947358
Nov 25 '18 at 3:39
For a general graph, you can do an exhaustive search and find the optimal solution, but most of the times (as it is in your case) you can find the optimal solution using Dijkstra Algorithm. Note that, neither greedy not A* assures that it will give you an optimal solution. HTH :)
– Lavish Kothari
Nov 25 '18 at 3:49
@MohamedNasik I've already explained in the answer how I've chosen the paths for both Greedy and A* algorithm. If you are asking me how I'm choosing my strategy for Greedy, it's just one of the strategy. You can go with Dijkstra algorithm which is also greedy (and always gives optimal solution for single source non-negative weight edges). But for here I think the strategy I described will suffice.
– Lavish Kothari
Nov 25 '18 at 3:27
@MohamedNasik I've already explained in the answer how I've chosen the paths for both Greedy and A* algorithm. If you are asking me how I'm choosing my strategy for Greedy, it's just one of the strategy. You can go with Dijkstra algorithm which is also greedy (and always gives optimal solution for single source non-negative weight edges). But for here I think the strategy I described will suffice.
– Lavish Kothari
Nov 25 '18 at 3:27
Another question i want to ask from you my dear, In the example (top original) which I mentioned above, difficult to find the optimal solution. It takes higher value. How to proof which can be a not an optimal solution
– user9947358
Nov 25 '18 at 3:39
Another question i want to ask from you my dear, In the example (top original) which I mentioned above, difficult to find the optimal solution. It takes higher value. How to proof which can be a not an optimal solution
– user9947358
Nov 25 '18 at 3:39
For a general graph, you can do an exhaustive search and find the optimal solution, but most of the times (as it is in your case) you can find the optimal solution using Dijkstra Algorithm. Note that, neither greedy not A* assures that it will give you an optimal solution. HTH :)
– Lavish Kothari
Nov 25 '18 at 3:49
For a general graph, you can do an exhaustive search and find the optimal solution, but most of the times (as it is in your case) you can find the optimal solution using Dijkstra Algorithm. Note that, neither greedy not A* assures that it will give you an optimal solution. HTH :)
– Lavish Kothari
Nov 25 '18 at 3:49
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53464125%2fgreedy-search-algorithm%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
W8VxbNnHHkg6p 2HcKKtgmgy8caeqjS49QG7 83,NWbsuti,rv3FQ
1
Greedy algorithm won't take the heuristic value into consideration: at each node the algorithm will take the lowest cost possible.
B -> C -> D -> H -> G = 5+6+4+3 = 18
– ihavenoidea
Nov 25 '18 at 2:30
1
The Greedy algorithm follows the path
B -> C -> D -> H -> G
which has the cost of 18, and the heuristic algorithm follows the pathB -> E -> F -> H -> G
which has the cost 25. This specific example shows that heuristic search is costlier. This example is not well crafted to show that solution of greedy search is not optimal.– Lavish Kothari
Nov 25 '18 at 2:40
Thanks for the promptly response. However about that optimal solution. How to identifying? How to calculate? Your help much much appreciated.
– user9947358
Nov 25 '18 at 2:41