Questions about algorithmic solutions of geometric problems, or other algorithms making usage of geometry.
Questions tagged [computational-geometry]
881 questions
32
votes
1 answer
Largest set of cocircular points
Given $n$ points with integer coordinates in the plane, determine the maximum number of points that lie on the same circle (on its circumference, not its interior).
This can be done in $O(n^3)$ easily by trying $\binom{n}{3}$ combinations of…
chubakueno
- 451
- 3
- 5
21
votes
1 answer
How to pack polygons inside another polygon?
I have ordered a few leather sheets from which I would like to build juggling balls by sewing edges together. I'm using the Platonic solids for the shape of the balls.
I can scan the leather sheets and generate a polygon that approximates the shape…
alecail
- 422
- 2
- 10
20
votes
2 answers
How to devise an algorithm to arrange (resizable) windows on the screen to cover as much space as possible?
I would like to write a simple program that accepts a set of windows (width+height) and the screen resolution and outputs an arrangement of those windows on the screen such that the windows take the most space. Therefore it is possible to resize a…
daniel.jackson
- 441
- 2
- 7
19
votes
3 answers
How many cookies in the cookie box? -- Tiling stars
With holiday season coming up I decided to make some cinnamon stars. That was fun (and the result tasty), but my inner nerd cringed when I put the first tray of stars in the box and they would not fit in one layer:
Almost! Is there a way they could…
Raphael
- 73,212
- 30
- 182
- 400
19
votes
2 answers
Efficient algorithms for vertical visibility problem
During thinking on one problem, I realised that I need to create an efficient algorithm solving the following task:
The problem: we are given a two-dimensional square box of side $n$ whose sides are parallel to the axes. We can look into it through…
mnbvmar
- 373
- 1
- 6
19
votes
1 answer
Is there an O(n log n) algorithm for 4D line simplification?
The Ramer-Douglas-Peucker algorithm for line simplification has worst-case $O(n^2)$ runtime. For suitably distributed random inputs, it has expected $O(n \log n)$ runtime complexity. In 2D, there are other algorithms with worst case $O(n \log n)$…
Thomas Klimpel
- 5,440
- 29
- 69
19
votes
3 answers
Maximum Enclosing Circle of a Given Radius
I try to find an approach to the following problem:
Given the set of point $S$ and radius $r$, find the center point of circle, such that the circle contains the maximum number of points from the set. The running time should be $O(n^2)$.
At first…
com
- 3,199
- 3
- 27
- 39
19
votes
3 answers
Line separates two sets of points
If there is a way to identify if two sets of points can be separated by a line?
We have two sets of points $A$ and $B$ if there is a line that separates $A$ and $B$ such that all points of $A$ and only $A$ on the one side of the line, and all…
com
- 3,199
- 3
- 27
- 39
19
votes
1 answer
guillotine cuts versus general cuts
Cutting problems are problems where a certain large object should be cut to several small objects. For example, imagine you have a factory that works with large sheets of raw glass, of width $W$ and length $L$. There are several buyers, each of…
Erel Segal-Halevi
- 6,088
- 1
- 25
- 60
17
votes
1 answer
Brute force Delaunay triangulation algorithm complexity
In the book "Computational Geometry: Algorithms and Applications" by Mark de Berg et al., there is a very simple brute force algorithm for computing Delaunay triangulations. The algorithm uses the notion of illegal edges -- edges that may not appear…
Mikhail Dubov
- 623
- 4
- 11
16
votes
1 answer
How do I test if a polygon is monotone with respect to an arbitrary line?
Definition: A polygon $P$ in the plane is called monotone with respect to a straight line $L$, if every line orthogonal to $L$ intersects $P$ at most twice.
Given a polygon $P$, is it possible to determine if there exists any line $L$ such that…
com
- 3,199
- 3
- 27
- 39
16
votes
2 answers
Runtime of the optimal greedy $2$-approximation algorithm for the $k$-clustering problem
We are given a set 2-dimensional points $|P| = n$ and an integer $k$. We must find a collection of $k$ circles that enclose all the $n$ points such that the radius of the largest circle is as small as possible. In other words, we must find a set $C…
Juho
- 22,905
- 7
- 63
- 117
16
votes
2 answers
What is this data structure/concept where a plot of points defines a partition to a space
I encountered an algorithm to solve a real world problem, and I remember a class I took where I made something very similar for some for a homework problem.
Basically it's a plot of points, and the lines are drawn to be equidistant between two…
Brian
- 161
- 3
15
votes
2 answers
Which method is preferred for storing large geometric objects in a quadtree?
When placing geometric objects in a quadtree (or octree), you can place objects that are larger than a single node in a few ways:
Placing the object's reference in every leaf for which it is contained
Placing the object's reference in the deepest…
nsantorello
- 251
- 2
- 6
15
votes
1 answer
Testing whether a tetrahedron lies inside a Polyhedron
I have a tetrahedron $t$ and a polyhedron $p$. $t$ is constrained such that it always shares all its vertices with $p$. I want to determine whether $t$ lies inside $p$.
I would like to add one detail to the problem in case it may contribute to the…
Pranav
- 359
- 1
- 13