Giter VIP home page Giter VIP logo

voronoigraph.jl's Introduction

VoronoiGraph

DOI Dev Build Status codecov

This Package implements a variation of the Voronoi Graph Traversal algorithm by Polianskii and Pokorny [1]. It constructs a Voronoi Diagram from a set of points by performing a random walk on the graph of the vertices of the diagram. Unlike many other Voronoi implementations this algorithm is not limited to 2 or 3 dimensions and promises good performance even in higher dimensions.

Usage

We can compute the Voronoi diagram with a simple call of voronoi

julia> data = rand(4, 100)  # 100 points in 4D space
julia> v, P = voronoi(data)

which returns the vertices v::Dict. keys(v) returns the simplicial complex of the diagram, wheras v[xs] returns the coordinates of the vertex inbetween the generators data[xs]. Additionally P contains the data in a vector-of-vectors format, used for further computations.

It also exports the random walk variant (returning only a subset of vertices):

julia> v, P = voronoi_random(data, 1000)  # perform 1000 iterations of the random walk

Area / Volume computation

julia> A,V = volumes(v, P)

computes the (deterministic) areas of the boundaries of neighbouring cells (as sparse array A) as well as the volume of the cells themselves (vector V) by falling back onto the Polyhedra.jl volume computation.

Monte Carlo

Combining the raycasting approach with Monte Carlo estimates we can approximate the areas and volumes effectively:

julia> A, V = mc_volumes(P, 1000)  # cast 1000 Monte Carlo rays per cell

If the simplicial complex of vertices is already known we can speed up the process:

julia> A, V = mc_volumes(v, P, 1000)  # use the neighbourhood infromation contained in v

We furthermore can integrate any function f over a cell i and its boundaries:

julia> y, δy, V, A = mc_integrate(x->x^2, 1, P, 100, 10) # integrate cell 1 with 100 boundary and 100*10 volume samples

Here y and the vector δy contain the integrals over the cell and its boundaries. V and A get computed as a byproduct.

References

[1] V. Polianskii, F. T. Pokorny - Voronoi Graph Traversal in High Dimensions with Applications to Topological Data Analysis and Piecewise Linear Interpolation (2020, Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining)

voronoigraph.jl's People

Contributors

axsk avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

martinheida

voronoigraph.jl's Issues

Handling of boundary

So far when walkray moved from a vertex to infinity it returned the input vertex.

explore uses this information to continue exploring other steps.

However we should expose this information, either through

  • connecting them to the ∞-generator, messing up the simplicial complex somewhat, or
  • by returning a list with all verts connected to ∞.

I'll hotfix this in explore, but walkray should probably already report it explicitly.

Montecarlo integration

Integration of functions over the cells and boundaries seems straightforward from here on.

Nice to have for improved SQRA

Improved initial guess

For raycasting we should be able to use improved initial guesses.

Either "tmid", i.e. on the generating plane, or even beyond. (Refer to incircle pictures)

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Cleanup raycasts

rename Search to Raycast

Find a smooth way to choose Raycast algorithms.

Again we have the problem that the default constructor depends on the data. Solutions

  • Lazy mutable struct with fit!
  • Raycast[...]Factory
  • ?

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.