In computational complexity theory, the class NC (for "Nick's Class") is the set of decision problems decidable in polylogarithmic time on a parallel computer with a polynomial number of processors. In other words, a problem with input size n is in NC if there exist constants c and k such that it can be solved in time using parallel processors. Stephen Cook coined the name "Nick's class" after Nick Pippenger, who had done extensive research on circuits with polylogarithmic depth and polynomial size. As in the case of circuit complexity theory, usually the class has an extra constraint that the circuit family must be uniform (see below).

Just as the class P can be thought of as the tractable problems (Cobham's thesis), so NC can be thought of as the problems that can be efficiently solved on a parallel computer. NC is a subset of P because polylogarithmic parallel computations can be simulated by polynomial-time sequential ones. It is unknown whether NC = P, but most researchers suspect this to be false, meaning that there are probably some tractable problems that are "inherently sequential" and cannot significantly be sped up by using parallelism. Just as the class NP-complete can be thought of as "probably intractable", so the class P-complete, when using NC reductions, can be thought of as "probably not parallelizable" or "probably inherently sequential".

The parallel computer in the definition can be assumed to be a parallel, random-access machine (PRAM). That is a parallel computer with a central pool of memory, and any processor can access any bit of memory in constant time. The definition of NC is not affected by the choice of how the PRAM handles simultaneous access to a single bit by more than one processor. It can be CRCW, CREW, or EREW. See PRAM for descriptions of those models.

Equivalently, NC can be defined as those decision problems decidable by a uniform Boolean circuit (which can be calculated from the length of the input, for NC, we suppose we can compute the Boolean circuit of size n in logarithmic space in n) with polylogarithmic depth and a polynomial number of gates with a maximum fan-in of 2.

RNC is a class extending NC with access to randomness.

Problems in NC

As with P, by a slight abuse of language, one might classify function problems and search problems as being in NC. NC is known to include many problems, including

  • Integer addition, multiplication and division;
  • Matrix multiplication, determinant, inverse, rank;
  • Polynomial GCD, by a reduction to linear algebra using Sylvester matrix
  • Finding a maximal matching.

Often algorithms for those problems had to be separately invented and could not be naïvely adapted from well-known algorithms – Gaussian elimination and Euclidean algorithm rely on operations performed in sequence. One might contrast ripple carry adder with a carry-lookahead adder.

Example

An example of problem in NC<sup>1</sup> is the parity check on a bit string. The problem consists in counting the number of 1s in a string made of 1 and 0. A simple solution consists in summing all the string's bits. Since addition is associative, <math display="block">x_1 + \cdots + x_n = \left(x_1 + \cdots + x_{\frac{n}{2\right) + \left(x_{\frac{n}{2} + 1} + \cdots + x_n\right).</math> Recursively applying such property, it is possible to build a binary tree of length <math>O(\log(n))</math> in which every sum between two bits <math>x_i</math> and <math>x_j</math> is expressible by means of basic logical operators, e.g. through the Boolean expression <math>(x_i \land \neg x_j) \lor (\neg x_i \land x_j)</math>.

The NC hierarchy

NC<sup>i</sup> is the class of decision problems decidable by uniform Boolean circuits with a polynomial number of gates of at most two inputs and depth , or the class of decision problems solvable in time O((log n)<sup>i</sup>) on a parallel computer with a polynomial number of processors. Clearly,

:<math>\mathsf{NC}^0 \subseteq \mathsf{NC}^1 \subseteq \cdots \subseteq \mathsf{NC}^i \subseteq \cdots \subseteq \mathsf{NC}</math>

which forms the NC-hierarchy.

The smallest class, NC<sup>0</sup>, is the class of functions definable by Boolean circuits with constant depth and bounded fan-in.

The next-smallest class, NC<sup>1</sup>, is equal to BW<sub>4</sub><sup>0</sup> , the set of all problems solvable by polynomial-size, bounded fan-in circuits of width 4 or less. This is true for both the uniform and nonuniform case (DLOGTIME-uniformity suffices). NL, LOGCFL, and AC.

:<math> \mathsf{NC}^1 \subseteq \mathsf{L} = \mathsf{SL} \subseteq \mathsf{NL} \subseteq \mathsf{LOGCFL} \subseteq \mathsf{AC}^1 \subseteq \mathsf{NC}^2.</math>

The NC classes are related to the AC classes, which are defined similarly, but with gates having unbounded fan-in. For each i,

:<math>\mathsf{NC}^i \subseteq \mathsf{AC}^i \subseteq \mathsf{AC}^{i}[p] \subseteq \mathsf{ACC}^{i}\subseteq \mathsf{TC}^{i} \subseteq \mathsf{NC}^{i+1}</math>

As an immediate consequence of this, NC = AC.

Also, <math>\mathsf{NC}^0 \subsetneq \mathsf{AC}^0 \subsetneq \mathsf{ACC}^{0}</math>.

It is a major open question whether <math>\mathsf{TC}^{0} \subsetneq \mathsf{NC}^{1}</math> . A significant partial result states that if there exists some <math>\epsilon > 0</math>, and a problem in <math>\mathsf{NC}^{1}</math>, such that it requires at least <math>\Omega(n^{1+\epsilon}) </math> gates in <math>\mathsf{TC}^{0}</math>, then this can be bootstrapped so that it requires superpolynomial gates, and thus not in <math>\mathsf{TC}^{0}</math>.

Uniformity

There are various levels of uniformity being considered. A family of Boolean circuits is uniform if the schematics for any member of the family can be produced by a Turing machine under various resource constraints. With different levels of constraints, we would obtain possibly different complexity classes, with a more stringent constraint leading to a possibly smaller complexity class.

In the literature, the following uniformities have been considered for the NC<sup>1</sup> class, arranged according to strength:

  • NC<sup>1</sup> itself. This is also called the <math>U_{E^*}</math>-uniformity. It is equivalent to ALOGTIME.
  • LOGSPACE.
  • P.
  • Computable. Any halting Turing machine is allowed.
  • Non-uniform. This is the strongest case. The Boolean circuit family may contain arbitrary elements of the correct width and depth, even if the family cannot be generated by any algorithm.

By default, the literature uses LOGSPACE uniformity.

Because it is possible that <math>\mathsf{NC}^1 \subsetneq \mathsf{LOGSPACE}</math>, researchers may use NC<sup>1</sup>-uniformity, since it is a possible strengthening. To avoid self-reference, NC<sup>1</sup>-uniform NC<sup>1</sup> is defined as follows: A NC<sup>1</sup> Boolean circuit family is NC<sup>1</sup>-uniform if the set of descriptions is decided by an ALOGTIME alternating Turing machine. The machine reads in a length-<math>n</math> description of a Boolean circuit, and halts in time <math>O(\log n)</math>.

Barrington's theorem says that BWBP is exactly nonuniform NC<sup>1</sup>. The proof uses the nonsolvability of the symmetric group S<sub>5</sub>.