However, the number of states removed could become large, and a linear (O(n)) search of a large structure would take too much time.
Solution: Maintain a hash table "Closed" of states that have been removed from the priority queue and check to see if a state has already been created in constant (O(1)) time.