ADA-Python / README.md
ussu321's picture
Upload 50 files
bd86de0 verified
|
Raw
History Blame Contribute Delete
10.7 kB
metadata
title: USSU Algorithm Analyzer v4.0
emoji: 
colorFrom: blue
colorTo: purple
sdk: docker
app_port: 7860

Python Flask Platform License Stars

⚡ The most advanced algorithm analysis suite ever built — now with immersive Flask UI.
Graph Theory · Searching · Sorting · DP · Greedy · Backtracking · ADA · Speed Benchmarking · Futuristic Cyberpunk 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 web 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.


✨ Feature Matrix

Category Algorithms Complexity Tracking Speed Profile Visualization
Graph Traversal BFS, DFS (Iter & Rec)
Shortest Path Dijkstra, Bellman-Ford, Floyd-Warshall, A*
MST Prim's, Kruskal's (Union-Find)
DAG Analysis Longest Path, Topological Sort (Kahn)
SCC Kosaraju's Algorithm
Searching Linear, Binary, Jump, Interpolation, Exponential, Ternary, Fibonacci
Sorting Bubble, Selection, Insertion, Merge, Quick, Heap, Shell, Cocktail, Comb, Counting, Radix, Bucket, Timsort
Dynamic Programming 0/1 Knapsack, Unbounded Knapsack, LCS, Edit Distance, Matrix Chain, Coin Change, LIS
Greedy Activity Selection, Fractional Knapsack, Huffman Coding, Job Sequencing, Min Coins
Backtracking N-Queens, Sudoku, Subset Sum, Graph Coloring, Hamiltonian Cycle
Math Tools Factorial, Fibonacci, GCD, Extended GCD, Primes, Sieve, Matrix Multiply, Fast Power, Modular Power, Tower of Hanoi, Permutations
ADA Theory Master Theorem, Amortized Analysis, NP-Completeness, Asymptotic Notation, Paradigm Comparison
Benchmarks Cross-size performance suites with statistical profiling

🎨 UI Philosophy

