The DEFLATE algorithm is specified in RFC 1951. However, the encoder can choose freely whether to insert a literal byte, or a sub-match from output buffer for each input byte. Assuming that everything is encoded in a single block with dynamic Huffman compression, what is the time complexity to achieve the optimal compression ratio as allowed by the spec?
I fear it may not be polynomial, especially because Zopfli exists (and they don't claim to produce optimal result). However, I was unable to find any actual analysis or proof that confirms this.