Suboptimal solution given by A* search












4















I don't understand how the following graph gives a suboptimal solution with A* search.



enter image description here



The graph above was given as an example where A* search gives a suboptimal solution, i.e the heuristic is admissible but not consistent. Each node has a heuristic value corresponding to it and the weight of traversing a node is given. I don't understand how A* search will expand the nodes.










share|improve this question

























  • Only A* with "graph search" will return a suboptimal solution. See stackoverflow.com/questions/10680180/….

    – ziggystar
    Sep 13 '14 at 14:39













  • Imho the pseudoimplementation of the "A* graph" is a really bad one but it can be the only reason for a subopt solution.

    – Demplo
    Sep 13 '14 at 14:56
















4















I don't understand how the following graph gives a suboptimal solution with A* search.



enter image description here



The graph above was given as an example where A* search gives a suboptimal solution, i.e the heuristic is admissible but not consistent. Each node has a heuristic value corresponding to it and the weight of traversing a node is given. I don't understand how A* search will expand the nodes.










share|improve this question

























  • Only A* with "graph search" will return a suboptimal solution. See stackoverflow.com/questions/10680180/….

    – ziggystar
    Sep 13 '14 at 14:39













  • Imho the pseudoimplementation of the "A* graph" is a really bad one but it can be the only reason for a subopt solution.

    – Demplo
    Sep 13 '14 at 14:56














4












4








4


1






I don't understand how the following graph gives a suboptimal solution with A* search.



enter image description here



The graph above was given as an example where A* search gives a suboptimal solution, i.e the heuristic is admissible but not consistent. Each node has a heuristic value corresponding to it and the weight of traversing a node is given. I don't understand how A* search will expand the nodes.










share|improve this question
















I don't understand how the following graph gives a suboptimal solution with A* search.



enter image description here



The graph above was given as an example where A* search gives a suboptimal solution, i.e the heuristic is admissible but not consistent. Each node has a heuristic value corresponding to it and the weight of traversing a node is given. I don't understand how A* search will expand the nodes.







search artificial-intelligence heuristics






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 27 '18 at 11:58









nbro

5,68384996




5,68384996










asked Sep 13 '14 at 12:47









eejseejs

6913




6913













  • Only A* with "graph search" will return a suboptimal solution. See stackoverflow.com/questions/10680180/….

    – ziggystar
    Sep 13 '14 at 14:39













  • Imho the pseudoimplementation of the "A* graph" is a really bad one but it can be the only reason for a subopt solution.

    – Demplo
    Sep 13 '14 at 14:56



















  • Only A* with "graph search" will return a suboptimal solution. See stackoverflow.com/questions/10680180/….

    – ziggystar
    Sep 13 '14 at 14:39













  • Imho the pseudoimplementation of the "A* graph" is a really bad one but it can be the only reason for a subopt solution.

    – Demplo
    Sep 13 '14 at 14:56

















Only A* with "graph search" will return a suboptimal solution. See stackoverflow.com/questions/10680180/….

– ziggystar
Sep 13 '14 at 14:39







Only A* with "graph search" will return a suboptimal solution. See stackoverflow.com/questions/10680180/….

– ziggystar
Sep 13 '14 at 14:39















Imho the pseudoimplementation of the "A* graph" is a really bad one but it can be the only reason for a subopt solution.

– Demplo
Sep 13 '14 at 14:56





Imho the pseudoimplementation of the "A* graph" is a really bad one but it can be the only reason for a subopt solution.

– Demplo
Sep 13 '14 at 14:56












2 Answers
2






active

oldest

votes


















3














The heuristic h(n) is not consistent.



Let me first define when a heuristic function is said to be consistent.



h(n) is consistent if  
– for every node n
– for every successor n' due to legal action a
– h(n) <= c(n,a,n') + h(n')


Here clearly 'A' is a successor to node 'B'
but h(B) > h(A) + c(A,a,B)



Therefore the heuristic function is not consistent/monotone, and so A* need not give an optimal solution.






