Fetching contributors…
Cannot retrieve contributors at this time
61 lines (47 sloc) 2.19 KB

# Euclidean v. Voronoi neighborhoods

lindbrook 2019-02-03

## overview

“The Voronoi region of a site s is the set of points in the plane for which s is the closest site among all the sites.”[1] Given this definition, you might wonder why there’s both a neighborhoodEuclidean() and a neighborhoodVoronoi() function. First, by definition, you need at least two sites to create a Voronoi diagram so `neighborhoodVoronoi(7)` will return an error but `neighorhoodEuclidean()` will not. This also what allows you to create star plots that are centered on a single pump.

`plot(neighborhoodEuclidean(7))`

Second, neighborhoodEuclidean() allows you to add a small dose of “realism”. With Voronoi tessellation, all that matters is the location of the pumps. All other data, be it buildings, roads or the location of fatalities, simply do not matter. But with neighborhoodEuclidean(case.set = “expected”), we can use case.location = “nominal” or case.location = “address”.

The former uses the nominal coordinates of the expected or simulated cases from regular.cases. Doing so effectively replicates the Voronoi diagram:

```plot(cholera::neighborhoodEuclidean(case.set = "expected",
case.location = "nominal"), type = "area.points")
cholera::addVoronoi(case.location = "nominal", color = "white", lwd = 2)```

The latter impose a constraint that the starting point must be a street address (i.e., people must leave their homes from the front door).[2] This produces an alternate picture of pump neighborhoods:

```plot(cholera::neighborhoodEuclidean(case.set = "expected",
case.location = "address"), type = "area.points")