# BioSysBio:abstracts/2007/Naoki Matsumaru/AppendixB

## Algorithm to design reaction network to solve the maximal independent set problem

Let an undirected graph $\displaystyle{ G=\langle V, E \rangle }$ be defined by a set of $\displaystyle{ N }$ vertexes $\displaystyle{ V=\{v_1, \dots, v_{N}\} }$ and a set of edges $\displaystyle{ E }$. When two vertexes $\displaystyle{ v_p }$ and $\displaystyle{ v_q }$ are connected, the pair of the vertexes are in the set: $\displaystyle{ (v_p,v_q)\in E }$. Note that the order of the pair is insignificant, that is, $\displaystyle{ (v_p,v_q)=(v_q,v_p) }$. Given the undirected graph $\displaystyle{ G }$, an algebraic chemistry $\displaystyle{ \langle {\mathcal M},{\mathcal R} \rangle }$ is designed as follows. For each vertex $\displaystyle{ v_j }$, we assign two molecular species $\displaystyle{ s_j^0 }$ and $\displaystyle{ s_j^1 }$ representing the membership of the vertex in the maximal independent set. The subscript of the species name corresponds to the index number of the vertex. High concentration of species $\displaystyle{ s_j^1 }$ means that the vertex $\displaystyle{ v_j }$ is included in the maximal independent set. High concentration of species $\displaystyle{ s_j^0 }$ represents that the vertex $\displaystyle{ v_j }$ is not included in the maximal independent set. Thus the set of molecular species $\displaystyle{ {\mathcal M} }$ contains $\displaystyle{ 2N }$ molecular species:

$\displaystyle{ {\mathcal M}=\{s_{j}^0,s_{j}^1\; |\; j=1,\dots,N\} }$

The set of reaction rules $\displaystyle{ {\mathcal R} }$ is constructed by assembling reactions for each vertex:

$\displaystyle{ {\mathcal R} = \bigcup_{i=1}^N {\mathcal R} ^i, }$

and for each reaction set $\displaystyle{ {\mathcal R} ^i }$, there are three sorts of reactions:

$\displaystyle{ {\mathcal R}^i = ({\mathcal V}^i \cup {\mathcal N}^i \cup {\mathcal D}^i) }$

The first is a reaction rule to produce species $\displaystyle{ s_i^1 }$:

$\displaystyle{ \begin{matrix} {\mathcal V}^i =(&\underbrace{s_h^0 + s_k^0 + \dots + s_l^0}& \to n_i s_i^1)\\ &n_i&\\ \end{matrix} }$

where $\displaystyle{ n_i }$ is the number of vertexes connected to vertex $\displaystyle{ v_i }$ and $\displaystyle{ v_h, v_k, \dots, v_l }$ are these neighboring vertices, that is, $\displaystyle{ (v_i, v_h), (v_i, v_k), \dots, (v_i, v_l) \in E }$. The left hand side of the reaction contains $\displaystyle{ n_i }$ terms, and this reaction is interpreted as follows: When no neighboring vertex is included in the maximal independent set, the target vertex $\displaystyle{ v_i }$ should be included in the set.

The negation of this predicate is considered by a set of $\displaystyle{ n_i }$ reactions:

$\displaystyle{ {\mathcal N}^i = \{s_j^1 \to s_i^0 | (v_i,v_j)\in E\}. }$

This is the second type of the reactions, which produce species $\displaystyle{ s_i^0 }$ from any species corresponding to the neighboring vertexes with superscript $\displaystyle{ 1 }$. This rule can be interpreted as follows: If there exists at lease one neighboring vertex included in the maximal independent set, then the target vertex $\displaystyle{ v_i }$ should be excluded from the maximal independent set (otherwise the definition of the maximal independent set would be violated). Generating species $\displaystyle{ s_i^0 }$ forces vertex $\displaystyle{ v_i }$ not to be included in the set. In passing note that two predicates constitute a program for any distributed processor to solve the maximal independent set problem under a central scheduler.

The last component of set $\displaystyle{ {\mathcal R} ^i }$ is a destructive reaction. Since the membership of the maximal independent set is a binary state, the state becomes undefined when neither or both of the species are present. In order to avoid the latter case, the two opposite molecular species are defined to vanish upon collision:

$\displaystyle{ {\mathcal D}^i = s_{i}^0 + s_{i}^1 \to \emptyset. }$