1

I don't understand why GCD is not Strongly Polynomial Time?

Can you explain in an example, why the storage size cannot be Polynomial Bounded?

So is GCD in the Complexity Class P?

user12262
  • 79
  • 7
testy
  • 229
  • 1
  • 2
  • 4

2 Answers2

4

As Wikipedia mentions, the reason that the Euclidean algorithm for GCD doesn't run in strongly polynomial time is that the number of arithmetic operations is unbounded, although there are always only two inputs. On the other hand, the running time is polynomial in the input size, and so the Euclidean algorithm runs in polynomial time. In particular, GCD is in FP (the class of functions computable in polynomial time).

Yuval Filmus
  • 280,205
  • 27
  • 317
  • 514
3

The GCD can be computed in polynomial time. Strongly Polynomial is a much more restrictive classification. Taking the definition from here:

An algorithm runs in strongly polynomial time if

  • the number of operations in the arithmetic model of computation is bounded by a polynomial in the number of integers in the input instance; and

  • the space used by the algorithm is bounded by a polynomial in the size of the input.

The input to GCD is two integers. Thus, in order to be solvable in strongly polynomial time, GCD would need to be solvable with a constant number of aritmethic operations since the input size is constant.

Tom van der Zanden
  • 13,493
  • 1
  • 39
  • 56