title: Programming theory: Solve a maze
body: <p>What are the possible ways to solve a maze?<br>
  Ive got two ideas, but I think they are not very elegant.</p>
  
  <p><strong>Base situation:</strong> We have a matrix, and the elements in this matrix are ordered in a way that it represents a maze, with one way in, and one out.</p>
  
  <p>My first idea was to send a robot through the maze, following one side, until it's out of the maze. I think this is a very slow solution.</p>
  
  <p>The second one passes through every successive item marked with 1, checks where it can go (up, right, down, left) chooses one way and it continues its path there. This is even slower than the first one.</p>
  
  <p>Of course it's a bit faster if I make the two bots multi-threaded at every junction, but thats also not the best way.</p>
  
  <p>There needs to be better solutions to send a bot through a maze.</p>
  
  <p><strong>EDIT</strong><br>
  First: Thanks for the nice answers!</p>
  
  <p><strong>The second part of my question is:</strong> What to do in the case if we have a multi-dimensional graph? Are there special practices for that, or is the answer of Justin L. usable for that too?<br>
  I think it's not the best way for this case.</p>
  
  <p><strong>The third question:</strong><br>
  Which of these maze solver algorithms is/are the fastest? (Purely hypothetically)</p>