**Boolean circuits**

This post (in a few parts) contains a quick introduction to Boolean circuits. It is related to the recent news post about the solution of Braverman to the Linial-Nisan conjecture. In particular, we will describe very quickly a formulation of the problem and discuss some issues about bounded depth circuits. I hope that this gives a nice introduction to this area for non-experts (written also by a non-expert). Any comments and corrections (especially from experts!) are welcome. I want to mention, in particular, a result by Benjamin Rossman about finding cliques in graphs for bounded depth circuits that I found exciting.

## A. Boolean functions, Boolean circuits and the NP versus P problem.

### 1. Boolean functions

A Boolean function of n variables is simply a function where the variables take the values +1 and -1 and the value of itself is also either +1 and -1.

### 2. Boolean circuits

A Boolean circuit is a gadget that computes Boolean functions. It is built from **inputs**, **gates** and an **output. **We can think about these circuits as follows: On level 0 there are the variables. On level 1 there are gates acting on the variables. On level 2 there are gates acting on the outputs of the gates on level 1. And in level is a single gate leading to the output of the circuit. The **depth** of the circuit is this number . The **size** of the circuit is the total number of gates. The gates perform Boolean operations: They can take an input bit and negate it. They can take several input bits and take their OR – this means that the output will be ’1′ iff one of them is ’1′. They can take several input bits and take their AND – this means that the output will be ‘-1′ iff one of them is ‘-1′.

### 3. the problem

Consider a graph on vertices. The question “Does have a Hamiltonian cycle?” (a Hamiltonian cycle is a simple cycle containing all the vertices of the graph) is known to be “NP complete”.

Now, suppose that and associate to every edge of the complete graph on vertices a variable .

Every graph corresponds to an assignment of Boolean values to the variables. This correspondence is crucial here and in various other places: the variables associated to the edges of the graph get value ´1´and the variables associated to edges not in the graph get value ´-1´.

The property of graphs on vertices to be Hamiltonian is described by the following Boolean function on variables. Every assigenment of values to the variables corresponds to a graph , and the value of is 1 if and only if the graph contains a Hamiltonian cycle.

To prove that just prove that

cannot be described by a Boolean circuit of size which is bounded above by a polynomial in .

Is it really the famous problem, you may ask? Well, what we have stated here is a little bit **stronger**. So if you prove that the Boolean functions representing the graph property “To contain a Hamiltonian cycle” cannot be described by a polynomial size circuit you will prove that and you will have a little change to spare!

(The assertion that there is no polynomial time algorithm for deciding if a graph with vertices is Hamiltonian is equivalent to the problem. In the setting of circuits, we talk about the size of the circuit as a substitute to the notion of running time of an algorithm.)

### 4. A little more on . What is NP?

The previous paragraph tells you a formulation of the problem. So you can go ahead and solve it and not worry too much about this paragraph. But the previous paragraph does not tell a few important aspects of the problems and I will mention one aspect now. NP stands for “non-deterministically polynomial” (and not for “not-polynomial” as I thought in my early youth). What does it mean?

The Wikipedea explanation is “a problem is NP as long as a given solution can be verified as correct in polynomial time”. In the world of circuits we have the following description:

Suppose you want to express the property that a graph has a Hamiltonian cycle in the following way:

You have a Boolean circuit with variables. The variables correspond to the edges of the complete graph as before. The variables are new variables and we assume that is bounded from above by a polynomial function of . Now we want to describe the property “The graph G is Hamiltonian” by a polynomial size circuit in these variables as follows: If we start with a Hamiltonian graph, we can find an assignment to the variables such that the output of the circuit will be 1. If we start with a non-Hamiltonian graph for every assignment of values to the variables the output of the circuit will be -1.

