\problemdata                                                             
        {Topological Sort} % latex-friendly label for the prob.
        {Relations} % The topic(s) of the problem content.  
        {?} % Source (if known)                                          
        {S01 Quiz 1, 5} % Usage (list ones you are aware of). 
        {Tina Wang, S02} % Last revision info (author, date).   
                                                                         
                                                                         
\begin{problem}     
\begin{problemparts}      
\problempart List the nodes in the following graph in some order such
that no node points to a node that occurs before it in the list.

\begin{figure}[htbp!]
 \centerline{\resizebox{!}{1.5in}{\includegraphics{figs/topsort}}}
\end{figure}



\solution{

One possible ordering byt a topological sort is A, B, C, G, H, F, E,
D.

} 

\problempart Explain whether or not we can give such an ordering if
we add an arrow from node E to node A.

\solution{

We cannot give such an ordering since we now have $A \rightarrow B
\rightarrow H \rightarrow E \rightarrow A$ which is a cycle.

}

                                 
\end{problemparts}
\end{problem}


