I have an n x m
matrix consisting of non-negative integers. For example:
2 3 4 7 1
1 5 2 6 2
4 3 4 2 1
2 1 2 4 1
3 1 3 4 1
2 1 4 3 2
6 9 1 6 4
You can represent this problem as integer programming problem. (this is just one of possible solutions to approach this problem)
Having points:
a b c d
e f g h
i j k l
m n o p
one can write 16 equations where for point f for example holds
f <= ai + bi + ci + ei + fi + gi + ii + ji + ki
minimaised over sum of all indexes and integer solution.
Solution is of course sum of this indexes.
This can be further simplified by setting all xi on boundaries 0, so you end up having 4+1 equation in this example.
Problem is that there is no trivial algorhitm for solving such problems. tI am not expert on this, but solving this problem as linear programming is NP hard.