Skip to content

issu321/Algorithm-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Python Platform License Stars Release

โšก The most advanced terminal-based algorithm analysis suite ever built.
Graph Theory ยท Searching ยท Sorting ยท ADA ยท Speed Benchmarking ยท Futuristic UI


๐ŸŒŒ Vision

"I didn't just build an algorithm visualizer. I built a command center for computational thinking."
โ€” Ussu (@issu321)

USSU Algorithm Analyzer v4.0 is a cyberpunk-themed, fully interactive Python terminal application that transforms dry algorithm theory into an immersive, visual, and metrics-driven experience. Designed for students, researchers, CTF players, and engineers who refuse to use boring tools.

Whether you're learning BFS vs DFS, comparing Quick Sort vs Merge Sort, or benchmarking 8 different search algorithms across 10,000-element arrays โ€” this tool gives you real execution times, operation counters, and memory profiling in a terminal that looks like it belongs in a sci-fi movie.


๐Ÿš€ Quick Start

For beginners who just want to run it NOW.

Step 1: Download the code

git clone https://github.com/issu321/algorithm-analyzer.git
cd algorithm-analyzer

Step 2: Install dependencies

# Windows
pip install -r requirements.txt

# Linux / Kali / macOS
pip3 install -r requirements.txt

Step 3: Run it

# Windows
python app.py

# Linux / Kali / macOS
python3 app.py

That's it. The cyberpunk banner appears, then the menu shows up. Press 1 to create your first graph, or 10 to try searching algorithms.


๐Ÿ“ฆ Installation

We provide automated installers for both Windows and Linux. Choose your path below.

๐ŸชŸ Windows 11 (One-Click Installer)

# 1. Clone the repository
git clone https://github.com/issu321/algorithm-analyzer.git
cd algorithm-analyzer

# 2. Run the installer (double-click or run in PowerShell)
.\install.bat

# 3. Launch the application
python app.py

What install.bat does:

  • โœ… Checks if Python 3.10+ is installed
  • โœ… Verifies pip is available
  • โœ… Creates workspace folders (graphs/, reports/, data/)
  • โœ… Installs all dependencies from requirements.txt
  • โœ… Gives you a green "Installation Complete" banner

๐Ÿง Kali Linux / Debian / Ubuntu

# 1. Clone the repository
git clone https://github.com/issu321/algorithm-analyzer.git
cd algorithm-analyzer

# 2. Make installer executable and run it
chmod +x install.sh
./install.sh

# 3. Launch the application
python3 app.py

What install.sh does:

  • โœ… Checks python3 and pip3
  • โœ… Creates workspace folders
  • โœ… Installs dependencies
  • โœ… Makes app.py executable (chmod +x)

๐ŸŽ macOS / Manual Install (Any OS)

# 1. Clone
git clone https://github.com/issu321/algorithm-analyzer.git
cd algorithm-analyzer

# 2. Install Python dependencies manually
pip3 install matplotlib networkx numpy

# 3. Create required directories
mkdir graphs reports data

# 4. Run
python3 app.py

๐Ÿ“‹ Requirements

Requirement Version Why
Python 3.10+ Type hints, match-case, performance
matplotlib 3.7+ Graph visualization
networkx 3.1+ Graph data structures & layouts
numpy 1.24+ Numerical operations (optional)

๐Ÿ’ก No external libraries are required for the core algorithms. You can run BFS, DFS, Dijkstra, all searching, all sorting, and math tools using only Python's standard library. Install matplotlib + networkx only if you want the graph visualization feature (Option 14).


๐Ÿ“– Usage

๐ŸŽฏ First Time? Start Here.

When you launch the app, you'll see this main menu:

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘           ALGORITHM ANALYZER COMMAND CENTER v4.0                           โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘ [1]  Graph Operations        - Create, load, display graphs                โ•‘
โ•‘ [2]  BFS Traversal           - Breadth First Search                        โ•‘
โ•‘ [3]  DFS Traversal           - Depth First Search                          โ•‘
โ•‘ [4]  Shortest Path (Dijkstra)- Single source shortest path                 โ•‘
โ•‘ [5]  All Pairs Shortest Path - Floyd-Warshall algorithm                    โ•‘
โ•‘ [6]  Longest Path (DAG)      - Critical path analysis                      โ•‘
โ•‘ [7]  Minimum Spanning Tree   - Prim's & Kruskal's                        โ•‘
โ•‘ [8]  Bellman-Ford            - Negative weight handling                    โ•‘
โ•‘ [9]  Compare Graph Algos     - Performance comparison                      โ•‘
โ•‘ [10] Searching Algorithms    - Linear, Binary, Jump, etc.                  โ•‘
โ•‘ [11] Sorting Algorithms      - Bubble, Merge, Quick, etc.                โ•‘
โ•‘ [12] Math Calculator         - Advanced mathematical tools               โ•‘
โ•‘ [13] Complexity Reference    - Big-O notation guide                        โ•‘
โ•‘ [14] Visualize Graph         - Matplotlib/NetworkX plot                  โ•‘
โ•‘ [15] Benchmark Suite         - Speed benchmark tests                       โ•‘
โ•‘ [16] Speed Analysis          - Algorithm speed profiling                 โ•‘
โ•‘ [17] Save/Load Graph         - Persist graph to file                       โ•‘
โ•‘ [18] Generate Report         - Export analysis report                      โ•‘
โ•‘ [Q]  Quit                    - Exit application                            โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

