ArticleslgStudy

computer science

Visvalingam–Whyatt algorithm

Visvalingam–Whyatt algorithm is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Visvalingam–Whyatt algorithm rather than just read about it. In short: The Visvalingam–Whyatt algorithm, or simply the Visvalingam algorithm, is an algorithm that decimates a curve composed of line segments to a similar curve with fewer points, primarily for usage in cartographic generalisation. Idea Given a polygonal chain (often called a polyline), the algorithm attempts to find a similar chain composed of fewer points.

Visvalingam–Whyatt algorithm — main illustration
Visvalingam–Whyatt algorithm — illustration

Key takeaways

  • Visvalingam–Whyatt algorithm belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Visvalingam–Whyatt algorithm to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Visvalingam–Whyatt algorithm from memory before moving on to harder problems.

Reference excerpt

The Visvalingam–Whyatt algorithm, or simply the Visvalingam algorithm, is an algorithm that decimates a curve composed of line segments to a similar curve with fewer points, primarily for usage in cartographic generalisation.

Idea 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.

Algorithm 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. Alternatively, the equivalent formula below can be used

A i = 1 2 | x i − 1 y i + x i y i + 1 + x i + 1 y i − 1 − x i − 1 y i + 1 − x i y i − 1 − x i + 1 y i | {\displaystyle A_{i}={\frac {1}{2}}\left|x_{i-1}y_{i}+x_{i}y_{i+1}+x_{i+1}y_{i-1}-x_{i-1}y_{i+1}-x_{i}y_{i-1}-x_{i+1}y_{i}\right|}

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.

Advantages The algorithm is easy to understand and explain, but is often competitive with much more complex approaches. With the use of a priority queue, the algorithm is performant on large inputs, since the importance of each point can be computed using only its neighbors, and removing a point only requires recomputing the importance of two other points. It is simple to generalize to higher dimensions, since the area of the triangle between points has a consistent meaning.

Disadvantages The algorithm does not differentiate between sharp spikes and shallow features, meaning that it will clean up sharp spikes that may be important. The algorithm simplifies the entire length of the curve evenly, meaning that curves with high and low detail areas will likely have their fine details eroded.

See also Curve fitting Alternative algorithms for line simplification include:

Ramer–Douglas–Peucker Reumann–Witkam Opheim simplification Lang simplification Zhao–Saalfeld algorithm

References Notes

Bibliography Visvalingam, M.; Whyatt, J. D. (1993). "Line generalisation by repeated elimination of points" (PDF). The Cartographic Journal. 30 (1): 46–51. doi:10.1179/000870493786962263. ISSN 0008-7041.

External links Interactive example of the algorithm

Illustrations

Visvalingam–Whyatt algorithm: Comparison with Douglas–Peucker algorithm
Comparison with Douglas–Peucker algorithm

Worked examples

Example 1 — a first encounter with Visvalingam–Whyatt algorithm

Start with the simplest possible case. Write down what Visvalingam–Whyatt algorithm claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Visvalingam–Whyatt algorithm before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Visvalingam–Whyatt algorithm ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Visvalingam–Whyatt algorithm

In research
Visvalingam–Whyatt algorithm appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Visvalingam–Whyatt algorithm in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Visvalingam–Whyatt algorithm is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer graphics algorithms, Digital signal processing, Geometric algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Visvalingam–Whyatt algorithm outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Visvalingam–Whyatt algorithm” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Visvalingam–Whyatt algorithm in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Visvalingam–Whyatt algorithm means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Visvalingam–Whyatt algorithm out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Visvalingam–Whyatt algorithm in simple terms?

The Visvalingam–Whyatt algorithm, or simply the Visvalingam algorithm, is an algorithm that decimates a curve composed of line segments to a similar curve with fewer points, primarily for usage in cartographic generalisation. Idea Given a polygonal chain (often called a polyline), the algorithm att…

Why does Visvalingam–Whyatt algorithm matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Visvalingam–Whyatt algorithm?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Visvalingam–Whyatt algorithm.

Tags

  • Computer graphics algorithms
  • Digital signal processing
  • Geometric algorithms

Keep exploring