Giter Site home page Giter Site logo

higharc-challenge's Introduction

This is my solution to a computational geometry problem to find all the 'interior faces' (i.e. polygons) of a connected, planar graph.

Algorithm overview:

The algorithm I developed takes a divide and conquer approach. It starts by finding a random[0] closed path (representing a potentially 'composite'[1] polygon) to partition the graph into two regions: one on the interior of the found path, one exterior.

The algorithm then recurses, repeating the same behavior within the boundary of the closed path which was found at the previous level: this subgraph is also a connected, planar graph; the only difference is we know its boundary explicitly (which is unknown at the top level).

The algorithm bottoms out when one of the random closed paths it finds is itself an 'atomic' polygon rather than composite.


[0] The 'randomness' here just comes from the input data not having any specified order.

[1] By 'composite' polygon I'm referring to closed paths which form polygons, but also have within them additional closed paths that form polygons. 'Atomic' polygons have no additional vertices on their interior.

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.