How to navigate: Type the number and press Enter. It's that simple.


๐Ÿ“š Walkthrough 1: Create a Graph & Run BFS

Perfect for absolute beginners.

[USSU v4.0] Enter choice: 1        โ† Go to Graph Operations

[1] Create Random Graph
[2] Create Custom Graph
[3] Load Graph from File
[4] Display Current Graph
[5] Graph Properties
Select: 1                          โ† Choose Random Graph

Number of vertices: 6
Edge probability (0-1, default 0.3): 0.5
Directed? (y/n): n
Weighted? (y/n): y
โœ“ Random graph created!

[USSU v4.0] Enter choice: 2        โ† Go to BFS
Start vertex: 0
Target vertex (optional): 5
[+] Target 5 found!
[+] Path: 0 โ†’ 2 โ†’ 5
[+] Distance: 2 edges

๐Ÿ“š Walkthrough 2: Sort & Benchmark

See how fast each algorithm really is.

[USSU v4.0] Enter choice: 11       โ† Go to Sorting

[1]  Bubble Sort
[2]  Selection Sort
...
[12] Compare All Sorts
Select: 12

Array size for benchmark: 1000

Output:

Algorithm                Time (ms)    Time Comp.           Space        Stable
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Bubble Sort              42.1534      O(nยฒ)                O(1)         Yes
Selection Sort           15.2341      O(nยฒ)                O(1)         No
Insertion Sort           18.9012      O(nยฒ)                O(1)         Yes
Merge Sort               1.8234       O(n log n)           O(n)         Yes
Quick Sort               1.4521       O(n log n)           O(log n)     No
Heap Sort                2.1034       O(n log n)           O(1)         No
Shell Sort               2.8912       O(n logยฒ n)          O(1)         No

๐Ÿ“š Walkthrough 3: Search Algorithm Shootout

Find out which search wins.

[USSU v4.0] Enter choice: 10       โ† Go to Searching
Select: 9                            โ† Compare All Searches

Array size for benchmark: 5000

Output:

Size       Linear       Binary       Jump         Interp       Exp
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
100        0.0123       0.0012       0.0023       0.0015       0.0018
1000       0.1234       0.0015       0.0056       0.0018       0.0021
5000       0.6234       0.0018       0.0123       0.0021       0.0025

๐Ÿ† Binary Search wins every time on sorted data. But now you have proof.


๐Ÿ“š Walkthrough 4: Visualize Your Graph

Turn numbers into art.

[USSU v4.0] Enter choice: 14
[*] Generating visualization...
[+] Saved: graphs/graph_viz_1716023456.png

What you get: A dark-themed PNG with cyan nodes, purple edges, and yellow weight labels. Perfect for reports, presentations, or your GitHub portfolio.


๐ŸŽจ Features

๐Ÿ”ฅ What Makes This Different?

Feature Description
๐ŸŽจ Cyberpunk UI ANSI box-drawing panels, progress bars, neon cyan accents
โฑ๏ธ Live Profiling Every algorithm shows execution time (ms) + memory (KB)
๐Ÿ”ข Operation Counters See exact comparisons, swaps, array accesses, recursion depth
๐Ÿ“Š Benchmark Suite Compare all algorithms across multiple input sizes automatically
๐Ÿ–ผ๏ธ Graph Viz Export publication-ready graph images via Matplotlib
๐Ÿ“„ Report Export Save full session history to reports/ with timestamps
๐Ÿงฎ 20+ Algorithms Graph, Search, Sort, and Math โ€” all in one tool
๐Ÿ Zero-Bloat Core Runs without any external libraries for base functionality

โœจ Complete Algorithm List

Graph Algorithms

  • Traversal: BFS, DFS (Iterative)
  • Shortest Path: Dijkstra, Bellman-Ford, Floyd-Warshall
  • MST: Prim's (Priority Queue), Kruskal's (Union-Find)
  • DAG: Longest Path via Topological Sort

