Store positions instead of whole BfsState in queue.