Thank you Steven, I fixed the issue by storing other objects in the PriorityQueue.
-Júlio 2016-10-17 14:27 GMT-07:00 Steven G. Johnson <stevenj....@gmail.com>: > Make a copy before you mutate it. In general, it is not safe to mutate > the keys of a dictionary, which is what you are doing. >