Given a polygonal chain (often called a polyline), the algorithm attempts to find a similar chain composed of fewer points.
Points are assigned an importance based on local conditions, and points are removed from the least important to most important.
In Visvalingam's algorithm, the importance is related to the triangular area added by each point.
Given a chain of 2d points { p i } = { [ x i y i ] } {\displaystyle \left\{p_{i}\right\}=\left\{{\begin{bmatrix}x_{i}\\y_{i}\end{bmatrix}}\right\}} , the importance of each interior point is computed by finding the area of the triangle formed by it and its immediate neighbors. This can be done quickly using a matrix determinant.1 Alternatively, the equivalent formula below can be used2
The minimum importance point p i {\displaystyle p_{i}} is located and marked for removal (note that A i − 1 {\displaystyle A_{i-1}} and A i + 1 {\displaystyle A_{i+1}} will need to be recomputed). This process is repeated until either the desired number of points is reached, or the contribution of the least important point is large enough to not neglect.
Alternative algorithms for line simplification include:
"6.5 – Applications of Matrices and Determinants". people.richland.edu. Retrieved 2020-07-07. https://people.richland.edu/james/lecture/m116/matrices/applications.html#:~:text=The%20legs%20of%20the%20three,/%202%20=%209/2. ↩
"Untitled Document". people.richland.edu. Retrieved 2020-07-07. https://people.richland.edu/james/lecture/m116/matrices/area.html ↩