Skip to content

kevinthelago/python-time-complexity-graph-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python Time Complexity Graph Generator

A CLI tool that generates visual graphs of common algorithmic time complexities using matplotlib. Outputs publication-ready SVG files in both dark and light themes.

Graphs Generated

Graph Complexities Shown
Polynomial O(1), O(log n), O(n), O(n log n), O(n²)
Exponential O(2ⁿ), O(n!)
Full All of the above combined

Each graph is saved as an SVG in both dark and light variants, for a total of six output files.

Examples

Polynomial Time Complexity (Dark)

Polynomial Time Complexity Dark

Full Time Complexity (Dark)

Full Time Complexity Dark

Requirements

  • Python 3.x
  • matplotlib

Install dependencies:

pip install matplotlib

Usage

Run the script from the src/ directory:

cd src
python time_complexity_graph.py

You will be prompted to enter a graph resolution (max 100). Higher values produce smoother curves. The script then generates and saves all six SVG files in the current directory.

Input Graph Resolution: 50

Output Files

File Theme
polynomial_time_complexity_graph_dark.svg Dark
polynomial_time_complexity_graph_light.svg Light
exponential_time_complexity_graph_dark.svg Dark
exponential_time_complexity_graph_light.svg Light
full_time_complexity_graph_dark.svg Dark
full_time_complexity_graph_light.svg Light

About

CLI tool that generates SVG graphs of common algorithmic time complexities using matplotlib, with dark and light themes

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages