We filter out already visited states when adding them to the work list. We also don't sort the work list as we're already generating it in a sorted (by cost) order.
We filter out already visited states when adding them to the work list. We also don't sort the work list as we're already generating it in a sorted (by cost) order.