algorithm - Breadth First Search Pseudo Code Understanding -
i have 2 questions regarding pseduo code above.
- what function solution(node) do? how 1 implement it?
- on 3rd last line, check if child not in frontier. how 1 check in fifo queue?
solution(node)
returns full solution problem instead of node. in pathfinding problem, might return full path start end node
example:
def solution(node): result = [] while(node.predecessor not none): result.append(node.predecessor) node = node.predecessor
- linear search frontier. if isn't possible, still work long check whether node in explored after dequeued, requires memory.
Comments
Post a Comment