\[\begin{align} C=\{ & \{1,11,14,18,20,23\}, \{5,12,15,18,21,24\}, \{2, 11, 16, 17\}, \\ & \{4, 5, 10,19,24,25\}, \{2,7,17,18,25\}, \{8,11,12,14,16\}, \\ & \{4,6,10,11,22,25\}, \{3,7,12,15,16,19\}, \{1, 6, 9, 12, 14, 19, 21, 24\} \} \end{align}\]
Minimal rep sets: \(\{11,24,7\}, \{11, 12, 25\}\), etc.
Suppose you have a polynomial-time solver for REP-SET, and you are given an instance of MinVertexCover to solve: a graph \(G\).
MinVertexCover: Given a graph \(G\), what is size of the smallest subset of vertices you can select so that every edge is touched?
VertexCover: Given a graph \(G\) and an integer \(k\), is there a vertex cover in \(G\) consisting of \(k\) vertices?
SubsetSum: Given a set \(X\) of positive integers and a target integer \(T\), is there some subset of \(X\) whose elements add up to \(T\)?
Write \(311_4\) in base 10.
Write your age in base 4.
Write \(\displaystyle{\sum_{i \in \{0,1,2,3,4\}} i \cdot 4^i}\) in base 4.
Write \(322222_4\) in base 10 using Sigma notation where convenient.
Compute the sum of \(111000_4\), \(101101_4\), \(100011_4\), \(110110_4\) in base 4.
Given a graph \(G\) and and integer \(k\), make a set \(X\) of numbers:
This is a polynomial-time reduction (in \(V\) and \(E\), so also in \(n\), the input size).
Set \(T = \displaystyle{k\cdot 4^E + \sum_{i=0}^{E-1} 2 \cdot 4^i}\).
\[ T = k\cdot 4^E + 222\cdots 22_4 \]
There are two directions to prove:
Suppose \(G\) has a vertex cover of size \(k\). Make a subset of \(X\):
Suppose some subset of \(X\) sums to \(T\).
// X[1..n] is an array of positive integers (n is constant)
// SS[1..(n+1), 0..T] is a boolean array
FastSubsetSum(T):
Initialize SS[*, 0] to TRUE
Initialize SS[n + 1, *] to FALSE for * > 0
Initialize SS[* , *] to FALSE for * < 0 // hmmm...
for i <- n downto 1
for t <- 1 to T
with <- SS[i + 1, t - X[i]]
wout <- SS[i + 1, t]
SS[i, t] <- (with OR wout)
return S[1, T]