13 unstable releases (5 breaking)
new 0.6.7 | Feb 18, 2025 |
---|---|
0.6.4 | Jan 23, 2025 |
0.4.0 | Feb 23, 2020 |
0.3.2 | Oct 11, 2018 |
0.2.0 | Jul 24, 2018 |
#196 in Algorithms
327 downloads per month
Used in bund
1MB
27K
SLoC
Algos
π§ Work in Progress π§
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.
Recent Changes
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.
Overview
A Rust library implementing a wide range of algorithms, from fundamental computer science concepts to advanced machine learning techniques.
Implementation Status
β Currently Implemented
Sorting Algorithms
β
QuickSort
β
MergeSort
β
HeapSort
β
BubbleSort
β
InsertionSort
β
SelectionSort
β
ShellSort
β
CountingSort
β
RadixSort
β
Randomized QuickSelect
β
Randomized QuickSort
β
BucketSort
Searching Algorithms
β
Linear Search
β
Binary Search
β
Ternary Search
β
Interpolation Search
β
Jump Search
β
Exponential Search
β
Fibonacci Search
β
Sublist Search
β
Depth-First Search
β
Breadth-First Search
String Algorithms
β
Knuth-Morris-Pratt (KMP)
β
Rabin-Karp
β
Boyer-Moore
β
Z-Algorithm
β
Aho-Corasick
β
Suffix Array Construction
β
Suffix Automaton
β
Suffix Tree
β
Rolling Hash
β
Manacher's Algorithm
Graph Algorithms (Part 1)
β
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
Graph Algorithms (Part 2)
β
EdmondβKarp (max flow)
β
Dinic's Algorithm (max flow)
β
FordβFulkerson (max flow)
β
Hungarian Algorithm (assignment)
β
HopcroftβKarp (bipartite 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
Dynamic Programming
β
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
Hashing
β
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
Classic Machine Learning
β 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
DO NOT USE Cryptography and Security DO NOT USE
β
RSA
β
DiffieβHellman Key Exchange
β
ElGamal Encryption
β
AES (Rijndael)
β
Blowfish
β
Twofish
β
SHA-256
β
MD5 (legacy)
β
Elliptic Curve Cryptography (ECC)
β
DSA (Digital Signature Algorithm)
Deep Learning & Neural Network Training
β
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)
Reinforcement Learning
β
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
Approximation Algorithms
β
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)
Linear & Nonlinear Optimization
β
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
Integer Linear Programming Methods
β
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 Algorithms
β
Randomized BFS 2-SAT
β
Reservoir Sampling
β
Skip List
Monte Carlo Methods
β Monte Carlo Integration
Contributing
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.
License
This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.
Dependencies
~9MB
~173K SLoC