Homework Assignment 10
Assignment
-
(50 points) A graph
G
is bipartite if its vertices can be partitioned into two setsX
andY
such that every edge inG
has one end vertex inX
and the other inY
. Design and analyze an efficient algorithm for determining if an undirected graphG
is bipartite (without knowing the setsX
andY
in advance).- Provide and explain pseudocode
- Statement and proof of time complexity. Be clear of the assumptions on the ADT implementations.
- Statement and proof of memory complexity. Be clear of the assumptions on the ADT implementations.
-
(50 points) An Euler tour of a directed graph
G
withn
vertices andm
edges is a cycle that traverses each edge ofG
exactly once according to its direction. Such a tour always exists ifG
is connected and the in-degree equals the out-degree of each vertex inG
. Describe and analyze anO(n + m)
-time algorithm for finding an Euler tour of such a directed graphG
.- Provide and explain pseudocode
- Statement and proof of time complexity. Be clear of the assumptions on the ADT implementations.
- Statement and proof of memory complexity. Be clear of the assumptions on the ADT implementations.
-
Bonus.
(10 points) An independent set of an undirected graph
G = (V, E)
is a subsetI
ofV
such that no two vertices inI
are adjacent. That is, ifu
andv
are inI
, then(u, v)
is not inE
. A maximal independent setM
is an independent set such that, if we were to add any additional vertex toM
, then it would not be independent any more. Every graph has a maximal independent set. (Can you see this? This question is not part of the exercise, but it is worth thinking about.) Give and analyze an efficient algorithm that computes a maximal independent set for a graphG
.- Provide and explain pseudocode
- Statement and proof of time complexity. Be clear of the assumptions on the ADT implementations.
- Statement and proof of memory complexity. Be clear of the assumptions on the ADT implementations.
General Instructions, Turning in assignments, and Grading
General Instructions
- All homework assignments must be typeset using LaTex. Using another
program (e.g., Microsoft Word) or handwriting assignments will result in
grade of 0. Here is an example homework
problem (click here for pdf) worked out to see the expected format and
the tex file (click here to see it) that
generated it to help you start.
- If you are unfamiliar with LaTex, here is a short tutorial (click here for pdf) and the tex file (click here to see it) that generated it. This tutorial shows how to write common mathematics, how to write pseudocode, how to cite sources, how to include images, and how to include tables.
- Complete every part of every problem!
- On writing an algorithm, use pseudocode and good mathematical style to describe algorithms and data structures. Do not specify Java code unless otherwise stated.
- On time complexity, your goal should be to determine and prove the tightest bound for your algorithm. Be sure to state any assumptions about implementations needed.
- On memory complexity, your goal is to analyze the extra memory consumed by your algorithm, i.e., do not count the memory used by the input to your algorithm.
- Follow turn-in instructions precisely.
- Failure to complete any of these steps will result in a significant loss of points.
Turn in Instructions
Each assignment will be turned in in class (hard copy). Assignments are due BEFORE, let me repeat, before class starts. This does not mean one minute after class starts. Details:
- The first page of your hard copy must be a signed coverpage (click here for pdf).
- Next put the problems in order as described in the description. This may seem silly, but you would be surprised sometimes.
- If you do not know how to print, consult University of Richmond webpages to learn how to use campus printers. If possible, please print 2-sided. Printer issues are not an excuse to turn an assignment in late.
- Staple all pages together.
- I reserve the right to assign a 0 to any assignment failing to comply with these instructions. Even for something as small as a missing staple.
Grading
- Each assignment is graded out of 100 points (not including bonus).
- Expectation and point distribution - this is a general guideline that may
change depending on the specific problem, e.g., proof-only problems may
differ.
- Algorithm description and pseudocode - ~50%
- Provide a written explanation of your algorithmic solution. Provide intuition as to why it computes the correct answer.
- Provide pseudocode of your solution. Be sure to clearly state input and output (if applicable, and a return statement must also be present), and be sure to use ADTs as specified in slides and textbook.
- Statement and proof of time complexity - ~25%
- Provide a theorem/lemma stating assumptions and results.
- Provide a clear proof sketch justifying theorem.
- Statement and proof of memory complexity - ~25%
- Provide a theorem/lemma stating assumptions and results.
- Provide a clear proof sketch justifying theorem.
- Algorithm description and pseudocode - ~50%
- Criteria (includes but is not limited to)
- Efficiency solutions - inefficient algorithms will yield partial credit to the problem.
- Clear and concise technical writing and presentation is the heart of the grade. It is not merely that you solve the problem, it is a function of how well you write your pseudocode and theorems, and how they are explained and proved. Short statements of fact and clear equations are valued over unclear, complex, and lengthy expositions.
- Proper use of LaTeX is also expected. Points will be deducted for not using mathematics mode or LaTeX tables for example.
- If there are any discrepancies in grades, please see the instructor during his office hours or by appointment (do not discuss with the lab assistants or graders).