Python
Implementation of All ▲lgorithms in Python Programming Language
Install / Use
/learn @AllAlgorithms/PythonREADME
We are accepting all pull requests. Read More
<div align="center" id="top"> <br> <br> <br> <br> <img width="500" height="350" src="https://cdn.abranhe.com/projects/algorithms/logo.svg" alt="Algorithms Logo"> <br> <br> <br> <br> <br> <br> <p> <a href="#what-is-an-algorithm">What is an algorithm?</a> <a href="https://github.com/AllAlgorithms/algorithms/blob/master/.github/contributing.md">Contributing</a> <a href="https://www.redbubble.com/people/abranhe/works/34285088">Stickers & T-Shirts</a> </p> <p> <a href="https://twitter.com/AllAlgorithms"> <img src="https://cdn.svgporn.com/logos/twitter.svg" width="17px"> Twitter </a> <a href="https://instagram.com/AllAlgorithms"> <img src="https://www.instagram.com/static/images/ico/apple-touch-icon-152x152-precomposed.png/419a6f9c7454.png" width="17px"> Instagram </a> <a href="https://github.com/AllAlgorithms"> <img src="https://img.icons8.com/ios-glyphs/90/333333/github.png" width="18px"> Github </a> </p> <br> <p align="center"> <i>Huge collection of All ▲lgorithms implemented in multiple languages</i> </p> <br><a href="https://github.com/AllAlgorithms"><img src="https://cdn.abranhe.com/projects/algorithms/badge.svg" /></a> <a href="https://cash.me/$abranhe"><img src="https://cdn.abranhe.com/badges/cash-me.svg"></a> <a href="https://paypal.me/abranhe/10"><img src="https://cdn.abranhe.com/badges/paypal.svg"></a> <a href="https://patreon.com/abranhe"><img src="https://cdn.abranhe.com/badges/patreon.svg" /></a>
</div>See
- What is an algorithm
- Contributing
- Code of Conduct
- Stickers and T-Shirts
- Algorithms Categories
- Maintainers
- License
What is an algorithm?
Informally, an algorithm is any well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values, as output. An algorithm is thus a sequence of computational steps that transform the input into the output.
An algorithm should have three important characteristics to be considered valid:
- It should be finite: If your algorithm never ends trying to solve the problem it was designed to solve then it is useless
- It should have well defined instructions: Each step of the algorithm has to be precisely defined; the instructions should be unambiguously specified for each case.
- It should be effective: The algorithm should solve the problem it was designed to solve. And it should be possible to demonstrate that the algorithm converges with just a paper and pencil.
Categories
Structure of The All ▲lgoritms project
- Artificial Intelligence
- Backtracking
- Bit Manipulation
- Cellular Automaton
- Ciphers
- Computational Geometry
- Cryptography
- Data Structures
- Divide and conquer
- Dynamic Programming
- Gaming Theory
- Graphs
- Greedy Algorithms
- Math
- Networking
- Numerical Analysis
- Operating system
- Randomized Algorithms
- Searches
- Selections Algorithms
- Sorting
- Strings
- Online Challenges
- Others
Artificial Intelligence
- Density-based spatial clustering of applications with noise (DBSCAN Clustering)
- Interactive Self-Organizing Data Analysis Technique yAy! (ISODATA Clustering)
- Linear Regression
- Logistic Regression
- Neutral Style Transfer
- SATisfiable (SAT)
- Travelling salesman problem (TSP)
- A* (A Star)
- Artificial Neutral Network
- Convolutional Neutral Network
- Decision Tree
- Factorization Machines
- Gaussian Mixture Model
- Gradient Boosting Trees
- Hierachical Clustering
- Image Processing
- K Nearest Neighbors
- K Means
- Minimax
- Native Bayes
- Nearest Sequence Memory
- Neutral Network
- Perceptron
- Principal Component Analysis
- Q Learing
- Random Forests
- Restricted Boltzman Machine
Backtracking
- Algorithm X
- Crossword Puzzle
- Knight Tour
- M Coloring Problem
- N Queen
- Number of ways in Maze
- Partitions of set
- Permutation of Strings
- Powerset
- Rat in maze
- Subset Sum
- Sudoku Solve
Bit Manipulation
- Addition using bits
- Bit divisor
- Byte swapper
- Convert numbers to binary
- Count set bits
- Flip bits
- Hamming distance
- Invert bit
- Lonely integer
- Magic Number
- Maximum XOR Value
- Power of 2
- Subset Generation
- Sum binary numbers
- Sum equals XOR
- Thrice unique number
- Twice unique number
- XOR Swap
Cellular Automaton
- Brians Brain
- Conways Game of life
- Elementary Cellular Automata
- Generic Algorithm
- Langtons Ant
- Nobili Cellular Automata
- Von Neoumann Cellular Automata
Computational Geometry
- 2D Line intersection
- 2D Separating Axis test
- Area of polygon
- Area of triangle
- Axis aligned bounding box collision
- Bresenham Line
- Chans Algorithm
- Cohen Sutherland Lineclip
- Distance between points
- Graham Scan
- Halfplane intersection
- Jarvis March
- Quickull
- Sphere tetrahedron intersection
- Sutherland Hodgeman clipping
Cryptography
- Affine Cipher
- Atbash Cipher
- Autokey Cipher
- Baconian Cipher
- Caesar Cipher
- Colummnar Cipher
- Vigenere Cipher
Data Structures
Divide and conquer
- Strassen Matrix Manipulation
- Closest Pair of Point
- Inversion Count
- Karatsuba Multiplication
- Maximum Contiguous subsequence sum
- Merge Sort using divide and conquer
- [Quick Sort using divide and conquer](divide-and-conq
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
96.8kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
344.1kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
