Questions tagged [voronoi]

A Voronoi diagram is a subdivision of space.

Given a set of n input points in dimension d, a Voronoi diagram divides the d-dimensional space into n regions, one for each seed. All points in a region are closer to the corresponding input point than any other input point.

It is dual to Delaunay triangulation.

It is one of the fundamental data structures in computational geometry and is the heart of many algorithms that deal with subdivision of space and triangulation of points.

542 questions
95
votes
14 answers

Easiest algorithm of Voronoi diagram to implement?

What are the easy algorithms to implement Voronoi diagram? I couldn't find any algorithm specially in pseudo form. Please share some links of Voronoi diagram algorithm, tutorial etc.
fireball003
  • 1,909
  • 5
  • 20
  • 24
69
votes
3 answers

Colorize Voronoi Diagram

I'm trying to colorize a Voronoi Diagram created using scipy.spatial.Voronoi. Here's my code: import numpy as np import matplotlib.pyplot as plt from scipy.spatial import Voronoi, voronoi_plot_2d # make up data points points =…
moooeeeep
  • 31,622
  • 22
  • 98
  • 187
40
votes
11 answers

Algorithm to compute a Voronoi diagram on a sphere?

I'm looking for a simple (if exists) algorithm to find the Voronoi diagram for a set of points on the surface of a sphere. Source code would be great. I'm a Delphi man (yes, I know...), but I eat C-code too.
stevenvh
  • 2,971
  • 9
  • 41
  • 54
32
votes
5 answers

How do I derive a Voronoi diagram given its point set and its Delaunay triangulation?

I'm working on a game where I create a random map of provinces (a la Risk or Diplomacy). To create that map, I'm first generating a series of semi-random points, then figuring the Delaunay triangulations of those points. With that done, I am now…
CommanderTso
  • 444
  • 1
  • 5
  • 11
20
votes
4 answers

From Voronoi tessellation to Shapely polygons

from a set of points I built the Voronoi tessellation using scipy: from scipy.spatial import Voronoi vor = Voronoi(points) Now I would like to build a Polygon in Shapely from the regions the Voronoi algorithm created. The problem is that the…
marcodena
  • 550
  • 2
  • 5
  • 15
19
votes
3 answers

Finding near neighbors

I need to find "near" neighbors among a set of points. There are 10 points in the above image. Red lines are edges from the Delaunay Triangulation, black stars mark the mid-lines of the edges, blue lines are the Voronoi tesselation. Point 1 has…
Jonas
  • 74,690
  • 10
  • 137
  • 177
19
votes
4 answers

Python: Calculate Voronoi Tesselation from Scipy's Delaunay Triangulation in 3D

I have about 50,000 data points in 3D on which I have run scipy.spatial.Delaunay from the new scipy (I'm using 0.10) which gives me a very useful triangulation. Based on: http://en.wikipedia.org/wiki/Delaunay_triangulation (section "Relationship…
EdwardAndo
  • 333
  • 1
  • 2
  • 7
18
votes
2 answers

Voronoi - Compute exact boundaries of every region

I'm trying to compute the exact boundaries of every region of a Voronoi Diagram using scipy.spatial.Voronoi, in the case that all the points are inside a pre-defined polygon. For example, using the example in this documentation. what if I need to…
user3681833
  • 181
  • 1
  • 4
17
votes
4 answers

Territory Map Generation

Is there a trivial, or at least moderately straight-forward way to generate territory maps (e.g. Risk)? I have looked in the past and the best I could find were vague references to Voronoi diagrams. An example of a Voronoi diagram is this: . These…
Matt Mitchell
  • 40,943
  • 35
  • 118
  • 185
17
votes
1 answer

3-D Cartesian points to 2-D hemispherical and calculate the area of 2-D Voronoi cells

I've been working on some functions in R and MatLab based on Qhull (the geometry package in R) to project local Cartesian X,Y,Z points within a circular plot to spherical (theta,phi,R), centered at 0,0,0. Since all of the Z values are positive in…
Adam Erickson
  • 6,027
  • 2
  • 46
  • 33
17
votes
2 answers

Getting a bounded polygon coordinates from Voronoi cells

I have points (e.g., lat, lon pairs of cell tower locations) and I need to get the polygon of the Voronoi cells they form. from scipy.spatial import Voronoi tower = [[ 24.686 , 46.7081], [ 24.686 , 46.7081], [ 24.686 , 46.7081]] c…
amaatouq
  • 2,297
  • 5
  • 29
  • 50
15
votes
5 answers

How can I get a dictionary of cells from this Voronoi Diagram data?

Using the voronoi/delaunay diagram generation library found in this program, which is based on Fortune's original implementation of his algorithm, with a random set of points as input data, I am able to get the following output data: A list of the…
pdusen
  • 520
  • 2
  • 7
  • 18
14
votes
1 answer

How to Bound the Outer Area of Voronoi Polygons and Intersect with Map Data

Background I'm trying to visualize the results of a kmeans clustering procedure on the following data using voronoi polygons on a US map. Here is the code I've been running so far: input <- read.csv("LatLong.csv", header = T, sep = ",") # K Means…
Rick Arko
  • 680
  • 1
  • 8
  • 27
14
votes
2 answers

Voronoi diagram polygons enclosed in geographic borders

I am trying to create Voronoi polygons (aka Dirichlet tessellations or Thiessen polygons) within a fixed geographic region for a set of points. However, I am having trouble finding a method in R that will bound the polygons within the map borders.…
Bryan
  • 1,771
  • 4
  • 17
  • 30
14
votes
4 answers

reference algorithm for weighted voronoi diagrams?

Can someone point me to a reference implementation on how to construct a (multiplicatively and/or additively) weighted voronoi diagram, which is preferably based on Fortune's voronoi algorithm? My goal: Given a set of points(each point has a weight)…
m3o
  • 3,881
  • 3
  • 35
  • 56
1
2 3
36 37