A* Algorithm: closed list contains too many elements / too large
问题 I'm currently implementing the A* algorithm in JavaScript. However, I've ran into a problem: My closedList seems way too large. Here is a screenshot of the output: What could cause this problem? Is my heuristic calculation wrong? Node.prototype.getHeuristic = function(pos0, pos1) { // Manhatten Distance var horizontalDistance = Math.abs(pos1.x - pos0.x); var verticalDistance = Math.abs(pos1.y - pos0.y); return horizontalDistance + verticalDistance; } Or did I understand/implement something