r/algorithms • u/emmynoether • 2d ago
Discussion Examples of galactic algorithms with large polynomial exponents
One of the common refrains here is that "P=NP might not have any practical effect if the algorithm found is galactic in terms of polynomial exponents I.e. O(n^1000)"
Do we have an example of a natural problem solvable in polynomial time, but with large exponents? More strongly, do we have any problem where the large exponent polynomial is proven optimal?
31
Upvotes
4
u/arnerob 1d ago
The new strongly polynomial time algorithm for linear programming by openAI has a complexity of at least O(N^60) (see section 6.6).
21
u/techy5000 2d ago
I think people are missing the point when it comes to galactic algorithms. It need not just be O(n^1000) or some insane exponent. An O(n) algorithm with a large constant that makes it slow on almost all feasible input sizes can also be considered galactic
An example of a galactic algorithm is Primality using the AKS primality test. Despite having an O((log n)^6) asymptotic complexity, the implicit constant factors are so large that it made it impractical to use for almost all testable integers. The deterministic Miller-Rabin algorithm (before GRH was proved last Friday) had exponential time complexity, but it still was the better algorithm to use for primality testing.
So, AKS primality is a classic example of a galactic algorithm that has a very appealing asymptotic time complexity (the exponent isn’t even that large) but is impractical compared to exponential-time algorithms for the same task (e.g., Miller-Rabin). It goes to show that, as complexity theorist Ryan Williams stated, we don’t understand polynomial time complexity well enough to even know what P=NP would signify without actually taking a look at the polytime reduction from 3SAT to the polynomial-time algorithm (there might be other ways to prove P=NP beyond this, but this is the method I know)
5
u/ConjectureProof 2d ago
Keep in mind that you can also have galactic constants of proportionality. You can multiply numbers in O(n ln(n)) but the big O notation obscures an absurdly large constant.
11
u/tstanisl 2d ago
Actually, the matrix multiplication with recently proven complexity O(n2.25) or O(N1.125) where N is actual size of inputs is the first problem I know about that has polynomial superlinear lower bound.
3
u/Shoddy-Childhood-511 1d ago
You forgot that P=NP could be non-constructive.
As an example, any minor closed property of graphs has an O(n3) algorithm, by the Robertson–Seymour graph minor theorem. You define the algorithm by finding all the minor minimal counter examples, not unlike graph planarity being characterized by having no K_{3,3} or K_5 minor.
You might not have any way to find all minor minimal counter examples though, nor any other algorithm, or the list could be arbitrarily large.
Anyways we've this VP != VNP result now, which tells us nothing about N vs NP, but suggests P != NP, so that's good I guess.
3
u/InternetMandate 2d ago
I think two things tend to get overlooked in these discussions. First, even if someone found an O(n) algorithm for 3-SAT, that might only yield an O(n⁷) algorithm for another problem because of the complexity of the reduction itself. Polynomial-time reductions don't necessarily preserve reasonable computational complexity.
Second, I think people conflate polynomial-time solvability with practical tractability. In many areas of computing, even an O(n²) algorithm isn't considered particularly scalable. People are often aiming for linear or near-linear complexity. You don't need anything remotely approaching O(n¹⁰⁰⁰) for a polynomial-time algorithm to be practically useless.
On a somewhat separate note, we know remarkably few nontrivial time complexity lower bounds for natural problems in general computational models. Much of the progress on computational lower bounds has been in restricted models of computation, particularly restricted classes of circuits. This is part of why P vs. NP seems so far out of reach.
1
u/Jaysos23 2d ago
May not be galactic, but determining whether a graph is perfect is something like O(n7 ) ,not very practical. Similarly for coloring them.
1
u/Fit-Jump-5078 2d ago
Similar to what you ask for: Reachability in undirected graphs is in LogSpace, but the best known algorithm has a huge constant in the O(log(n)).
1
u/Parallel_thougts 2d ago
Pretty much all matrix multiplication algorithm that are asymptotically better than Strassen. E.g. Coppersmith-Winograd.
1
u/trbot 1d ago
Multiplication of two n bit numbers in n log n time is faster than the n2 algorithm only when n is around 214000 IIRC.
1
u/ccppurcell 2d ago
The reason P=NP (even a clean and nice proof of it) doesn't have any effect is that it is fundamentally a question of worst case complexity. Worst case complexity is a beautiful topic, to which I've devoted a good deal of my adult life. We study it because it is clean to formulate and we gain a lot of insight from thinking about it. Over the years, it has a huge influence on algorithm design and other areas of mathematics and computer science. But at the end of the day the real world doesn't care about the worst case.
The inputs we deal with in the real world are not clean, they are not fixed, and the best techniques for solving them are going to involve subjective, messy understanding of the context which cannot be defined in lean.