10182

# Nearest Neighbor Graph Connections

This Demonstration expands on a graphical study of nearest neighbors to look at the statistics of the number of connections. (The original Demonstration, "Nearest Neighbor Networks", looked at a process of connecting nearest neighbors and successively more removed neighbors on an assortment of points in 2D.) The parameter settings specify the number of connections to make from each point to its nearest neighbors and possibly to further neighbors. The first control is for the number of points. The second control is for the neighbor connections in the dot and stick visualization, while the third slider specifies the maximum of a range of neighbor connections over which to explore in the bottom plots. Note that while the parameter set specifies connections from each point to a certain number of neighbors, the result is more complex, with some points connected multiply as back-and-forth connections accumulate, so that clusters of connections form.

### DETAILS

The two graphs at the top, from the original Demonstration, show an arrangement of points and connections for the number of neighbors specified and one number beyond.
The bottom-left plot shows ranked plots over the range of neighbors chosen (up to the maximum). That is, for each value for nearest or next neighbors, the ranked graph shows how well the points are connected. As the number of specified neighbors increases, the number of realized connections increases as well. And there is a skew to the result, as a few dots have many connections and many dots are in the tail with fewer connections. Connections are concentrated as a purely probabilistic phenomenon.
The contour plot at the lower right shows the statistics for the number of connections, a PDF in terms of counting the occurrences of different values for resulting connections. It uses the same results as in the ranked plot, but counts the occurrence of each value of connection. A ridge appears, representing the maximum count of connections for each nearest neighbor number. This ridge is more diffuse for larger values of connections as there is statistical variation in the clustering, with the larger reaches from successively farther neighbor connections. Finally both plots reach a maximum plateau at connections. When enough neighbors are connected the points become connected to every other point.

### PERMANENT CITATION

 Share: Embed Interactive Demonstration New! Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details » Download Demonstration as CDF » Download Author Code »(preview ») Files require Wolfram CDF Player or Mathematica.

#### Related Topics

 RELATED RESOURCES
 The #1 tool for creating Demonstrations and anything technical. Explore anything with the first computational knowledge engine. The web's most extensive mathematics resource. An app for every course—right in the palm of your hand. Read our views on math,science, and technology. The format that makes Demonstrations (and any information) easy to share and interact with. Programs & resources for educators, schools & students. Join the initiative for modernizing math education. Walk through homework problems one step at a time, with hints to help along the way. Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet. Knowledge-based programming for everyone.