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.
| 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.
- Python 3.x
- matplotlib
Install dependencies:
pip install matplotlibRun the script from the src/ directory:
cd src
python time_complexity_graph.pyYou 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
| 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 |