I am working on a problem that calls for a Voronoi tesselation of a plane. I thought that in the Voronoi tesselation, each point would be contained in a unique cell of the Voronoi map, e.g.
In that illustration points are black dots, and each is contained in exactly one colored cell. However, using the scikit implementation on my dataset, the number of regions / cells I get is smaller than the number of input points:
from scipy.spatial import Voronoi
import numpy as np
import json
# data is here: https://gist.github.com/duhaime/69ce65c6849708b31ba855d49d2812e6
a = np.array(json.load(open('umap.json')))
v = Voronoi(a)
print(a.shape) # prints (172502, 2)
print(len(v.regions)) # prints 169526
The scikit documentation on the Voronoi class led me to find v.point_region
contains one entry for each input point. The ith member of v.point_region
indicates the index of v.regions
to which the ith value in a belongs. E.g. v.point_region[17]
= 34 would mean that a[17]
belongs to v.regions[34]
. I did not realize multiple points could belong to the same Voronoi region!
This brings me to my question: Are there Qhull options one can specify that ensure each point is isolated in a distinct cell in the Voronoi map? That is to say, I'd like one unique region for each cell. Any pointers others can offer on this question would be hugely appreciated!