Now come the crucial observation: We can do it! We can find a circuit with this property. As before, we let be variables representing the edges of the complete graph with the understanding that if and only if the th edge is present in our graph . , But now we take more variables again representing all possible edges of the complete graph. The s which equal to 1 are supposed to correspond to edges of a Hamiltonian cycle in our graph . So now our circuit in the s and the s will represent the property that the graph represented by the s is a Hamiltonian subgraph of the graph represented by the s. This can easily be done. This is (more or less) what is meant by saying that the property “to be Hamiltonian” is in NP.

So to say that the graph property “G contains a Hamiltonian cycle” is in NP roughly means that it is possible to** prove** (or to verify) using a polynomial time algorithm or using a polynomial-size circuit that the graph has a Hamiltonian cycle. The proof consists of presenting a Hamiltonian cycle in the graph. (Again, the circuit notion and the polynomial-time notions are not exactly the same, but let´s ignore it.)

The property “**The graph does not have a Hamiltonian cycle**” is not known to be in NP and indeed is believed not to be in NP.

**5. But what is so special about Hamiltonian cycles.**

The remarkable thing about the Hamiltonian cycle property is that it is a **complete** problem in NP. A polynomial time algorithm for deciding if a graph is Hamiltonian will give a polynomial algorithm for every problem in NP. (In other words, any problem in NP can be reduced to the problem of deciding if a graph has a Hamiltonian cycle.) There are many, many problems with the remarkable property that they are complete in NP, so there is nothing very special about the problem we have chosen.

### 6. Reductions

If somebody asks you to describe in one word what theoretical computer science is about, a good word to choose is “reductions”. The art of reductions, the science of reductions, the practice and engineering of reductions, and the philosophy of reductions.

### 7. More general circuits.

We can talk about various other circuits. We can have more sophisticated gates and not just Boolean gates. We can let the variables be real numbers, or elements in some other field, and talk about algebraic gates and algebraic circuits, etc.

### 8. Asymptotically speaking

The notions we have described are asymptotic. We consider a problem (like the graph property of containing a Hamiltonian cycle) and we study its computational complexity when the number of variables goes to infinity.

## B. Bounded depth circuits

Bounded depth circuits are circuits where the number of levels (the depth) is bounded by a constant. We try to understand the computational power of circuits where is bounded, the number of variables goes to infinity, and the number of overall gates is polynomial in . Much can be said about the computational power of bounded depth circuits. Beyond this class things are much harder.

Bounded depth circuits are also fascinating mathematical objects. ** —to be continued—**

Hi Gil,

I look forward to your take on Rossman’s proof. (He has a shorter, informal version of the proof on his homepage which I think I understand.)

Thanks.

Dear Aravind, I will look at the homepage. I dont promise to explain Rossman’s proof (would you?) but I will explain that I was surprised to learn (and this may also refer to an old reasult by Paul Beam that I did not know) that the Hastad switching lemma is capable to distinguish between polynomial size bounded depth circuits and quasi polynomial size bounded (even larger) depth circuits. (This may have been clear to experts but I did not know of it and I still don’t know it.)

(Two remarks after talking with Avi)

I tried to give in the post a very clear and simple mathematical statement which describes the problem. (Or in fact a “slightly” stronger statement.) If you want to think about problems which are not as strong as but still very very very hard, you can replace “Boolean circuits” by the simpler and familiar notion of “a formula”: Proving that the property “The graph contains no Hamiltonian cycle” cannot be described by a polynomial size Boolean formula in the variables is much beyond reach.

Indeed, showing that certain functions that can be described by a quasi-polynomial circuits of small depth (even depth two) cannot be described by a polynomial-size bounded-depth circuits go back even to the work of Furst, Saxe, and Sipser. I am not aware of a simple property of a Boolean function that manifests such a separation.

Some further remarks about the connection between algorithms complexity and circuit complexity can be found here: http://rjlipton.wordpress.com/2009/02/12/is-np-too-big-or-p-too-small/

Pingback: Noise Stability and Threshold Circuits « Combinatorics and more

Pingback: Analysis of Boolean functions – week 2 | Combinatorics and more