Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6182653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:14:09+00:00 2026-05-24T01:14:09+00:00

From this link: Link If an adjacent square is already on the open list,

  • 0

From this link: Link

If an adjacent square is already on the open list, check to see if
this path to that square is a better one. In other words, check to see
if the G score for that square is lower if we use the current square
to get there
. If not, don’t do anything.

Example:

parent (already traversed): O
branches: A, B, C

parent (working on): A
Branches: B, D

The open list contains, A, B, C and now D.

Now, the bold statements in the above quote are comparing which path with, path A to B?
i.e.
Comparison of A to B && O to B
OR
Comparison of A to B && A to D

Please clarify.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:14:09+00:00Added an answer on May 24, 2026 at 1:14 am

    Basic A* is:

    While we're not close enough to the / a destination
        Take the point that we have now, with the lowest expected total cost (so known cost up to this point plus estimated remaining cost).
        Calculate cost for all surrounding locations & add them back to the priority queue with their expected total cost.
    
    return route that we followed to the closest point
    

    In the official A* terminology, G-score is the cost to get there. H-score is the estimate to get from there to where you want to go.

    Extremes are if your H-score always overestimates; the new score (estimate + new cost) will then always be lower than the previous square’s estimate + cost, so you’ll beeline to the target. If your H-score always underestimates (or is 0, or whatever) you’ll always prefer squares closer to your point of departure, as they’ll have a lower cost so far, so you’ll basically floodfill from that position.

    You can use A* from a theoretical point of view or from a practical point of view. Theoretically, you may never overestimate the cost of any link. That means that you will always find the most efficient route, but will take longer finding it as you’ll expand a lot more nodes.

    Using it from the practical point of view allows slightly-inadmissible heuristics (ones that can overestimate slightly). The route you find will most likely be slightly unoptimal but shouldn’t be too bad for game use. The calculations get way faster though, since you don’t expand everything anymore. One (slow) implementation I had made took 6 minutes across a 1k*1k map with a regular trig distance heuristic but only a few seconds with that augmented times 3. The routes weren’t too different. Making the heuristic times 5 made the routes basically a beeline & much faster still, but unusably so.

    WRT your direct question:
    It’s the second square you evaluate. You have the roads from O to A,B,C planned (with a given cost G for each of those routes). Now, suppose there’s a highway from O through A to B, instead of a dirt road from O to B. That means that going through A is faster. When expanding A it looks at all surrounding squares and adds the cost + heuristic to the open list if it wasn’t in there already. If it was in there, it sees if the new route is faster (lower G to get to that square) and only if so, does it replace it.

    So in your example, it adds O->A->D to the list and then checks if O->A->B is faster than O->B.

    — addendum

    Open list: 2 / A (through O), 5 / B (through O), 7 / C (through O)

    Closed list: 0 / O (origin / through nothing)

    Take A as it’s the lowest cost so far. Then, for each neighbor of A calculate the cost to get there.

    • If there’s an entry for it already and the cost is lower than we know so far, replace the entry.
    • If there’s no current entry, add it.

    Working on A, with roads of cost 2 to B and 3 to D. Going to B through A has a cost of 4, where the current entry is 5. So we replace it. D isn’t in there, so we add it.

    Open list: 4 / B (through A), 5 / D (through A), 7 / C (through O)

    Closed list: 0 / O (origin / through nothing), 2 / A (through O)

    So we compared A to B versus O to B.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having this link statement: List<UserGroup> domains = UserRepository.Instance.UserIsAdminOf(currentUser.User_ID); query = (from doc in
How do other people debug HTTPS sites from Visual Studio 2008? This link seems
In the context of this question link text is possible from a Controller that
I just downloaded one sample from this link :- http://msdn.microsoft.com/en-us/library/ff431744%28v=VS.92%29.aspx But when i try
I have a link from that link: http://api.maxxiscentral.com/maxxiscentral/GetTyrePatterns from this link i want to
The following quote is from this link: http://doc.qt.io/qt-5/qwidget.html#setLayout If there already is a layout
I've got the php list directory script from this link http://www.gaijin.at/en/scrphpfilelist.php . How do
Branching off from this link it seems that Request.ServerVariables(SCRIPT_NAME) doesn't return anything. I've just
From this link gdb interpret memory address as an object we know that, if
I have borrowed code from this link PHP regex templating - find all occurrences

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.