title: Graph search algorithm with fewest accessed nodes
body: <p>I need an algorithm to find ANY path from point A to point B in a graph.
  The problem is that finding out wich nodes can follow a specific one needs a quite lengthy matlab simulation, so i want to access as few nodes as possible.</p>
  
  <p>I know some heuristics about the graph, I.E. every node has some coordinates and follow-up nodes are always "near" the previous one, but there is not always a connection between two close nodes.</p>
  
  <p>I am not searching for an optimal path, or even a short one. I just need any connection.</p>
  
  <p>My first try was some simple greedy algorithm that always picks a follow up node closest to the final node, but this ended in dead ends very often. This wouldn't be a problem, but i have no idea how to efficiently move out of a deadend, currently i simply move through all nodes inside the dead end until i find a better way.</p>
  
  <p>Here is a drawing of an example where i already know the solution:
  <a href="https://i.stack.imgur.com/r5QDe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r5QDe.png" alt="Simplified because the actual problem is in 4D"></a></p>
  
  <p>There are many nodes, so calculating the edges for every node in this small dead end on the top takes about 1h20min. (You can assume every pixel in the picture is a node.)</p>
  
  <p>To put it in short words: how do i find a good way around the obstacle without looking at every node inside a whole area.</p>
  
  <p>Sorry if this a silly question but i'm an engineer and never had a formal education in programming aside from making a LED blink.</p>
  
  <p>Thanks in advance!</p>