Searching Algorithms

  • Linear Search โ€” O(n)
  • Binary Search (Iterative & Recursive) โ€” O(log n)
  • Jump Search โ€” O(โˆšn)
  • Interpolation Search โ€” O(log log n) avg
  • Exponential Search โ€” O(log n)
  • Ternary Search โ€” O(logโ‚ƒ n)
  • Fibonacci Search โ€” O(log n)

Sorting Algorithms

  • Bubble Sort โ€” O(nยฒ) | Stable
  • Selection Sort โ€” O(nยฒ) | Unstable
  • Insertion Sort โ€” O(nยฒ) | Stable
  • Merge Sort โ€” O(n log n) | Stable
  • Quick Sort โ€” O(n log n) avg | Unstable
  • Heap Sort โ€” O(n log n) | Unstable
  • Shell Sort โ€” O(n logยฒ n) | Unstable
  • Cocktail Shaker Sort โ€” O(nยฒ) | Stable
  • Comb Sort โ€” O(nยฒ/2แต–) | Unstable
  • Counting Sort โ€” O(n+k) | Stable | Integers only
  • Radix Sort (LSD) โ€” O(d(n+k)) | Stable | Integers only

Math & Analysis Tools

  • Factorial, Fibonacci (3 methods), GCD (Euclidean)
  • Fast Exponentiation, Primality Test, Sieve of Eratosthenes
  • Matrix Multiplication (naive), Big-O Complexity Reference

๐Ÿ—๏ธ Project Structure

algorithm-analyzer/
โ”œโ”€โ”€ app.py                 โ† ๐Ÿš€ Main application (run this)
โ”œโ”€โ”€ install.bat            โ† ๐ŸชŸ Windows installer
โ”œโ”€โ”€ install.sh             โ† ๐Ÿง Linux/Kali installer
โ”œโ”€โ”€ requirements.txt       โ† ๐Ÿ“ฆ Python dependencies
โ”œโ”€โ”€ INPUTGUIDE.md          โ† ๐Ÿ“˜ Step-by-step input manual
โ”œโ”€โ”€ README.md              โ† ๐Ÿ“– You are here
โ”œโ”€โ”€ graphs/                โ† ๐Ÿ–ผ๏ธ Auto-generated visualizations
โ”œโ”€โ”€ reports/               โ† ๐Ÿ“„ Auto-generated analysis reports
โ””โ”€โ”€ data/                  โ† ๐Ÿ“ Your custom graph files

โšก Performance Benchmarks

Tested on Intel i7-12700H | Python 3.11 | All times in milliseconds

Input Size Bubble Sort Quick Sort Merge Sort Binary Search
100 0.8 ms 0.1 ms 0.2 ms 0.001 ms
1,000 45.2 ms 1.4 ms 2.1 ms 0.002 ms
10,000 4,200 ms 18.5 ms 24.3 ms 0.003 ms

๐Ÿ’ก Why Bubble Sort dies at 10K: O(nยฒ) = 100,000,000 operations. Quick Sort handles it in 18ms because O(n log n) = ~130,000 operations. This is why we benchmark.


๐Ÿ› ๏ธ Troubleshooting

โŒ Python is not installed

Windows: Download from python.org. Check "Add Python to PATH" during install.
Linux: sudo apt update && sudo apt install python3 python3-pip

โŒ pip is not recognized

Windows: python -m pip install ...
Linux: Use pip3 instead of pip

โŒ matplotlib/networkx not installed

pip install matplotlib networkx

๐Ÿ’ก The app still works without these โ€” you just can't use Option 14 (Visualize).

โŒ Colors look weird / broken

Use Windows Terminal or PowerShell instead of legacy CMD. Linux terminals work perfectly out of the box.

โŒ Please create a graph first

Options 2โ€“9 and 14 require a graph. Press 1 at the main menu, then 1 again to create a random graph.

โŒ Sorting benchmark shows INF

Bubble Sort and Insertion Sort are intentionally skipped for arrays > 1000 elements because O(nยฒ) would freeze your terminal. This is a feature, not a bug.

โŒ Recursive Fibonacci hangs

Never use recursive method for n > 30. It has O(2โฟ) complexity. Use iterative or memoization instead.


๐Ÿค Contributing

Contributions make the open-source community an amazing place to learn and create.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/UltraFeature)
  3. Commit your Changes (git commit -m 'Add some UltraFeature')
  4. Push to the Branch (git push origin feature/UltraFeature)
  5. Open a Pull Request

๐Ÿ“œ License

Distributed under the MIT License. See LICENSE for more information.


๐Ÿ‘ค Crafted by Ussu

Star โญ the repo if this helped you.
Fork it if you want to make it legendary.

About

ALGORITHM ANALYZER v4.0 Complete analysis of Graph Algorithms, Searching, Sorting, MST, Shortest Path Time Complexity | Space Complexity | ADA Analysis | Mathematical Tools Speed Benchmarking | Performance Profiling | Futuristic UI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors