We will explain how Algorithm 1 works. In lines 1 and 2, the admissible vertex set and the length of the sliding window length for each contour point are calculated. In line 3, the rate for encoding the starting point of the contour is assigned to the rate of the first polygon vertex, and the rate for reaching any of the admissible vertex is set to infinity. The “for loops” in lines 4 and 5 select the start vertex of a polygon edge and the “for loops” in lines 6 and 7 select its end vertex within the sliding window of the start vertex. The lines 8–10 are used to calculate the edge distortion and the edge rate, by which the edge weight can be determined. The most important part of this algorithm is the comparison in line 11. Here, it tests whether the new minimum rate, $R*(ai,m)+w(ai,m,aj,n)$, to reach admissible vertex $aj,n$, given that the last vertex was $ai,m$, is smaller than the smallest minimum rate used so far to reach $aj,n$, $R*(aj,n)$. If this minimum rate is indeed smaller, then it is assigned as the new smallest minimum rate to reach admissible vertex $aj,n$, $R*(aj,n)=R*(ai,m)+w(ai,m,aj,n)$, and the back pointer of $aj,n$, $q(aj,n)$ is assigned to point to $ai,m$ since this is the previous vertex used to achieve $R*(aj,n)$. This algorithm leads to the optimal solution because when the rate $R*(ai,m)$ of a vertex $ai,m$ is given, then the selection of the future vertices $aj,n$, $i<j\u2264L(i)$ is independent of the selection of the past vertices $ak,l$, $0\u2264k<m$.