Algorithms and complexity