My previous construction of matrix $h$ is wrong; I've editted it.
Given a 3CNF with clauses $\phi_1,\ldots,\phi_k$ on variables $x_1,\ldots,x_n$. Suppose each variable $x_i$ appears $k_i$ timeslarger one in the formulatwo numbers of appearances of literals $x_i$ and $\overline{x_i}$.
- "Assignment" vertices $v_i(j)$ and $\bar{v}_i(j)$, $1\leq i\leq n$, $1\leq j\leq k_i$. Color $v_i(j)$ with the "color" $x_i(j)$, and $\bar{v}_i(j)$ with $\overline{x_i}(j)$.
- "Clause" vertices $w_{i'}(j')$, $1\leq i'\leq k$, $j'=1,2,3$. Color $w_{i'}(j')$ with the color $x_i(j)$ (or $\overline{x_i}(j)$) if $\overline{x_i}$ (or $x_i$, resp.) is the $j'$-th literal of clause $\phi_{i'}$, and it's the $j$-th clause containing the variable $x_i$this literal.
- "Cut" vertices $s=s_0,s_1,\ldots,s_n, s_{n+1},\ldots s_{n+k}=t$. Color them with distinct colors different from above.
For instance, from the 3CNF
$(x_1 \vee x_2 \vee \overline{x_3})\wedge(x_1 \vee \overline{x_2}\vee x_4)$$(x_1 \vee x_2 \vee \overline{x_3})\wedge(x_1 \vee \overline{x_2}\vee x_3)$
the following graph is constructed (The edge directions are from left to right).
So what is the relation between $G$ and OP's problem? WhatIntuitively what we are going to do is to design a matrix $h$, so that each color is mapped to a row (which is a person), and each part isthe edges are mapped to a part of consecutive columns (time slots). ATherefore a maximum scheduling, which is basically going from left to right in the matrix, corresponds to an $s$-$t$ path.
The cut vertices separate $G$ intoOur matrix $n+k$ parts. The last$h$ have $k$ parts$2n+1+\sum_i 2k_i+k$ columns, corresponding to thewith indices starting from $k$ clauses, are easy$0$. ForIn the following constrcution $(n+i')$-th part, there is only one column, and the entries in the rows corresponding to the three literals are$X$ an $1$ while others$Y$ are two values satisfy $0$$1\ll X\ll Y$.
Now consider the The ratios $i$-th part corresponding to the assignment$X/1, Y/X$ can be large powers of $x_i$. In the $i$-th part there are $2k_i+3$ columns (labeled from $-1$ to $2k_i+1$),$k$ and we add two colors $x_i(0)$ and$n$. Let $\overline{x_i}(k_i+1)$ which will only be used here$K_i=2i+2\sum_{j=1}^i k_i$. The non-zero entries are:
- $h(x_i(0))=\{X,Z,Y,0,0,\ldots,0\}$ For each $s_i$, $h(\overline{x_i}(k_i+1))=\{0,0,\ldots,0,Y,Z,X\}$$0\leq i\leq n$, let $h(s_i,K_i)=h(s_i,K_i-k_i-1)=h(s_i,K_i+k_{i+1}+1)=Y$ (if the coordinate exists, same below).
- $h(x_i(k_i),2k_i)=Y$ For each $x_i(j)$, let $h(\overline{x_i}(1),0)=Y$$h(x_i(j),K_{i-1}+j)=X$; For each $\overline{x_i}(j)$, let $h(\overline{x_i}(j),K_i-j)=X$.
- $h(x_i(j),2j)=h(x_i(j),2j+1)=Y$ For each $\phi_{i'}$, $\forall 1\leq j\leq k_i-1$$1\leq i'\leq k$ and a literal $x$ in the clause $\phi_{i'}$, let $h(x,K_n+i')=1$.
- $h(\overline{x_i}(j),2j-3)=h(\overline{x_i}(j),2j-2)=Y$, $\forall 2\leq j\leq k_i$ All the other entries are 0.
For example, if $k_i=3$for the above example graph the corresponding submatrixmatrix is
$$
\begin{array}{rccccccccc}
x_i(0)\, & X & Z & Y & 0 & 0 & 0 & 0 & 0 & 0\\
x_i(1)\, & 0 & 0 & 0 & Y & Y & 0 & 0 & 0 & 0\\
x_i(2)\, & 0 & 0 & 0 & 0 & 0 & Y & Y & 0 & 0\\
x_i(3)\, & 0 & 0 & 0 & 0 & 0 & 0 & 0 & Y & 0\\
\overline{x_i}(1)\, & 0 & Y & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
\overline{x_i}(2)\, & 0 & 0 & Y & Y & 0 & 0 & 0 & 0 & 0\\
\overline{x_i}(3)\, & 0 & 0 & 0 & 0 & Y & Y & 0 & 0 & 0\\
\overline{x_i}(4)\, & 0 & 0 & 0 & 0 & 0 & 0 & Y & Z & X
\end{array}
$$
Besides, for each cut vertex $s_1,\ldots,s_{n+k-1}$, there is a corresponding column with only one $X$ at the corresponding row. The values $X,Y,Z$ satisfy $1\ll Z\ll Y\ll X$. The ratios $Z/1, Y/Z, X/Y$ can be large powers of $k$ and $n$. Finally we glue all parts together in order.
Now we claim: the original 3CNF is satisfiable if and only if the maximum value is $(2n+n+k-1)X+\sum_i 2k_iY+nZ+k$$(2n+1)Y+\sum_i k_iX+k$.
Consider the scheduling achieving the maximum value. Since there are exactly $(2n+n+k-1)$$(2n+1)$ columns in $h$ containing (actually only one) $X$$Y$, they should all be covered. Next we claim in each assignment part
For the column $K_i+k_i+1$ which has two choices of $x_i$$Y$, suppose the maximum value isscheduling assigns it to $2k_iY+Z$$s_i$. It is done by the following simple observations:
- For two consecutive $Y$'s in a row, if one of them is chosen, it won't get worse if we also choose the other one.
- For the consecutive $ZY$ or $YZ$ in a row, if the $Y$ is chosen then the $Z$ must be chosen (because of the consecutiveness and the $X$ nearby is already chosen), and if the $Z$ is chosen it won't get worse if we also choose the $Y$.
ThereforeSince column $K_i$ must be assigned to $s_i$, inby the optimal schedulingconsecutiveness we can assume for each conseutive $YY$,have to lose the columns $YZ$ or$K_i+1$ to $ZY$ in a row, either both of them are selceted or neither$K_i+k_i$. It is easy to check that in this case, we eitherSame things happen if the scheduling assign all the slots to $x_i$ or all tocolumn $\overline{x_i}$, which both give rise$K_i+k_i+1$ to a value of $2k_iY+Z$$s_{i+1}$.
Now this can be regarded as an assignmentTherefore, and since a person could onlyin order to have consecutive blocksthe value $\sum_i k_iX$, ifwe must select all the rest available $x_i$ is chosen then it cannot be used$X$'s in the clause partmatrix, which corresponds to an assignment on variables. So the rest value of $k$ is achievable if and only if the assignment satisfy every clause.