\documentclass[11pt]{article}
\usepackage{amsmath,amssymb,amsthm,enumitem}
\newcommand{\encode}[1]{\langle #1 \rangle}

\title{\bf Assignment 4 \\[2ex]
\rm\normalsize CS 350 \\ Due: November 6, 2019}
\date{}
\author{}

\begin{document}
\maketitle

\begin{center}
    \fbox{\fbox{\parbox{5.5in}{\centering
    Your solutions must be typed (preferably typeset in \LaTeX ) and submitted as a hard-copy at the beginning of class on the day its due. The answers that you provide should clearly demonstrate that you understand the assignment and should provide enough information to clearly explain your solution to a peer. When asked to provide an algorithm you need to give well formatted pseudocode and a description of how your code solves the problem.
    }}}
\end{center}

\paragraph{Problem 1}
Starting with a map represented by a rectangular grid with height $h$ and width $w$. Cells are numbered $(0,0)$ in the top left to $(h-1, w-1)$ in the bottom right.  Each cell in the grid is either empty or contains an impassable object. All movements on the map are done as a single step to a cell that is adjacent horizontally or vertically. No diagonal movement is permitted.

\subparagraph{(a)}[10]
Write an algorithm that uses a breadth first search to find the length of the shortest path from $(0,0)$ to $(w-1,h-1)$. Return $-1$ if no such path exists.

\subparagraph{(b)}[5]
What is the worst case complexity for your algorithm? Be sure to specify how the input size is measured and show your work.

\subparagraph{(c)}[10]
Modify your algorithm from part (a) to return the shortest path from $(0,0)$ to $(w-1,h-1)$ in addition to its length. How does your change affect the time complexity? How does your change affect the amount of memory required.

\end{document}
