Skip to content

This is a collection of famous and useful algorithms used in computer science and engineering problems

Notifications You must be signed in to change notification settings

sina-04/Algorithms-Collection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 

Repository files navigation

Algorithms-Collection

This is a collection of famous and useful algorithms used in computer science and engineering problems.


Overview

This repository organizes algorithms into three broad categories โ€” Exact, Heuristic, and Metaheuristic โ€” each representing a different philosophy of problem-solving. From guaranteed-optimal methods to intelligent search strategies inspired by nature, this collection provides a reference point for both theoretical understanding and practical implementation.


๐Ÿงฎ Exact Algorithms

These algorithms guarantee the optimal solution, often through mathematical formulations and systematic exploration of the solution space. They are precise but can become computationally expensive for large or NP-hard problems.

# Algorithm Typical Application
1 Simplex Method Linear Programming
2 Branch and Bound (B&B) Integer / Mixed-Integer Programming
3 Branch and Cut Combinatorial Optimization (TSP, VRP)
4 Dynamic Programming (DP) Sequential Decision Problems (Knapsack, Shortest Path)
5 Cutting Plane Method Integer Programming, Polyhedral Optimization
6 Branch and Price Column Generation, Vehicle Routing
7 Network Simplex Algorithm Minimum Cost Flow, Transportation Problems
8 Interior Point Method Large-scale Linear and Nonlinear Programming
9 Hungarian Algorithm Assignment Problem
10 Dijkstraโ€™s Algorithm Shortest Path in Graphs (exact under non-negative weights)

โš™๏ธ Heuristic Algorithms

Heuristics aim to find good enough solutions quickly, using intuitive rules or problem-specific strategies. They are particularly useful when exact algorithms become infeasible due to problem size or complexity.

# Algorithm Typical Application
1 Greedy Algorithm Scheduling, Knapsack, MST (Primโ€™s, Kruskalโ€™s)
2 Nearest Neighbor Heuristic Traveling Salesman Problem (TSP)
3 2-opt / 3-opt Route Optimization (TSP, VRP)
4 Insertion Heuristic Vehicle Routing, Scheduling
5 Savings Algorithm (Clarke & Wright) Vehicle Routing Problem (VRP)
6 Local Search General improvement of existing solutions
7 Hill Climbing Function optimization (simple landscapes)
8 Greedy Randomized Adaptive Search Procedure (GRASP) Combinatorial Optimization
9 Best-First Search / A* Pathfinding, Robotics
10 Constructive Scheduling Heuristics (SPT, LPT) Job Scheduling Problems

๐Ÿง  Metaheuristic Algorithms

Metaheuristics are higher-level frameworks that guide the search process to explore the solution space effectively. They often combine randomness, adaptation, and biological or physical inspiration to escape local optima and find near-optimal solutions for large, complex problems.

# Algorithm Inspiration / Concept
1 Genetic Algorithm (GA) Natural Selection, Evolution
2 Simulated Annealing (SA) Metallurgy Cooling Process
3 Tabu Search Adaptive Memory and Forbidden Moves
4 Ant Colony Optimization (ACO) Ant Foraging Behavior
5 Particle Swarm Optimization (PSO) Bird Flocking / Fish Schooling
6 Differential Evolution (DE) Population-based Continuous Optimization
7 Artificial Bee Colony (ABC) Honeybee Foraging Behavior
8 Harmony Search (HS) Musical Improvisation
9 Firefly Algorithm (FA) Bioluminescent Communication
10 Cuckoo Search (CS) Brood Parasitism Behavior

Summary

Type Optimality Typical Scope Famous Examples
Exact Guaranteed Smallโ€“medium, structured problems Simplex, B&B, DP
Heuristic Near-optimal Mediumโ€“large, specific problems Greedy, 2-opt, Savings
Metaheuristic Near-optimal (robust) Very large, complex, or unstructured problems GA, SA, PSO, ACO

๐ŸŒ Purpose of This Repository

This repository serves as:

  • A reference hub for well-known algorithms across disciplines.
  • A learning resource for students and practitioners of optimization, computer science, and data science.
  • A code collection for implementing and benchmarking algorithms in real-world problem contexts.

๐Ÿ“ Repository Structure

The repository is organized into three main directories, each representing one class of algorithms. Every folder contains well-documented implementations, examples, and references for further study.

Algorithms-Collection/
โ”‚
โ”œโ”€โ”€ exact/
โ”‚   โ”œโ”€โ”€ simplex/
โ”‚   โ”œโ”€โ”€ branch_and_bound/
โ”‚   โ”œโ”€โ”€ dynamic_programming/
โ”‚   โ””โ”€โ”€ ...
โ”‚
โ”œโ”€โ”€ heuristic/
โ”‚   โ”œโ”€โ”€ greedy/
โ”‚   โ”œโ”€โ”€ nearest_neighbor/
โ”‚   โ”œโ”€โ”€ local_search/
โ”‚   โ””โ”€โ”€ ...
โ”‚
โ”œโ”€โ”€ metaheuristic/
โ”‚   โ”œโ”€โ”€ genetic_algorithm/
โ”‚   โ”œโ”€โ”€ simulated_annealing/
โ”‚   โ”œโ”€โ”€ particle_swarm_optimization/
โ”‚   โ””โ”€โ”€ ...
โ”‚
โ””โ”€โ”€ README.md

Each implementation includes:

  • Explanation โ€“ a brief description of the algorithmโ€™s logic and mathematical foundation.
  • Code โ€“ a clean, modular implementation (preferably in Python).
  • Example โ€“ a sample use case or test problem demonstrating how it works.
  • References โ€“ academic or practical resources for deeper understanding.

๐Ÿงญ Future Extensions

Planned expansions include:

  • Benchmark comparisons between algorithms on classic datasets (e.g., TSP, Knapsack).
  • Visualizations of search processes for metaheuristics.
  • Links to Jupyter notebooks for interactive learning.

About

This is a collection of famous and useful algorithms used in computer science and engineering problems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published