I am learning A* algorithm and try to implement it. However, I found there are two conditions in which the final path will be possibly failed to be backtracked from the target node:
a child-node has two or more parent-node
If a node is reached by a second path, it doesn't add another parent -- instead, it evaluates which of those paths is least "costly" and makes the parent be that path.
So, you won't ever have two paths. The least costly path back is always the parent.
there will be a loop structure in the path
As soon as a node has been explored (once) in the current path, it is removed from the set of potential nodes to explore in the current path. Thus, there's no way to "loop back" because to the algorithm, already-explored nodes don't exist anymore as potential options.