Polynomial Time

Polynomial Time

Polynomial time describes how fast an algorithm's running time grows as the input size increases: the computational effort grows at most as fast as a power of the input size. In computer science, this is the most important boundary between problems that computers can solve in practice and those that remain computationally intractable.

In computer science, it’s not just about whether a program can solve a problem — but how long it takes to do so. This isn’t measured in seconds, but in steps: how many computational operations are needed as the input grows larger? Polynomial time means: if the input has n elements, the effort grows at most as fast as n², n³, or some other fixed power of n. Problems with this property are considered manageable. If the effort instead grows exponentially — that is, like 2^n — then even the fastest computer fails at moderate input sizes.

The decisive dividing line in algorithmics

Polynomial time is not a technical detail — it is the most important dividing line in all of theoretical computer science. The class of all problems solvable in polynomial time is called P. Many central everyday tasks lie in P: sorting a list, calculating the shortest route in a navigation system, searching a text. All of this remains fast enough for practical use even with large amounts of data.

In contrast, there are problems for which no polynomial-time algorithm is known so far. The most famous example: the traveling salesman problem. Here, a delivery van must visit n cities exactly once while finding the shortest route. The number of possible routes explodes so quickly as n grows that no computer in the world can solve it exactly once n becomes large enough. Whether such problems can fundamentally never have a polynomial-time solution is the most open question in computer science — known as the P versus NP problem. Whoever solves it wins a million dollars from the Clay Mathematics Institute.

What’s behind the term

A polynomial is a mathematical expression of the form n^k, that is, n raised to some fixed number k. When k = 1, the effort grows linearly: twice as much data, twice as much work. When k = 2, it grows quadratically: twice as much data, four times as much work. That sounds like a lot — but it’s harmless compared to 2^n. If n = 100, n² equals exactly 10,000. But 2^100 is a number with thirty digits. No computer in the world could ever execute that many steps.

Important: polynomial time says nothing about whether an algorithm is fast enough for everyday practical use. An algorithm with n^100 steps technically lies within polynomial time, yet is still useless. The class P thus functions as a theoretical rule of thumb, not as a guarantee of practical speed. In practice, only algorithms with small exponents — that is, k ≤ 3 or 4 — are truly usable.

Polynomial time in AI, cryptography, and practice

In cryptography — the science of encryption — polynomial time is directly relevant to security. Many encryption methods rely on the fact that certain problems, such as factoring very large numbers into their prime factors, lie outside polynomial time. An attacker would need exponentially many steps, which is practically infinite. If quantum computers ever become capable of solving such problems in polynomial time after all, this would break many of today’s security systems.

In AI research, the term comes up when discussing the trainability of models. Training neural networks is, in practice, polynomial — it scales manageably with the amount of data and model size. This is one of the reasons AI is possible at large scale at all. Some optimization problems in the AI context, however, are NP-hard, meaning presumably outside of P. In those cases, one falls back on approximation methods that don’t find the optimal solution but a good one — and do so in polynomial time.

In news articles, polynomial time often appears in connection with quantum computing, cryptography standards, or complexity theory. When it’s said that a new quantum algorithm solves a problem “in polynomial time,” it means: it fundamentally beats all known classical methods — not just somewhat faster, but in a different efficiency class altogether.

Subscribe free. Unsubscribe the second it sucks.

High-signal news across AI, business, UX, and tech. Every morning.