Designed with the 50-30-20 Futuristic Color Rule:

  • 50% Deep Slate (#0f172a, #1e293b) — Primary backgrounds
  • 30% Charcoal Gray (#334155, #475569) — Secondary elements
  • 20% Vibrant Cyan (#06b6d4, #22d3ee) — Accents and highlights

Custom Orbitron and Rajdhani fonts create a cyberpunk terminal aesthetic. Every metric card glows with subtle box-shadows. All plots use dark themes with neon color palettes.


🚀 Quick Start

Linux / Kali / macOS

git clone https://github.com/issu321/algorithm-analyzer.git
cd algorithm-analyzer
chmod +x install.sh start.sh
./install.sh
./start.sh

Windows 11

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

Manual (any platform)

pip install -r requirements.txt
python app.py

Then open http://localhost:5000 in your browser.


📁 Project Structure

ussu-algorithm-analyzer-v4/
├── app.py                    # Main entrypoint (st.navigation)
├── requirements.txt          # Dependencies
├── install.sh                # Linux/Kali installer
├── start.sh                  # Linux/Kali startup (venv-safe)
├── start.bat                 # Windows startup
├── static/
│   ├── css/                  # Stylesheets
│   └── js/                   # JavaScript
├── utils/
│   ├── core.py               # Graph, Colors, profiling decorators
│   ├── ui.py                 # Flask UI components
│   └── viz.py                # Matplotlib cyberpunk plots
├── algorithms/
│   ├── search.py             # 8 searching algorithms
│   ├── sort.py               # 13 sorting algorithms
│   ├── graph.py              # 10 graph algorithms
│   ├── dp.py                 # 7 dynamic programming algorithms
│   ├── greedy.py             # 5 greedy algorithms
│   ├── backtrack.py          # 5 backtracking algorithms
│   ├── math_tools.py         # 12 mathematical utilities
│   ├── ada.py                # ADA theory tools
│   └── benchmark.py          # Benchmark & profiling suite
└── pages/
    ├── home.html             # Dashboard & feature overview
    ├── graph.html            # Interactive graph algorithms
    ├── search.html           # Searching with benchmarks
    ├── sort.html             # Sorting with step viz
    ├── dp.html               # DP with table visualization
    ├── greedy.html           # Greedy algorithms
    ├── backtrack.html        # Backtracking with visual puzzles
    ├── ada.html              # Master theorem, NP theory
    ├── math.html             # Math calculator
    ├── benchmark.html        # Cross-size benchmarks
    └── compare.html          # Head-to-head comparisons

🔧 System Requirements

Requirement Minimum Recommended
Python 3.10 3.12+
RAM 2 GB 4 GB
OS Any Kali Linux / Windows 11
Browser Chrome 100+ Latest Chrome/Firefox

🛡️ Kali Linux Compatibility

The start.sh script is specifically designed to handle non-interactive shell environments where source venv/bin/activate fails to update PATH:

# Uses full path to venv python or falls back to python -m streamlit
if [ -f "$VENV_STREAMLIT" ]; then
    STREAMLIT_CMD="$VENV_STREAMLIT"
elif [ -f "$VENV_PYTHON" ]; then
    STREAMLIT_CMD="$VENV_PYTHON -m streamlit"
else
    STREAMLIT_CMD="python3 -m streamlit"
fi

This fixes the classic "streamlit: command not found" error on Kali.


📊 Performance Profiling

Every algorithm execution captures:

  • Execution Time (ms) via time.perf_counter()
  • Memory Usage (KB) via tracemalloc
  • Operation Counters: comparisons, swaps, array accesses, recursions, iterations
  • Algorithm Metrics: time complexity, space complexity, stability

Benchmark suite supports:

  • Cross-size scaling analysis
  • Statistical profiling (min, max, mean, median, std dev)
  • Custom algorithm profiling with configurable warmup and trials
  • Distribution histograms

🧪 Testing

Run a quick smoke test:

python -c "from algorithms.search import SearchingAlgorithms; s = SearchingAlgorithms(); print(s.binary_search_iterative([1,2,3,4,5], 3))"
python -c "from algorithms.sort import SortingAlgorithms; s = SortingAlgorithms(); print(s.merge_sort([3,1,4,1,5,9,2,6]))"
python -c "from algorithms.graph import GraphAlgorithms; from utils.core import Graph; g = Graph.from_random(5, 0.5); ga = GraphAlgorithms(); print(ga.bfs(g, 0))"

🤝 Contributing

Contributions welcome! Fork the repo, create a feature branch, and submit a PR.

  1. Fork it (https://github.com/issu321/algorithm-analyzer/fork)
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -am 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request


🚀 Deploy to Hugging Face Spaces (One-Click)

This project is Docker-ready for Hugging Face Spaces. No configuration needed.

Option 1: Create Space from GitHub

  1. Go to huggingface.co/spaces/new
  2. Select Docker as SDK
  3. Set app_port: 7860
  4. Link your GitHub repo: github.com/issu321/Analysis-of-Algorithms
  5. Click Create Space — it builds automatically

Option 2: Push directly to HF

# Install huggingface-cli if you haven't
pip install huggingface-hub

# Login
huggingface-cli login

# Create a new Docker Space
git clone https://huggingface.co/spaces/YOUR_USERNAME/ussu-algorithm-analyzer
cd ussu-algorithm-analyzer

# Copy all project files here
cp -r /path/to/ussu-algorithm-analyzer-flask/* .

# Push
git add .
git commit -m "Deploy v4.0 Flask Edition"
git push

What happens next?

  • Hugging Face builds the Docker image automatically
  • Build logs appear in the Files → Logs tab
  • Once status shows Running, your app is live at: https://your-username-ussu-algorithm-analyzer.hf.space/

Files included for HF deployment:

File Purpose
Dockerfile HF Spaces Docker image with Python 3.11, system deps, UID 1000 user
requirements.txt Flask, numpy, matplotlib, networkx
app.py Entry point on port 7860
.dockerignore Excludes cache, venv, git from image
.gitattributes LF line endings for cross-platform

📜 License

MIT License — see LICENSE file.


Built with ❤️ by Ussu

Kali Linux Compatible | Windows 11 Ready | Python 3.13 Ready