Skip to content

Instantly share code, notes, and snippets.

@nacnudus
Created March 14, 2022 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nacnudus/fb57718bc4e53cf612969c17e6d794f8 to your computer and use it in GitHub Desktop.
Save nacnudus/fb57718bc4e53cf612969c17e6d794f8 to your computer and use it in GitHub Desktop.
Euclidean Minimum Spanning Tree in Julia using mlpack
# The fastest implementation available is in mlpack (C++)
using Pkg
Pkg.add("mlpack")
using mlpack
x = rand(5,2)
x_emst = mlpack.emst(x)
# A far slower implementation is in EMST.jl. As of 2022-03-14 my fork has been updated to run with Julia v0.7+using Pkg
using Pkg
Pkg.add(url="https://github.com/nacnudus/EMST.jl", rev="julia-v0.7")
using EMST
x = rand(2,5)
x_emst = EMST.compute_emst(x, nmin=4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment