Nearest Neighbor Visualizer

The following images show a nearest neighbor interface I wrote with Python & pyOpenGL a few months ago.  Nearest neighbor is a fairly simple and commonly used algorithm with applications in pattern recognition, machine learning, DNA sequencing and many others.  I was specifically looking at comparing brute force search with the Kd-Tree algorithm for partitioning 3 dimensional spaces with nearest neighbors.  The visualizer places points in a 3dimensional array with user input to dynamically increase/decrease the number of field points & attractor points.  The colored spheres represent the attractor points and the smaller points represent the field.  As the user increases/decreases the number of field and/or attractor points they can dynamically calculate the nearest neighbors using either the brute force or Kd-tree search algorithms.  The field points will change color to indicate that particular point’s nearest neighbor.  The user can orbit the space and zoom in/out as they adjust the number of points and attractions.

“Nearest neighbor search (NNS), also known as proximity search, similarity search or closest point search, is an optimization problem for finding closest points in metric spaces. The problem is: given a set S of points in a metric space M and a query point q ∈ M, find the closest point in S to q. In many cases, M is taken to be d-dimensional Euclidean space and distance is measured by Euclidean distance or Manhattan distance.” – Wikipedia

“In computer science, a kd-tree (short for k-dimensional tree) is a space-partitioning data structure for organizing points in a k-dimensional space. kd-trees are a useful data structure for several applications, such as searches involving a multidimensional search key (e.g. range searches and nearest neighbor searches). kd-trees are a special case of BSP trees.” – Wikipedia
“The kd-tree is a binary tree in which every node is a k-dimensional point. Every non-leaf node can be thought of as implicitly generating a splitting hyperplane that divides the space into two parts, known as subspaces. Points to the left of this hyperplane represent the left sub-tree of that node and points right of the hyperplane are represented by the right sub-tree. The hyperplane direction is chosen in the following way: every node in the tree is associated with one of the k-dimensions, with the hyperplane perpendicular to that dimension’s axis. So, for example, if for a particular split the “x” axis is chosen, all points in the subtree with a smaller “x” value than the node will appear in the left subtree and all points with larger “x” value will be in the right sub tree. In such a case, the hyperplane would be set by the x-value of the point, and its normal would be the unit x-axis.” – Wikipedia

