Numbrix puzzles are similar to Hidato.
The most important difference is that it is only possible to move 1 node left, right, up, or down (sometimes referred to as the Von Neumann neighborhood).
Published puzzles also tend not to have holes in the grid and may not always indicate the end node.
Two examples follow:

Example 1
Problem.

 0  0  0  0  0  0  0  0  0
 0  0 46 45  0 55 74  0  0
 0 38  0  0 43  0  0 78  0
 0 35  0  0  0  0  0 71  0
 0  0 33  0  0  0 59  0  0
 0 17  0  0  0  0  0 67  0
 0 18  0  0 11  0  0 64  0
 0  0 24 21  0  1  2  0  0
 0  0  0  0  0  0  0  0  0

Solution.

 49 50 51 52 53 54 75 76 81
 48 47 46 45 44 55 74 77 80
 37 38 39 40 43 56 73 78 79
 36 35 34 41 42 57 72 71 70
 31 32 33 14 13 58 59 68 69
 30 17 16 15 12 61 60 67 66
 29 18 19 20 11 62 63 64 65
 28 25 24 21 10  1  2  3  4
 27 26 23 22  9  8  7  6  5

Example 2
Problem.

 0  0  0  0  0  0  0  0  0
 0 11 12 15 18 21 62 61  0
 0  6  0  0  0  0  0 60  0
 0 33  0  0  0  0  0 57  0
 0 32  0  0  0  0  0 56  0
 0 37  0  1  0  0  0 73  0
 0 38  0  0  0  0  0 72  0
 0 43 44 47 48 51 76 77  0
 0  0  0  0  0  0  0  0  0

Solution.

  9 10 13 14 19 20 63 64 65
  8 11 12 15 18 21 62 61 66
  7  6  5 16 17 22 59 60 67
 34 33  4  3 24 23 58 57 68
 35 32 31  2 25 54 55 56 69
 36 37 30  1 26 53 74 73 70
 39 38 29 28 27 52 75 72 71
 40 43 44 47 48 51 76 77 78
 41 42 45 46 49 50 81 80 79

Task
Write a program to solve puzzles of this ilk,
demonstrating your program by solving the above examples.
Extra credit for other interesting examples.



Related tasks

 A* search algorithm
 Solve a Holy Knight's tour
 Knight's tour
 N-queens problem
 Solve a Hidato puzzle
 Solve a Holy Knight's tour
 Solve a Hopido puzzle
 Solve the no connection puzzle


import algorithm, sequtils, strformat, strutils
 
const Moves = [(1, 0), (0, 1), (-1, 0), (0, -1)]
 
type Numbrix = object
  grid: seq[seq[int]]
  clues: seq[int]
  totalToFill: Natural
  startRow, startCol : Natural
 
 
proc initNumbrix(board: openArray[string]): Numbrix =
 
  let nRows = board.len + 2
  let nCols = board[0].split(',').len + 2
  result.grid = newSeqWith(nRows, repeat(-1, nCols))
  result.totalToFill = (nRows - 2) * (nCols - 2)
 
  var list: seq[int]
  for r in 0..board.high:
    let row = board[r].split(',')
    for c in 0..row.high:
      let val = parseInt(row[c])
      result.grid[r + 1][c + 1] = val
      if val > 0:
        list.add val
        if val == 1:
          result.startRow = r + 1
          result.startCol = c + 1
 
  list.sort()
  result.clues = list
 
 
proc solve(numbrix: var Numbrix; row, col, count: Natural; nextClue: int): bool =
 
  if count > numbrix.totalToFill:
    return true
 
  let back = numbrix.grid[row][col]
  if back notin [0, count]:
    return false
  if back == 0 and nextClue < numbrix.clues.len and numbrix.clues[nextClue] == count:
    return false
 
  var nextClue = nextClue
  if back == count: inc nextClue
 
  numbrix.grid[row][col] = count
  for move in Moves:
    if numbrix.solve(row + move[1], col + move[0], count + 1, nextClue):
      return true
  numbrix.grid[row][col] = back
 
 
proc print(numbrix: Numbrix) =
  for row in numbrix.grid:
    for val in row:
      if val != -1:
        stdout.write &"{val:2} "
    echo()
 
 
when isMainModule:
 
  const
 
    Example1 = ["00,00,00,00,00,00,00,00,00",
                "00,00,46,45,00,55,74,00,00",
                "00,38,00,00,43,00,00,78,00",
                "00,35,00,00,00,00,00,71,00",
                "00,00,33,00,00,00,59,00,00",
                "00,17,00,00,00,00,00,67,00",
                "00,18,00,00,11,00,00,64,00",
                "00,00,24,21,00,01,02,00,00",
                "00,00,00,00,00,00,00,00,00"]
 
    Example2 = ["00,00,00,00,00,00,00,00,00",
                "00,11,12,15,18,21,62,61,00",
                "00,06,00,00,00,00,00,60,00",
                "00,33,00,00,00,00,00,57,00",
                "00,32,00,00,00,00,00,56,00",
                "00,37,00,01,00,00,00,73,00",
                "00,38,00,00,00,00,00,72,00",
                "00,43,44,47,48,51,76,77,00",
                "00,00,00,00,00,00,00,00,00"]
 
  for i, board in [1: Example1, 2: Example2]:
    var numbrix = initNumbrix(board)
    if numbrix.solve(numbrix.startRow, numbrix.startCol, 1, 0):
      echo &"Solution for example {i}:"
      numbrix.print()
    else:
      echo "No solution."