Uddeshya Singh
1 min readJul 3, 2018

--

Hi, I had a quick question (or 2) regarding the code here.

# Child is already in the open list 
for open_node in open_list:
if child == open_node and child.g > open_node.g:
continue

In this snippet, i wanted to know that what exactly is the point of

child.g > open_node.g?

Also. Shouldn’t child.g = child.parent.g + 1 do the trick instead of child.g = current_node.g + 1

--

--

Uddeshya Singh
Uddeshya Singh

Written by Uddeshya Singh

Software Engineer @Gojek | GSoC’19 @fossasia | Loves distributed systems, football, anime and good coffee. Writes sometimes, reads all the time.

No responses yet