ArticleslgStudy

engineering

CC (complexity)

CC (complexity) is a engineering topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand CC (complexity) rather than just read about it. In short: In computational complexity theory, CC (Comparator Circuits) is the complexity class containing decision problems which can be solved by comparator circuits of polynomial size. Comparator circuits are sorting networks in which each comparator gate is directed, each wire is initialized with an input variable, its negation, or a constant, and one of the wires is distinguished as the output wire.

CC (complexity) — main illustration
CC (complexity) — illustration

Key takeaways

  • CC (complexity) belongs to engineering; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect CC (complexity) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of CC (complexity) from memory before moving on to harder problems.

Reference excerpt

In computational complexity theory, CC (Comparator Circuits) is the complexity class containing decision problems which can be solved by comparator circuits of polynomial size. Comparator circuits are sorting networks in which each comparator gate is directed, each wire is initialized with an input variable, its negation, or a constant, and one of the wires is distinguished as the output wire. The most important problem which is complete for CC is a decision variant of the stable marriage problem.

Definition

A comparator circuit is a network of wires and gates. Each comparator gate, which is a directed edge connecting two wires, takes its two inputs and outputs them in sorted order (the larger value ending up in the wire the edge is pointing to). The input to any wire can be either a variable, its negation, or a constant. One of the wires is designated as the output wire. The function computed by the circuit is evaluated by initializing the wires according to the input variables, executing the comparator gates in order, and outputting the value carried by the output wire. The comparator circuit value problem (CCVP) is the problem of evaluating a comparator circuit given an encoding of the circuit and the input to the circuit. The complexity class CC is defined as the class of problems logspace reducible to CCVP. An equivalent definition is the class of problems AC0 reducible to CCVP. As an example, a sorting network can be used to compute majority by designating the middle wire as an output wire:

If the middle wire is designated as output, and the wires are annotated with 16 different input variables, then the resulting comparator circuit computes majority. Since there are sorting networks which can be constructed in AC0, this shows that the majority function is in CC.

CC-complete problems A problem in CC is CC-complete if every problem in CC can be reduced to it using a logspace reduction. The comparator circuit value problem (CCVP) is CC-complete. In the stable marriage problem, there is an equal number of men and women. Each person ranks all members of the opposite sex. A matching between men and women is stable if there are no unpaired man and woman who prefer each other over their current partners. A stable matching always exists. Among the stable matchings, there is one in which each woman gets the best man that she ever gets in any stable matching; this is known as the woman-optimal stable matching. The decision version of the stable matching problem is, given the rankings of all men and women, whether a given man and a given woman are matched in the woman-optimal stable matching. Although the classical Gale–Shapley algorithm cannot be implemented as a comparator circuit, Subramanian came up with a different algorithm showing that the problem is in CC. The problem is also CC-complete. Another problem which is CC-complete is lexicographically-first maximal matching. In this problem, we are given a bipartite graph with an order on the vertices, and an edge. The lexicographically-first maximal matching is obtained by successively matching vertices from the first bipartition to the minimal available vertices from the second bipartition. The problem asks whether the given edge belongs to this matching. Scott Aaronson showed that the pebbles model is CC-complete. In this problem, we are given a starting number of pebbles (encoded in unary) and a description of a program which may contain only two types of instructions: combine two piles of sizes y and z to get a new pile of size y+z, or split a pile of size y into piles of size ⌈y/2⌉ and ⌊y/2⌋. The problem is to decide whether any pebbles are present in a particular pile after executing the program. He used this to show that the problem of deciding whether any balls reach a designated sink vertex in a Digi-Comp II-like device is also CC-complete.

Containments The comparator circuit evaluation problem can be solved in polynomial time, and so CC is contained in P ("circuit universality"). On the other hand, comparator circuits can solve directed reachability, and so CC contains NL. There is a relativized world in which CC and NC are incomparable, and so both containments are strict.

References

External links Complexity Zoo: CC

Illustrations

CC (complexity) illustration

Worked examples

Example 1 — a first encounter with CC (complexity)

Start with the simplest possible case. Write down what CC (complexity) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In engineering, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to CC (complexity) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about CC (complexity) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of CC (complexity)

In research
CC (complexity) appears in engineering research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses CC (complexity) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
CC (complexity) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Circuit complexity, Complexity classes, so understanding it makes those chapters shorter.
In everyday life
Look for CC (complexity) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “CC (complexity)” →

How to study CC (complexity) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what CC (complexity) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain CC (complexity) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is CC (complexity) in simple terms?

In computational complexity theory, CC (Comparator Circuits) is the complexity class containing decision problems which can be solved by comparator circuits of polynomial size. Comparator circuits are sorting networks in which each comparator gate is directed, each wire is initialized with an input…

Why does CC (complexity) matter?

Because it connects several engineering ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study CC (complexity)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on CC (complexity).

Tags

  • Circuit complexity
  • Complexity classes

Keep exploring