change neighbor's parent according to A*