Algorithms in Complex Environments