Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (
Help us improve Python packaging - Donate today!

A program complexity estimator

Project Description

version number: 0.0.6 author: Łukasz Kaźmierczak


A simple python library which can be used to empirically estimate program’s time complexity.

Installation / Usage

To install use pip:

$ pip3 install git+

Or clone the repo:

$ git clone $ python install


The first usage scenarion - implementing the abstract Program class.

from complex.program import Program

class TestProgram(Program):

def initialize(self, problem_size):
self.numbers = [randint(1, 10000) for _ in range(problem_size)]
def code(self):
_ = [i + 1 for i in self.numbers]
def clean_up(self):


from complex.calculator import ComplexityCalculator

program = TestProgram() calculator = ComplexityCalculator(program, retry_count=5)

In order to get program’s time complexity:

complexity, timeout_occurred = calculator.get_complexity()

In order to estimate execution time for the given problem size:

time = calculator.estimate_time(problem_size = 10000)

In order to estimate maximal problem size for the given time:

problem_size = calculator.estimate_max_size_for_time(requested_time = 5)
Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
complex-0.0.6.tar.gz (4.7 kB) Copy SHA256 Checksum SHA256 Source May 8, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting