\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{Spring}
\setyear{2017}
\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 26, 2018. \\Submit PDF solutions on Canvas by the \\ 
  beginning of class on December 3, 2018.}
\maketitle

\paragraph{Instructions:} 


\begin{description}

\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.

  
\item[Problem 1]  (15 points) Solve exercise 1 in Chapter 8 (page 505) of
  your textbook. 

  % \solution{
  
  % }
  
\item[Problem 2] (20 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{generalised $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 generalised $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 $k$-chakra is in \calnp is easy. A certificate is just a candidate $k$-chakra. The certifier checks that this chakra contains $k+1$ nodes and $2k$ edges in the right configuration. The certificate takes $O(k)$ time to run.

  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. 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 (5 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 (5 points) If $H$ contains a Hamiltonian cycle, prove that $G$ contains a $n$-chakra.
  \item (10 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.
  \end{enumerate}



% \solution{
%
% }
  
\item[Problem 3]  (25 points) Solve exercise 3 in Chapter 8 (pages 505--506) of your textbook. 
  
  % \solution{
  
  % }
  

\item[Problem 4] (40 points = 20 + 20 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.
  
  % \solution{
  
  % }


  

\end{description}

\end{document}


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