share|improve this answer































    0














    Honestly I don't see how A* could return a sub-optimal solution with the given heuristic.
    This is for a simple reason: the given heuristic is admissible (and even monotone/consistent).



    h(s) <= h*(s) for each s in the graph


    You can check this yourself comparing the h value in each node to the cost of shortest path to g.



    Given the optimality property of A* I don't see how it could return a sub-optimal solution, which should be S -> A -> G of course.



    The only way it could return a suboptimal solution is if it would stop once an action from a node in the frontier leading to the goal is found (so to have a path to the goal), but this would not be A*.






    share|improve this answer
























    • The heuristic is not monotone. It decreases from B to A.

      – ziggystar
      Sep 13 '14 at 15:14











    • True, not only there. Still is admissible and should guarantee optimality.

      – Demplo
      Sep 13 '14 at 15:33











    • Sorry, I'm a bit confused today. :)

      – ziggystar
      Sep 13 '14 at 16:02











    • Your comment was actually relevant. The heuristic is not consistent.

      – Demplo
      Sep 13 '14 at 16:26






    • 1





      @Crackej If the heuristic is not monotone, then you need to reopen nodes, as you can later encounter them on a cheaper path.

      – ziggystar
      Sep 13 '14 at 18:50











    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f25823391%2fsuboptimal-solution-given-by-a-search%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    The heuristic h(n) is not consistent.



    Let me first define when a heuristic function is said to be consistent.



    h(n) is consistent if  
    – for every node n
    – for every successor n' due to legal action a
    – h(n) <= c(n,a,n') + h(n')


    Here clearly 'A' is a successor to node 'B'
    but h(B) > h(A) + c(A,a,B)



    Therefore the heuristic function is not consistent/monotone, and so A* need not give an optimal solution.






    share|improve this answer




























      3














      The heuristic h(n) is not consistent.



      Let me first define when a heuristic function is said to be consistent.



      h(n) is consistent if  
      – for every node n
      – for every successor n' due to legal action a
      – h(n) <= c(n,a,n') + h(n')


      Here clearly 'A' is a successor to node 'B'
      but h(B) > h(A) + c(A,a,B)



      Therefore the heuristic function is not consistent/monotone, and so A* need not give an optimal solution.






      share|improve this answer


























        3












        3








        3







        The heuristic h(n) is not consistent.



        Let me first define when a heuristic function is said to be consistent.



        h(n) is consistent if  
        – for every node n
        – for every successor n' due to legal action a
        – h(n) <= c(n,a,n') + h(n')


        Here clearly 'A' is a successor to node 'B'
        but h(B) > h(A) + c(A,a,B)



        Therefore the heuristic function is not consistent/monotone, and so A* need not give an optimal solution.






        share|improve this answer













        The heuristic h(n) is not consistent.



        Let me first define when a heuristic function is said to be consistent.



        h(n) is consistent if  
        – for every node n
        – for every successor n' due to legal action a
        – h(n) <= c(n,a,n') + h(n')


        Here clearly 'A' is a successor to node 'B'
        but h(B) > h(A) + c(A,a,B)



        Therefore the heuristic function is not consistent/monotone, and so A* need not give an optimal solution.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 29 '16 at 8:11









        Prakhar AgrawalPrakhar Agrawal

        676717




        676717

























            0














            Honestly I don't see how A* could return a sub-optimal solution with the given heuristic.
            This is for a simple reason: the given heuristic is admissible (and even monotone/consistent).



            h(s) <= h*(s) for each s in the graph


            You can check this yourself comparing the h value in each node to the cost of shortest path to g.



            Given the optimality property of A* I don't see how it could return a sub-optimal solution, which should be S -> A -> G of course.



            The only way it could return a suboptimal solution is if it would stop once an action from a node in the frontier leading to the goal is found (so to have a path to the goal), but this would not be A*.






            share|improve this answer
























            • The heuristic is not monotone. It decreases from B to A.

              – ziggystar
              Sep 13 '14 at 15:14











            • True, not only there. Still is admissible and should guarantee optimality.

              – Demplo
              Sep 13 '14 at 15:33











            • Sorry, I'm a bit confused today. :)

              – ziggystar
              Sep 13 '14 at 16:02











            • Your comment was actually relevant. The heuristic is not consistent.

              – Demplo
              Sep 13 '14 at 16:26






            • 1





              @Crackej If the heuristic is not monotone, then you need to reopen nodes, as you can later encounter them on a cheaper path.

              – ziggystar
              Sep 13 '14 at 18:50
















            0














            Honestly I don't see how A* could return a sub-optimal solution with the given heuristic.
            This is for a simple reason: the given heuristic is admissible (and even monotone/consistent).



            h(s) <= h*(s) for each s in the graph


            You can check this yourself comparing the h value in each node to the cost of shortest path to g.



            Given the optimality property of A* I don't see how it could return a sub-optimal solution, which should be S -> A -> G of course.



            The only way it could return a suboptimal solution is if it would stop once an action from a node in the frontier leading to the goal is found (so to have a path to the goal), but this would not be A*.






            share|improve this answer
























            • The heuristic is not monotone. It decreases from B to A.

              – ziggystar
              Sep 13 '14 at 15:14











            • True, not only there. Still is admissible and should guarantee optimality.

              – Demplo
              Sep 13 '14 at 15:33











            • Sorry, I'm a bit confused today. :)

              – ziggystar
              Sep 13 '14 at 16:02











            • Your comment was actually relevant. The heuristic is not consistent.

              – Demplo
              Sep 13 '14 at 16:26






            • 1





              @Crackej If the heuristic is not monotone, then you need to reopen nodes, as you can later encounter them on a cheaper path.

              – ziggystar
              Sep 13 '14 at 18:50














            0












            0








            0







            Honestly I don't see how A* could return a sub-optimal solution with the given heuristic.
            This is for a simple reason: the given heuristic is admissible (and even monotone/consistent).



            h(s) <= h*(s) for each s in the graph


            You can check this yourself comparing the h value in each node to the cost of shortest path to g.



            Given the optimality property of A* I don't see how it could return a sub-optimal solution, which should be S -> A -> G of course.



            The only way it could return a suboptimal solution is if it would stop once an action from a node in the frontier leading to the goal is found (so to have a path to the goal), but this would not be A*.






            share|improve this answer













            Honestly I don't see how A* could return a sub-optimal solution with the given heuristic.
            This is for a simple reason: the given heuristic is admissible (and even monotone/consistent).



            h(s) <= h*(s) for each s in the graph


            You can check this yourself comparing the h value in each node to the cost of shortest path to g.



            Given the optimality property of A* I don't see how it could return a sub-optimal solution, which should be S -> A -> G of course.



            The only way it could return a suboptimal solution is if it would stop once an action from a node in the frontier leading to the goal is found (so to have a path to the goal), but this would not be A*.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Sep 13 '14 at 14:45









            DemploDemplo

            421616




            421616













            • The heuristic is not monotone. It decreases from B to A.

              – ziggystar
              Sep 13 '14 at 15:14











            • True, not only there. Still is admissible and should guarantee optimality.

              – Demplo
              Sep 13 '14 at 15:33











            • Sorry, I'm a bit confused today. :)

              – ziggystar
              Sep 13 '14 at 16:02











            • Your comment was actually relevant. The heuristic is not consistent.

              – Demplo
              Sep 13 '14 at 16:26






            • 1





              @Crackej If the heuristic is not monotone, then you need to reopen nodes, as you can later encounter them on a cheaper path.

              – ziggystar
              Sep 13 '14 at 18:50



















            • The heuristic is not monotone. It decreases from B to A.

              – ziggystar
              Sep 13 '14 at 15:14











            • True, not only there. Still is admissible and should guarantee optimality.

              – Demplo
              Sep 13 '14 at 15:33











            • Sorry, I'm a bit confused today. :)

              – ziggystar
              Sep 13 '14 at 16:02











            • Your comment was actually relevant. The heuristic is not consistent.

              – Demplo
              Sep 13 '14 at 16:26






            • 1





              @Crackej If the heuristic is not monotone, then you need to reopen nodes, as you can later encounter them on a cheaper path.

              – ziggystar
              Sep 13 '14 at 18:50

















            The heuristic is not monotone. It decreases from B to A.

            – ziggystar
            Sep 13 '14 at 15:14





            The heuristic is not monotone. It decreases from B to A.

            – ziggystar
            Sep 13 '14 at 15:14













            True, not only there. Still is admissible and should guarantee optimality.

            – Demplo
            Sep 13 '14 at 15:33





            True, not only there. Still is admissible and should guarantee optimality.

            – Demplo
            Sep 13 '14 at 15:33













            Sorry, I'm a bit confused today. :)

            – ziggystar
            Sep 13 '14 at 16:02





            Sorry, I'm a bit confused today. :)

            – ziggystar
            Sep 13 '14 at 16:02













            Your comment was actually relevant. The heuristic is not consistent.

            – Demplo
            Sep 13 '14 at 16:26





            Your comment was actually relevant. The heuristic is not consistent.

            – Demplo
            Sep 13 '14 at 16:26




            1




            1





            @Crackej If the heuristic is not monotone, then you need to reopen nodes, as you can later encounter them on a cheaper path.

            – ziggystar
            Sep 13 '14 at 18:50





            @Crackej If the heuristic is not monotone, then you need to reopen nodes, as you can later encounter them on a cheaper path.

            – ziggystar
            Sep 13 '14 at 18:50


















            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f25823391%2fsuboptimal-solution-given-by-a-search%23new-answer', 'question_page');
            }
            );

            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







            Popular posts from this blog

            Contact image not getting when fetch all contact list from iPhone by CNContact

            count number of partitions of a set with n elements into k subsets

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks