# Denset-k-subgraph to ILP reduction [closed]

I have exercise:

Show reduction Denset-k-subgraph to ILP (Integer Linear Porgramming).

(Denset-k-subgraph is problem where there is graph G = (V, E) and two natural numbers k and t. We are asking if we can chose k vertices between whom there are at least t edges, for example $$t =\binom{k}{2}$$ we would asked about the clique of size k).

Below there is my solution:

Variable:

$$x_i = \begin{Bmatrix} 1 & \ when \ \ i \ \ vertex \ \ was \ \ chosen \\ 0 & o/w \end{Bmatrix}$$

Condition:

$$1) \ \forall_{x_i}: 0 \leq x_i \leq 1 \\$$

$$2) \ \sum_{i = 1}^{n} x_i = k, \ \ \ \ //where \ n =\left | V \right | \\$$

$$3) \ \sum_{i \in \left \{1,2,..,n \right \}\ :\ (v_i, v_j) \in E} x_ix_j = t \\$$

Condition 2) just counts all chose vertices to be equal k

Condition 3) for every vertex and all his neighbours (there is edge connecting them) we are summing +1 if and only if both were chosen

Could somebody tell me is this correct reduction to ILP? If not what is wrong here?

Thank you

## closed as unclear what you're asking by Yuval Filmus, Evil, David Richerby, Juho, Discrete lizard♦Feb 11 at 9:20

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.