Fix explore set

In graph search, explored set is a dict with nodes as values. This produce a grow the use of memory and makes the algorithm's behavior be distinct than the expected based on book.