Classical algorithms implemented in python