smithery.ai

algorithms

This skill should be used when choosing "data structures", "Map vs ETS vs gb_trees performance", evaluating "hash functions", needing "HyperLogLog or bloom/cuckoo filters", or comparing OTP built-ins against specialized alternatives for Elixir

First seen Mar 31, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 4,788 B
  • docs SUMMARY.md 144 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Modern Algorithms and Data Structures

Overview

Use OTP built-ins first. Escalate to specialized structures only when profiling shows a bottleneck. For most Elixir applications, Map, MapSet, List, and the OTP modules cover 95% of needs.

Quick Decision

What are you solving?
  Data storage/lookup       → See ets-and-persistent-term.md, otp-builtins.md
  Concurrent shared state   → See concurrent-data-structures.md, ets-and-persistent-term.md
  Graph/dependency problem  → See graph-algorithms.md
  Text search/matching      → See string-and-text.md
  Location/spatial          → See spatial.md
  Time ranges/scheduling    → See interval-and-range.md
  Streaming metrics         → See streaming-algorithms.md
  Large-scale counting/sets → See probabilistic.md
  Hashing                   → See hash-functions.md
  Compression               → See compression.md
  Sorting large datasets    → See sorting-and-search.md
  Optimization/constraints  → See optimization.md
  Statistics/analytics      → See statistics.md

Common Mistakes

  • GenServer as concurrent cache: Serializes reads; use ETS with read_concurrency: true
  • Application.getenv in hot paths: Use :persistentterm for config read on every request
  • Lists as queues: queue ++ [item] is O(n); use :queue for O(1)
  • GenServer as counter: Use :atomics or :counters instead
  • MD5/SHA1 for non-crypto: 60× slower than xxHash3
  • Exact counting at scale: HyperLogLog uses 16 KB where MapSet uses 800 MB (100M items)

Reference Files

Read the file that matches your current problem:

  • ets-and-persistent-term.md — When: Need concurrent shared state or config cache. ETS table types, concurrency options, cache/rate-limiter patterns, :persistent_term for config
  • otp-builtins.md — When: Looking for queue, tree, set, or counter primitives. :queue, :gbtrees, :gbsets, :atomics, :counters, :array, Okasaki structures
  • graph-algorithms.md — When: Working with dependencies, networks, or paths. :digraph/:digraph_utils patterns: topological sort, shortest path, cycle detection, dependency resolution
  • string-and-text.md — When: Building search, fuzzy matching, or autocomplete. Fuzzy matching (Levenshtein, Jaro-Winkler), full-text search (tsvector, pg_trgm), autocomplete
  • concurrent-data-structures.md — When: Need lock-free or high-concurrency patterns. CAS with :atomics, lock-free patterns, ETS concurrency, :counters write_concurrency
  • spatial.md — When: Working with geographic data or proximity queries. PostGIS (STDWithin, STContains), geohashing, Haversine distance
  • interval-and-range.md — When: Handling time ranges, scheduling, or overlap detection. Postgres range types, overlap detection, exclusion constraints, scheduling
  • streaming-algorithms.md — When: Computing metrics over unbounded data streams. Sliding windows, EMA, reservoir sampling, streaming percentiles
  • optimization.md — When: Solving constraint, scheduling, or resource allocation problems. Dynamic programming, greedy, constraint satisfaction, gradient descent (Nx), simulated annealing, linear programming, when to push to Postgres
  • statistics.md — When: Need analytics, anomaly detection, or A/B testing. Descriptive stats (Postgres and Elixir), anomaly detection (Z-score, IQR), A/B testing, Explorer DataFrames, histograms, correlation
  • compression.md — When: Need to compress data for storage or transfer. :zlib, Zstd, LZ4, :erlang.termtobinary compressed option
  • probabilistic.md — When: Counting or membership testing at massive scale. HyperLogLog, Cuckoo filters, Count-Min Sketch, Bloom filters
  • hash-functions.md — When: Choosing hash function for non-crypto use. xxHash3, BLAKE3, HighwayHash selection guide
  • sorting-and-search.md — When: Sorting large datasets or building indexes. Cache-efficient sorting, BlockQuicksort, pdqsort, B+ trees

Commands

  • /algorithm-research — Deep research with academic paper citations
  • /benchmark — Create Benchee benchmarks to compare data structure alternatives

Related Skills

  • performance-analyzer: Profiling, benchmarking, latency analysis
  • distributed-systems: Consensus and replication algorithms
  • elixir-patterns: OTP process patterns, ETS usage

Use the algorithms-researcher agent for deep research with paper citations.