title: Implementing BFS in Java
body: <p>I am a beginner in Java, and I need some help.</p>
  
  <p>I am trying to implement Breadth First Search algorithm to solve a puzzle game (Unblock Me a game on Android). I am done with the GUI, but I am stuck with the algorithm.</p>
  
  <p>So far I can count the available moves of each block, which supposed to be the children nodes of the root node. Each node (linkedlist) has the position of each block, and all the nodes are being stored in a Set. </p>
  
  <p>What I need now is to mark each node as visited, so I don't get into an infinite loop.</p>
  
  <p>I would appreciate any kind of help, and please correct me if I am mistaken with anything.</p>
  
  <p>Thanks in advance :)</p>