\documentclass{article}
\usepackage[top=1in,bottom=1in,left=1in,right=1in]{geometry}
\usepackage{fancyheadings,enumerate,xspace,graphicx}
\pagestyle{fancy}

% macros useful for handouts and homeworks.
\newcommand{\setcourse}[1]{\newcommand{\course}{#1\xspace}}
\newcommand{\setsem}[1]{\newcommand{\sem}{#1\xspace}}
\newcommand{\setyear}[1]{\newcommand{\myyear}{#1\xspace}}
\newcommand{\sethwnum}[1]{\newcommand{\hwnum}{#1\xspace}}

\newcommand{\solution}[1]{\textbf{Solution:} #1}

\setcourse{CS 4104}
\setsem{Fall}
\setyear{2021}
\sethwnum{7}

\newcommand{\cut}[1]{\ensuremath{\mathnormal{}{cut}(#1)}}
\newcommand{\calg}{\ensuremath{{\cal G}}\xspace}
\newcommand{\calo}{\ensuremath{{\cal O}}\xspace}
\newcommand{\calnp}{\ensuremath{{\cal NP}}\xspace}
\newcommand{\calp}{\ensuremath{{\cal P}}\xspace}
\newcommand{\npc}{\calnp-Complete\xspace}

\chead{\course (\sem \myyear): Homework \hwnum}


\begin{document}
\title{\vspace{-0.5in}\textbf{Homework \hwnum}}
\author{\course (\sem \myyear)}

\date{Assigned on November 29, 2021. \\Submit PDF solutions on Canvas by the \\ 
 11:59pm on December 7, 2021.}
\maketitle

%\paragraph{Instructions:} 
\input{instructions}
\begin{itemize}
\item For these problems, please describe the reduction as clearly as you can and make you sure you prove the correctness of the reduction in both directions, as we have discussed in class.

\end{itemize}

\begin{description}

  
\item[Problem 1]  (20 points) Solve exercise 1 in Chapter 8 (page 505) of your textbook. Here is a sketch of the strategy you can follow for part (a). First reduce the decision version of the Interval Scheduling problem to the Independent Set problem.
  \begin{enumerate}
  \item Take an arbitrary input to Interval Scheduling, which is a set $S$ of $n$ intervals, each specified by a start time and finish
    time. How will you convert $S$ to an undirected, unweighted graph $G$ that is appropriate as an input to the Independent Set
    problem? Your approach should consist of statements that clearly map each interval to some part of $G$ and each pair of non-overlapping intervals to some part of $G$.
  \item What can you prove about $S$ and $G$ now? It should be a statement of the form ``$S$ contains at least $k$ non-overlapping intervals if and only if $G$ \ldots'' You do not need to provide a proof of this statement.
  \item Finally, how will you prove that Interval Scheduling is reducible to Vertex Cover? You need to state something we proved in class.
\end{enumerate}
I will leave it to you to work out the solution for part (b).

  % \solution{
  
  % }
  
\item[Problem 2] (30 points) The flag of a certain populous country contains a symbol called the ``Ashoka Chakra'' (see the image below). This symbol has a central hub and 24 spokes.  Naturally, this reminds us of a graph with 25 nodes and 48 edges, of which 24 nodes are connected by a cycle, and the 25th node is connected to each of the other 24 nodes. A \emph{$k$-chakra} is a graph with $k+1$ nodes and $2k$ edges such that $k$ nodes lie on a cycle and the $k+1$st node is connected to each of the other $k$ nodes. Given an undirected graph $G$ and an integer $k$, prove that the problem of determining if $G$ contains a $k$-chakra as a subgraph is \npc. (We say that a graph $H$ is a \emph{subgraph} of a graph $G$ if every node in $H$ is also a node in $G$ and every edge in $H$ is also an edge in $G$.)

  \centerline{\includegraphics[width=0.4\textwidth]{wikipedia-Ashoka-Chakra}}
  
  I will get you started on the solution. Proving that this problem is in \calnp is easy. A certificate is just a subgraph $H$ of the input graph. The certifier checks that $H$ contains $k+1$ nodes and $2k$ edges in the right configuration. The certifier runs in $O(k)$ time. 

  Let us move on to proving that some \npc problem is reducible to the $k$-chakra problem.  Suppose $G$ has $n+1$ nodes. Let us consider the special case that $k = n$. An $n$-chakra looks suspiciously like a Hamiltonian cycle, except that the chakra has more edges. Therefore, let us reduce Hamiltonian cycle in undirected graphs (which we know to be \npc) to the $k$-chakra problem. Suppose $H$ is an undirected graph that is an input to the Hamiltonian cycle problem. We want to convert it to a graph $G$ that will be input to the $k$-chakra problem such that $H$ contains a Hamiltonian cycle iff $G$ contains a $n$-chakra. To complete the reduction, answer the following three questions:

  \begin{enumerate}[(a)]
  \item (7 points) Describe how you will convert an arbitrary undirected graph $H$ that is input to the Hamiltonian cycle problem into an undirected graph $G$ that is an input for the chakra problem. 
  \item (8 points) If $H$ contains a Hamiltonian cycle, prove that $G$ contains a $n$-chakra.
  \item (15 points) If $G$ contains a $n$-chakra, prove that $H$ contains a Hamiltonian cycle. \emph{Note:} There is a subtlety here that you have to be careful about. It is useful to think of $G$ and $H$ as distinct graphs with different sets of nodes and edges. How will you take the $n$-chakra in $G$ and convert it back to a Hamiltonian cycle that involves only the nodes and edges of $H$?
  \end{enumerate}


% \solution{
%
% }
  
\item[Problem 3] (50 points = 25 + 25 points) Solve exercise 19 in Chapter 8 (pages 514--515) of your textbook. \emph{Hint:} You can reduce 3-colouring to one problem (I am not saying which) and the other problem to network flow. Keep in mind that to reduce 3-colouring to one of these problems, you must take an undirected graph that you seek to colour with three colours and convert into a trucks-and-canister problem. So your solution should be clear about how you will convert nodes in the undirected graph (input to 3-colouring problem) into trucks or canisters, how will you represent edges in terms of trucks or canisters or canisters that should not be placed together, and what you will map the budget of 3 colours to? In the trucks-and-canister problem, there are no colours and the number three does not appear in the problem statement.
  
  % \solution{
  
  % }


  

\end{description}

\end{document}


%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
