This crate is undergoing significant development. It aims to be a comprehensive collection of algorithms implemented in Rust, serving both as a learning resource and a practical library.
Jan 16, 2025 - ADVISORY: This crate has changed hands and will be maintained by @Brad-Edwards. The repository has been moved to a new location.
A Rust library implementing a wide range of algorithms, from fundamental computer science concepts to advanced machine learning techniques.
β
QuickSort
β
MergeSort
β
HeapSort
β
BubbleSort
β
InsertionSort
β
SelectionSort
β
ShellSort
β
CountingSort
β
RadixSort
β
Randomized QuickSelect
β
Randomized QuickSort
β
BucketSort
β
Linear Search
β
Binary Search
β
Ternary Search
β
Interpolation Search
β
Jump Search
β
Exponential Search
β
Fibonacci Search
β
Sublist Search
β
Depth-First Search
β
Breadth-First Search
β
Knuth-Morris-Pratt (KMP)
β
Rabin-Karp
β
Boyer-Moore
β
Z-Algorithm
β
Aho-Corasick
β
Suffix Array Construction
β
Suffix Automaton
β
Suffix Tree
β
Rolling Hash
β
Manacher's Algorithm
β
Dijkstra's Algorithm
β
Bellman-Ford Algorithm
β
Floyd-Warshall Algorithm
β
Prim's Algorithm
β
Kruskal's Algorithm
β
Tarjan's Algorithm (SCC)
β
Kosaraju's Algorithm
β
Johnson's Algorithm
β
Warshall's Algorithm
β
Topological Sort
β
EdmondβKarp (max flow)
β
Dinic's Algorithm (max flow)
β
FordβFulkerson (max flow)
β
Hungarian Algorithm (assignment)
β
HopcroftβKarp (bipartite matching)
β
Edmonds' Blossom Algorithm (max matching)
β
BronβKerbosch (maximal clique)
β
Johnson's Cycle Detection
β
Floyd's Cycle Detection (Tortoise and Hare)
β
Euler Tour / Euler Circuit Algorithm
β
Hierholzer's Algorithm (Euler paths/circuits)
β
Karger's Min Cut
β
Randomized Delaunay Triangulation
β
Randomized Kruskal's MST
β
Randomized Prim's MST
β
Kadane's Algorithm
β
Matrix Chain Multiplication
β
Edit Distance
β
Coin Change
β
Longest Common Subsequence
β
Longest Increasing Subsequence
β
Weighted Interval Scheduling
β
Viterbi Algorithm
β
Bellman Equation-based DP
β
Knuth Optimization
β
Perfect Hashing
β
Universal Hashing
β
Cuckoo Hashing
β
Separate Chaining
β
Open Addressing (linear/quadratic probing, double hashing)
β
Polynomial Rolling Hash
β
FNV (FowlerβNollβVo) Hash
β
CRC32
β
Jenkins Hash
β
MurmurHash
β
k-Means Clustering
β
k-Nearest Neighbors (k-NN)
β
Linear Regression (OLS)
β
Logistic Regression
β
Decision Tree Learning (ID3, C4.5)
β
Random Forest
β
Support Vector Machine (SVM)
β
Naive Bayes
β
Gradient Boosting (GBM family)
β
XGBoost
β
RSA
β
DiffieβHellman Key Exchange
β
ElGamal Encryption
β
AES (Rijndael)
β
Blowfish
β
Twofish
β
SHA-256
β
MD5 (legacy)
β
Elliptic Curve Cryptography (ECC)
β
DSA (Digital Signature Algorithm)
β
Backpropagation
β
Stochastic Gradient Descent (SGD)
β
Adam Optimizer
β
RMSProp
β
AdaGrad
β
RProp (resilient propagation)
β
Dropout (regularization)
β
Batch Normalization
β
Convolution (core of CNNs)
β
BPTT (Backprop Through Time, RNNs/LSTMs)
β
Q-Learning
β
SARSA
β
Double Q-Learning
β
Deep Q-Network (DQN)
β
Monte Carlo Exploring Starts
β
Policy Gradients (REINFORCE)
β
ActorβCritic Methods
β
Proximal Policy Optimization (PPO)
β
Trust Region Policy Optimization (TRPO)
β
AlphaZero-Style MCTS + RL
β
Greedy Set Cover
β
2-Approximation for Vertex Cover
β
PTAS for Knapsack
β
Christofides' Algorithm (TSP)
β
Johnson's Algorithm for MAX-SAT
β
FPTAS for Subset Sum
β
Local-Ratio Theorem
β
PrimalβDual Approximation (for covering problems)
β
LP Rounding (generic approach)
β
GoemansβWilliamson (Max-Cut)
β
Gradient Descent
β
Newton's Method
β
Conjugate Gradient
β
BFGS
β
L-BFGS
β
Simplex Method (linear programming)
β
Interior Point Method (LP/NLP)
β
NelderβMead
β
Genetic Algorithm
β
Simulated Annealing
β
Branch and Bound
β
Branch and Cut
β
Branch and Price
β
Gomory Cutting Planes
β
DantzigβWolfe Decomposition
β
Benders Decomposition
β
Mixed Integer Rounding Cuts
β
Lift-and-Project Cuts
β
Branch & Reduce
β
Column Generation
β
Randomized BFS 2-SAT
β
Reservoir Sampling
β
Skip List
β Monte Carlo Integration
β
Backtracking for Permutations/Combinations
β
JohnsonβTrotter (permutation generation)
β
Gray Code Generation
β
Knuth's Dancing Links (Algorithm X)
β
Zassenhaus Algorithm (group factorization)
β
Hamiltonian Cycle Backtracking
β
Subset Generation (binary representation)
β
Huffman Coding
β
LZ77
β
LZ78
β
LZW
β
Arithmetic Coding
β
DEFLATE
β
BurrowsβWheeler Transform (bzip2)
β
PPM (Prediction by Partial Matching)
β
LZMA
β
RANS Coding
β
ReedβSolomon Codes
β
Hamming Codes
β
Convolutional Codes and Viterbi Decoding
β
Turbo Codes
β
LDPC (Low-Density Parity-Check) Codes
β
CRC (Cyclic Redundancy Check)
β
BCH Codes
β
Polar Codes
β
Fountain / Raptor Codes
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.