complexity computation