title: Algorithm to generate a path in grid with specific number of cells to use
body: <p>I have a grid with a random size (for example 5 x 5 or 8 x 8 randomly generated) and also with a randomly generated start point and end point. Is there a possible way to know all possible paths that I can take from the start point to the end point with a specific number of cells to use and not go and check all possible moves (which will ramp up the complexity of the algorithm)?<br>
  So for example, this grid (S and E is start point and end point, and yeah, it is not really not required to start on one point than the other so maybe target points is the right word to use):
  <code>
  0  0  0  0  0  0  0  0
  0  0  0  0  0  0  0  0
  0  0  0  0  0  E  0  0
  0  0  0  0  0  0  0  0
  0  0  0  0  0  0  0  0
  0  0  0  0  0  S  0  0
  0  0  0  0  0  0  0  0
  0  0  0  0  0  0  0  0
  </code>
  For example I need to use a total of 10 cells. So one solution will be:
  <code>
  0  0  0  0  0  0  0  0
  0  0  0  0  0  0  0  0
  0  0  0  0  0  E  0  0
  0  0  0  0  0  |  0  0
  0  0  0  0  0  |  -  |
  0  0  0  0  0  S  0  |
  0  0  0  0  0  |  0  |
  0  0  0  0  0  -  -  |
  </code>
  The last thing is that it must detect if a path can't be generated at all. For example in this grid, for some reason you can't generate a solution if the required cells to use is 10:
  <code>
  0  0  0  0  0  0  0  0
  0  0  0  0  0  0  0  0
  0  0  0  0  0  0  E  0
  0  0  0  0  0  0  0  0
  0  0  0  0  0  0  0  0
  0  0  0  0  0  S  0  0
  0  0  0  0  0  0  0  0
  0  0  0  0  0  0  0  0
  </code>
  Thanks!</p>