`indices` (and `indices - [neighbor, neighbor]`) are fixed for every step of the `fast_marching_method` inner loop. The initialization of these indices should be moved out of this function.