In (10), the path P is starting at (0,0) with infinite length. However, as the 2D-PEH is concentrated on (0,0), i.e., the most highest bins are located around the origin. We then restrict that the (n + m + 1)th pair (x, y) in the path is (n, m), while for the kth pair (x, y) in the path, y = m holds for each k > n + m + 1. That is, from the (n + m + 2)th pair, it is always the right neighbor of its former. Here, n and m are two predetermined parameters. With this restriction, the optimization problem (10) is simplified in which the to-be-determined optimal path has finite length. More specifically, denote Pn,m as a path stating at (0,0) and ending at (n, m). Then, for given n and m, the optimization problem (10) can be rewritten as