title: Raster path following algorithms
body: <p>I've got a raster grid of values that looks something like the image below (white is high values, the black background value is zero).</p>
  
  <p><img src="https://i.stack.imgur.com/VbxRa.png" alt="RasterGridExample"></p>
  
  <p>I'm trying to write some kind of path-following code to start at the end of one of the lines and trace to the other end, going via the highest possible values (that is, the whiter the pixels chosen to be in the line the better) but still getting to the other end.</p>
  
  <p>I've been struggling with this for a while, and can't seem to get anything I try to work. So I wondered, has a generic algorithm already been developed for this sort of problem? I've done a lot of searching, but most path algorithms seem to be designed to work on vectors/networks, not raster grids like this.</p>
  
  <p>Any ideas?</p>