Advertisement




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


  • LOG:

    Skylar Tibbits will be presenting at the closing event of Contemplating the Void: Interventions in the Guggenheim Museum. Hosted by the Center for Architecture NY and Guggenheim NY, April 23rd 6pm. Invitation from David van der Leer.

    THEVERYMANY (Marc Fornes + Skylar Tibbits + Mat Staudt + Jared Laucks) will be exhibiting work at the Synesthesie Galerie, Paris France, March 25 '10.

    THEVERYMANY (Marc Fornes + Skylar Tibbits) will be exhibiting work at the Guggenheim Musuem, NY for the Contemplating the Void exhibition, February 13-May 12 '10. Invitation from David van der Leer.

    Skylar Tibbits, Steffen Reichert and Ari Kardasis will be teaching a Rhinoscript workshop/design studio at MIT, "Only Tools?", Jan. 19-Jan 29 '10.

    THEVERYMANY (Marc Fornes + Skylar Tibbits + Mat Staudt + Jared Laucks + Jon Proto + Brandon Kruysman) will present an installation @ Material Connexion, NY for the show, BITS'N PIECES, 4th Nov. Invitation: Dries Verbruggen with Alissia Melka-Teichroew & Jan Habraken

    THEVERYMANY (Marc Fornes + Skylar Tibbits + Mat Staudt) will present an installation, "n|Edg" @ Gallerie Roger Tator, Lyon, France. 14th Sept - 13th Nov. Invitation: Marie Bassano, Eric Deboos & Laurent Lucas

    THEVERYMANY (Marc Fornes + Skylar Tibbits + Mat Staudt + Jared Laucks + Jon Proto + Brandon Kruysman) will present an installation, "Modoid" @ Elga Wimmer Gallery, NYC. September 9th. Invitation: Kelsey Harrington & Christine Yogiaman

    THEVERYMANY (Marc Fornes + Skylar Tibbits + Mat Staudt) will present an installation, "Aloblums" in Valparaiso, Chile. August 2009. Invitation: Collective BANGS

    THEVERYMANY(Marc Fornes + Skylar Tibbits) will present at Storefront for Art and Architecture as part of the Material Feedback event, Jul 31 2009. Invitation from Rob Ley.

    THEVERYMANY(Marc Fornes + Skylar Tibbits + Mat Staudt) will present an installation, "Echinoids" @ BRIDGE GALLERY (NYC), July 9th 2009 as part of a collective show, Wild Child by Peter Macapia

    THEVERYMANY (Marc Fornes + Skylar Tibbits) were commissioned by SEED Media Group to design and present an award for Sheryl Handler, CEO of Ab Initio at The State of Innovation Summit. Washington D.C. June 23rd 2009

    Skylar Tibbits has been invited to give a lecture at RISD : Department of Architecture on May 1st. Invitation from Hansy Better Barraza.

    Skylar Tibbits, Marc Fornes, Dave Pigram, Michael Ashley, David Jackowski, Peter Macapia, Brian Dubois, and Jason Johnson have been invited as members of the jury for the Rouse[D] competition. August 2009
    www.rousedetroit.com

    THEVERYMANY (Marc Fornes + Skylar Tibbits) have been invited to produce and construct an installation at the FACULTY OF ENVIRONMENTAL DESIGN, University of Calgary, Canada, Opening Jan. 9th

    Daniel Cardoso, Kenfield Griffith and Skylar Tibbits will be co-teaching a Rhinoscript workshop at the Universidad de los Andes in Bogotá, Colombia from Jan 28th - Feb. 5th.

    Skylar Tibbits, Simon Kim and Juhong Park will be teaching a Rhinoscript workshop/design studio,"Command & Control", Jan. 12-Jan 26 '09 at MIT.

    Skylar Tibbits will be presenting at Pecha Kucha Boston on Nov. 12th '08 at Mantra.

    THEVERYMANY (Marc Fornes + Skylar Tibbits) exhibit work at the Beijing Biennale October 24th '08/ Beijing, CHINA.

    THEVERYMANY (Marc Fornes + Skylar Tibbits) will be presenting at the CPATH Workshops: Revitalizing Computer Science Education Through the Science of Digital Media.
    Thursday, May 29 '08 at La Salle University

    THEVERYMANY (Marc Fornes + Skylar Tibbits) will be presenting at the MIND08 Design + Science conference, a collaboration between SEED, MOMA and Parsons. April 4th '08 at Parsons The New School for Design.

    "MIND08 is a one-day conference inspired by the new MoMA exhibit Design and the Elastic Mind, which aims to catalyze this convergence. Bringing together an eclectic group of speakers and participants, including leading scientists, designers, and architects, the conference will explore topics such as the personal genome, brain visualization, generative architecture, and collective design. "
    http://www.mind08.com/

    Skylar Tibbits is featured in the “Revolutionary Minds” section of the March/April '08 issue of SEED Magazine.
    www.seedmagazine.com
    revminds.seedmagazine.com/

    THEVERYMANY (Marc Fornes + Skylar Tibbits) are invited to guest speak and exhibit work at the Node08 : Forum for Digital Arts, April 8th '08, Frankfurt, Germany. http://node08.vvvv.org/

    THEVERYMANY (Marc Fornes + Skylar Tibbits) collaborate on a piece for Generator.x 2.0: Beyond the Screen, Feb. 2 '08, Berlin. www.generatorx.no

    SJET is invited to contribute "Component Manipulation" and "Transient States" to the Nous Gallery's archived collection, London July '07. www.nousgallery.com.

  • Connections:

  • Archives

  • SJET was initiated by Skylar Tibbits, as a catalogue and source of inspiration for work in experimental computation + design. SJET remains open to growing opportunities that provide for investigation in architecture & design, fabrication, computer science, robotics, media, art, electronics, fashion...
    SJET is a direct result of an endless search for more.

    Education:
    BArch : Philadelphia University

    Current : Dual Degree: MIT
    Masters : Design Computation
    Masters : Computer Science

    Work Experience:
    Point b design
    Asymptote Architecture
    Zaha Hadid Architects
    SKIII Space Variations

    Skylar has partnered with Marc Fornes, THEVERYMANY (www.theverymany.net), since 2007 after co-curating Scriptedbypurpose, (www.scriptedbypurpose.net), an exhibition on explicit and encoded processes within design.

    Email: SJET [at] sjet.us

    SJET has been featured on/in:

    SEED Magazine : Revolutionary Minds, April 2008 http:revminds.seedmagazine.com www.theverymany.net www.scriptedbypurpose.net www.dezeen.com
    www.notcot.org http://blog.wired.com http://generatorx.no/ http://dataisnature.com/ http://aesthetechtonik.com/ http://node08.vvvv.org/ www.boingboing.net www.suckerpunchdaily.com www.archinect.com www.archispass.org/ www.fffound.com www.stumbleupon.com www.pinc.us http://blog.noahkalina.com http://livearchitecture.net/ http://blog.chaotic.co.uk http://andreagraziano.blogspot.com http://dimitrie.wordpress.com www.solidsmack.com www.core.form-ula.com www.rightbrainterrain.com



    Many thanks for the generous support from our material/fabrication/software sponsors who have made all of this possible:

    Alliance Metals Inc.
    Todd Roberts & Bill Yorston
    ( www.alliancemetals.com )

    Continental Signs :
    CNC Fabrication
    Mark, Andrea and Jared Laucks
    ( www.continentalsigns.net )

    Quadrant EPP : Advanced Engineering Plastics
    Kress Schwartz
    ( www.quadrantepp.com )

    Harbec Plastics:
    Rapid Protoyping
    Bob Bechtold
    ( www.harbec.com)

    Anyline Laser cutting
    Jose Gonzalez
    Michael Szivos
    (www.anyline-ny.com)

    TDM Solutions
    (www.tdmsolutions.com)
  • Views

    • 187,546 hits

Follow

Get every new post delivered to your Inbox.

Join 27 other followers