Giter Club home page Giter Club logo

wrld-exercise-features's Introduction

WRLD Coding Exercise - the Most Isolated Feature

Solution

The most isolated feature can be obtained by searching for a point, which represents a feature in the Euclidian space, with the highest isolation among the other points that surround it. Isolation criteria of a point can be reformulated as the distance to another nearest point from the set, i.e. the smallest distance among the neighbours. We establish the neighbourhood relationships by using the Delaunay graph that is the dual of the Voronoi graph, which avoids considering points that are not in the proximity.

Complexity

The complexity of Delaunay computation is limited by O(nlog n) in the worst case. The isolation search is limited by O(nk), where k is the largest number of neighbours in the Voronoi diagram, and, since it can be considered a constant for a large and evenly distributed point set in space, the complexity is instead O(n). Taking into account both operations, we stay within the O(nlog n) limits. An improvement to the constant factor in the isolation search could have been made by caching the distance between any two neighbours, improving the performance of this operation roughly twice-fold.

Implementation

Python (version 3) language was used for the implementation. It was tempting to use C++, but the overhead of the build setup and the dependencies like the Boost Polygon library was not worth it in the end. We use the Delauney module of the SciPy python library that is in turn based on the Qhull library. NumPy library was used for the algebraic operations and as a dependency. SciPy for Python can be installed by executing:

pip3 install scipy

wrld-exercise-features's People

Contributors

sonicth avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.