ArticleslgStudy

computer science

Diameter (computational geometry)

Diameter (computational geometry) 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 Diameter (computational geometry) rather than just read about it. In short: In computational geometry, the diameter of a finite set of points or of a polygon is its diameter as a set, the largest distance between any two points. The diameter is always attained by two points of the convex hull of the input.

Key takeaways

  • Diameter (computational geometry) 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 Diameter (computational geometry) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Diameter (computational geometry) from memory before moving on to harder problems.

Reference excerpt

In computational geometry, the diameter of a finite set of points or of a polygon is its diameter as a set, the largest distance between any two points. The diameter is always attained by two points of the convex hull of the input. A trivial brute-force search can be used to find the diameter of n points in time O(n2) (assuming constant-time distance evaluations) but faster algorithms are possible for points in low dimensions.

Static 2d input In two dimensions, the diameter can be obtained by computing the convex hull and then applying the method of rotating calipers. This involves finding two parallel support lines for the convex hull (for instance vertical lines through the two vertices with minimum and maximum x-coordinate) and then rotating the two lines through a sequence of discrete steps that keep them as parallel lines of support until they have rotated back to their original orientation. The diameter is the maximum distance between any pair of convex hull vertices found as the two points of contact of the parallel lines in this sweep. The time for this method is dominated by the time for constructing the convex hull: O(nlog⁡n) for a finite set of n points, or time O(n) for a simple polygon with n vertices.

Dynamic 2d input For a dynamic two-dimensional point set subject to point insertions and deletions, an approximation to the diameter, with an approximation ratio that can be chosen arbitrarily close to one, can be maintained in time O(log2n) per operation. The exact diameter can be maintained dynamically in expected time O(log⁡n) per operation, in an input model in which the set of points to be inserted and deleted, and the order of insertion and deletion operations, is worst-case but the point chosen to be inserted or deleted in each operation is chosen randomly from the given set. For a dynamic two-dimensional point set of a different type, n points each moving linearly with fixed velocities, the time at which the points attain their minimum diameter and the diameter at that time can be computed in time O(nlog2n)

Higher dimensions In three dimensions, the diameter of a set of points can again be computed in time O(nlog⁡n). A randomized method for doing this by Clarkson and Shor uses as a subroutine a randomized incremental algorithm for finding the intersection of congruent spheres. The algorithm repeatedly chooses a random input point, finds the farthest distance ρ from it, intersects spheres with radius ρ centered at each point, and eliminates the points contained in the resulting intersection. The eliminated points are within distance ρ of all other points, and therefore cannot be part of any pair with a larger distance than ρ. Each point is eliminated when the farthest distance from it is less than or equal to ρ, the farthest distance from the randomly chosen point, which happens with probability 12, so half of the points are eliminated in expectation in each iteration of the algorithm. The total expected time for the algorithm is dominated by the time to find the first intersection of spheres, before the problem is simplified by eliminating any points. This time is O(nlog⁡n). Ramos provides a non-random algorithm by using ε-nets to derandomize a variation of the Clarkson and Shor algorithm, with the same asymptotic runtime. In any fixed dimension d, there exists an algorithm for which the exponent of n in the time bound is less than two. It is also possible to approximate the diameter, to within a (1+ε) approximation ratio, in time O(n+ε1/2−d).

See also Kinetic diameter (data), the algorithmic problem of maintaining the diameter of moving points Minimum-diameter spanning tree, a different notion of diameter for low-dimensional points based on the graph diameter of a spanning tree

References

Worked examples

Example 1 — a first encounter with Diameter (computational geometry)

Start with the simplest possible case. Write down what Diameter (computational geometry) 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 Diameter (computational geometry) 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 Diameter (computational geometry) 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 Diameter (computational geometry)

In research
Diameter (computational geometry) 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 Diameter (computational geometry) 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
Diameter (computational geometry) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Geometric algorithms, Length, so understanding it makes those chapters shorter.
In everyday life
Look for Diameter (computational geometry) 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 “Diameter (computational geometry)” →

How to study Diameter (computational geometry) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Diameter (computational geometry) 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 Diameter (computational geometry) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Diameter (computational geometry) in simple terms?

In computational geometry, the diameter of a finite set of points or of a polygon is its diameter as a set, the largest distance between any two points. The diameter is always attained by two points of the convex hull of the input.

Why does Diameter (computational geometry) 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 Diameter (computational geometry)?

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 Diameter (computational geometry).

Tags

  • Geometric algorithms
  • Length

Keep exploring