diff --git a/docs/problems/knapsack.md b/docs/problems/knapsack.md index ed1d8bc..4185a36 100644 --- a/docs/problems/knapsack.md +++ b/docs/problems/knapsack.md @@ -27,7 +27,9 @@ $$\begin{equation} Now that we have an equality constraint, the corresponding QUBO formulation is retrieved by turning the constraint into a so-called quadratic penalty. That is, the cost function is -$$C(\textbf{x}, \vec{y}) = -\sum_{i=0}^n v_i x_i + P\Big(\sum_{i=1}^n w_i x_i + \sum_{k=0}^k 2^i y_i- W\Big)^2,$$ +$$ +C(\textbf{x}, \vec{y}) = -\sum_{i=0}^n v_i x_i + P\Big(\sum_{i=1}^n w_i x_i + \sum_{k=0}^k 2^i y_i- W\Big)^2, +$$ where $\textbf{x} = \{0,1\}^n, \ \ \vec{y} = \{0, 1\}^k$. This cost function can be converted in the form of an Ising formulation (so that variables take values in $\{-1, 1\}$) in order to be used with the QAOA algorithm (see [what-is-a-qubo](/problems/what-is-a-qubo)). diff --git a/docs/problems/minimum-vertex-cover.md b/docs/problems/minimum-vertex-cover.md index 46f4377..2f017d1 100644 --- a/docs/problems/minimum-vertex-cover.md +++ b/docs/problems/minimum-vertex-cover.md @@ -5,9 +5,10 @@ The Minimum Vertex Cover (MVC) problem is a common constrained optimization prob ## The Cost Function The corresponding function to minimize can be derived as: -$$\begin{equation*} - C(\textbf{x}) = \sum_{i \in V}x_i + P\sum_{(i, j) \in E}\left(1-x_i\right)\left(1-x_j\right), -\end{equation*}$$ +$$ +C(\textbf{x}) = \sum_{i \in V}x_i + P\sum_{(i, j) \in E}\left(1-x_i\right)\left(1-x_j\right), +$$ + where $\boldsymbol{x}\in \{0, 1\}^{|V|}$ and $P>1$ is a parameter controlling the strength of penalization of configurations which are not covers. Interpreting a variable $x_i$ being equal to 1 as being part of the vertex cover, the first summation counts the size of the selected cover while the second summation ensures that the selected cover indeed covers all edges. Hence, minimizing it ensures we find the minimum vertex cover. diff --git a/docs/problems/number-partition.md b/docs/problems/number-partition.md index ef4e57a..f999cc7 100644 --- a/docs/problems/number-partition.md +++ b/docs/problems/number-partition.md @@ -11,9 +11,9 @@ For example, given the set of numbers $S=\{1, 2, 3, 6, 10\}$, one can find that The function to minimize can be defined as -$$C(\boldsymbol{\sigma}) = \left(\sum_{i=1}^k n_i\sigma_i\right)^2 = \sum_{i, j=1}^kn_in_j\sigma_i\sigma_j,$$ +$$C(\sigma) = \left(\sum_{i=1}^k n_i\sigma_i\right)^2 = \sum_{i, j=1}^kn_in_j\sigma_i\sigma_j,$$ -where $\boldsymbol{\sigma}\in \{-1, 1\}^k$. That is, a variable $\sigma_i$ is attached to each number $n_i$, and the variable's value determines on which side of the partition the number is assigned to. The smallest value $C(\cdot)$ can take is 0, which happens when $\boldsymbol{\sigma}$ is a perfect partition. +where $\sigma \in \{-1, 1\}^k$. That is, a variable $\sigma_i$ is attached to each number $n_i$, and the variable's value determines on which side of the partition the number is assigned to. The smallest value $C(\cdot)$ can take is 0, which happens when $\sigma$ is a perfect partition. Since this formulation is already in terms of Ising variables, it can be used directly in QAOA.