Setting incoming edge of node in A*