estimate the minpath from right top to left bottom