aruspex alternatives and similar packages
Based on the "Algorithms and Data structures" category.
Alternatively, view aruspex alternatives based on common mentions on social networks and blogs.
-
matrex
A blazing fast matrix library for Elixir/Erlang with C implementation using CBLAS. -
simple_bayes
A Naive Bayes machine learning implementation in Elixir. -
exconstructor
An Elixir library for generating struct constructors that handle external data with ease. -
erlang-algorithms
Implementations of popular data structures and algorithms -
remodel
:necktie: An Elixir presenter package used to transform map structures. "ActiveModel::Serializer for Elixir" -
MapDiff
Calculates the difference between two (nested) maps, and returns a map representing the patch of changes. -
merkle_tree
:evergreen_tree: Merkle Tree implementation in pure Elixir -
bloomex
:hibiscus: A pure Elixir implementation of Scalable Bloom Filters -
aja
Extension of the Elixir standard library focused on data stuctures, data manipulation and performance -
DeepMerge
Deep (recursive) merge for maps, keywords and others in Elixir -
exmatrix
Elixir library implementing a parallel matrix multiplication algorithm and other utilities for working with matrices. Used for benchmarking computationally intensive concurrent code. -
the_fuzz
String metrics and phonetic algorithms for Elixir (e.g. Dice/Sorensen, Hamming, Jaccard, Jaro, Jaro-Winkler, Levenshtein, Metaphone, N-Gram, NYSIIS, Overlap, Ratcliff/Obershelp, Refined NYSIIS, Refined Soundex, Soundex, Weighted Levenshtein) -
ecto_materialized_path
Tree structure & hierarchy for ecto models -
dataframe
Package providing functionality similar to Python's Pandas or R's data.frame() -
Conrex
An Elixir implementation of the CONREC algorithm for topographic or isochrone maps. -
murmur
:speech_balloon: An implementation of the non-cryptographic hash Murmur3 -
bitmap
Bitmap implementation in Elixir using binaries and integers. Fast space efficient data structure for lookups -
Closure Table
Closure Table for Elixir - a simple solution for storing and manipulating complex hierarchies. It provides in-memory and Ecto adapters. -
paratize
Elixir library providing some handy parallel processing facilities that supports configuring number of workers and timeout.
TestGPT | Generating meaningful tests for busy devs
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of aruspex or a related project?
Popular Comparisons
README
Aruspex
Aruspex is a configurable constraint solver, written purely in Elixir.
Aruspex does, or atleast has the capacity to, support multiple constraint problem satisfaction strategies. Because of this property it is theoretically capable of supporting various types of CSPs.
At the time of writing Aruspex ships with one strategy, simulated annealing, which supports weighted CSPs.
This readme refers to master, please check the readme for your release.
Example
Given a map of Australia, find some colouring of teritories, such that no adjacent territory has the same colour.
import Aruspex.Server
use Aruspex.Constraint
{:ok, problem} = start_link
variables = [
wa = :western_australia,
nt = :nothern_territory,
q = :queensland,
sa = :south_australia,
nsw = :new_south_wales,
v = :victoria,
t = :tasmania
]
domain = [:red, :green, :blue]
Enum.map variables, &(variable problem, &1, domain)
problem
|> set_search_strategy(Aruspex.Strategy.SimulatedAnnealing)
# adjacent territories cannot be the same colour
# The pin operator is used to reference a named variable in a constraint,
# check the section on variables below.
|> post(linear ^wa != ^nt)
|> post(linear ^wa != ^sa)
|> post(linear ^sa != ^nt)
|> post(linear ^sa != ^q)
|> post(linear ^sa != ^nsw)
|> post(linear ^sa != ^v)
|> post(linear ^nt != ^q)
|> post(linear ^q != ^nsw)
|> post(linear ^nsw != ^v)
|> find_solution
|> IO.inspect
# [ new_south_wales: :blue,
# nothern_territory: :blue,
# queensland: :green,
# south_australia: :red,
# tasmania: :green,
# victoria: :green,
# western_australia: :green ]
For some more examples checkout [these.](test/support/examples/)
Usage
Check the api exposed by Aruspex.Server
Creating a new problem
Aruspex uses a GenServer
under the hood, to create a new problem simply use
{:ok, pid} = Aruspex.Server.start_link
Defining a new variable
A literal is used to name a new variable, and a domain is specified for the variable. This literal will be used to reference the variable later when defining constraints and will appear in the solution.
@spec variable(pid, Literals, Enum.t) :: pid
^pid = Aruspex.Server.variable(pid, :x, 1..100)
Defining a new constraint
Adding a new constraint is called posting a constraint. Posting a constraint requires specifying the variables that participate in the constraint, as well as a function the returns a cost when tested.
Strategies attempt to minimize the cost of all constraints, where a total cost of 0 would be a perfect solution.
all_diff/1
Constraints may be defined using built in constraints:
pid
|> post(all_diff [:x, :y])
The all_diff
constraint would impose a condition that all variables specified
must be unique.
linear/1
using the linear/{1,2}
macro (only supports clauses that can be inlined -
only expressions that can appear in guard clauses):
pid
|> post(linear ^:x == ^:y)
inside the body of the linear/1
macro pinned literals indicate that the value
refers to a named variable which will be substituted in during compilation.
pinned variables may also be used to the same effect.
unpinned values will be used by value.
some_var = :x
z = 1
pid
|> post(linear ^some_var == ^:y + z)
is equivalent to:
pid
|> post(linear ^:x == ^:y + 1)
linear/2
In it's second form, the named variables may be defined explicitly, and matched on.
pid
|> post(linear [:x, :y],
[{x1, _}, {_, y2}] when x1 == y2)
constraint/1
User defined constraints are also supported by using the constraint record directly.
Strategies will test constraints by applying the values for variables
, in
the order specified, to function
.
function
must have a type of [Literals] -> number
.
pid
|> post(constraint(
variables: [:v, :w],
function: fn ([v, w]) ->
cond do
v > 10 ->
100
w < 10 ->
9999
true ->
0
end
end
))
Roadmap
- [ ] configurable settings for s.a. strategy (run time, cooling strategy, etc.)
- [ ] configurable tolerance for what is an acceptable solution (default is only perfect solutions)
- [ ] allow strategies to return multiple soltuions with message box.
- [ ] allow multiple strategies to be employed, which will act as middlewear.
- [ ] user defined optimization tolerance
- [ ] implement more common constraints from the global constraint catalog.
- [ ] add additional strategies