This project demonstrates the Nearest Neighbor algorithm through visual sketches. Click here to see the demo.
classes.js
: Contains custom JavaScript classes used in the sketch.index.html
: The main HTML file that sets up the project structure and includes necessary scripts and styles.jsconfig.json
: Configuration file for JavaScript in the project.libraries/
: Directory containing external libraries used in the project.sketch.js
: The main JavaScript file where the sketch is created and managed.style.css
: The CSS file for styling the HTML elements.
To run the project, simply open the index.html
file in a web browser. This will load the p5.js library, custom classes, and the main sketch script.
The main focus of this project is to visualize the Nearest Neighbor algorithm. The algorithm is implemented in the draw
function in sketch.js. It calculates the nearest neighbors for a set of points and visualizes the connections between them.