
CSE200: Computability and Complexity Final exam
Instructor: Daniele Micciancio
Fall 2007. Due on Thu. December 13 (11am)∗
Remember, this is an individual assignment. No teams allowed. You can discuss the problems only with
the instructor or TA. Consider the following three problems:
•HAMILTONIAN-GRID (Hamiltonian cycle on a grid). Consider an n-dimensional grid of side m.
(E.g., when n=m= 3, this is an undirected graph with mn= 27 nodes, with 54 edges connecting
each node with its neighbors.) The problem is to determine (on input nand m) if the graph contains
a Hamiltonian cycle.
•AIRPORT-LOCATION: Consider an undirected graph G= (V, E) (representing a set of cities and
two-way roads directly connecting them) together with two functions cand dasso ciating to each city
v∈Vthe cost c(v) of building an airport in v, and to each road e∈Ethe length of the road. You are
also given a cost budget Band distance bound D. The problem is that of building a set of airports,
such that the total construction cost is within the budget B, and each city is within distance at most
Dfrom an airport.
•TAXICAB-RIPOFF: You are a taxi-driver, you have a city map with positive costs associated to every
(possibly one-way) street, and two prospective passegers (not willing to share a ride) fighting over
who’s going to get in the cab. You know the destinations t0and t1the two passegers. You can pick
up only one of them, but since they are both turists, once you pick your passeger you can select the
route to his/her destination that maximizes your earnings, and he/she won’t notice (unless you go
twice through the same location, of course). The question is: which of the two passegeres should you
pick up in order to maximize your earnings?
Problem 1
Formulate the above problems as languages, and prove that all three of them are in NP.
Problem 2 & 3
Two of the above three problems are NP-complete. Determine which problems are NP-complete, and prove
your answer. Since you already proved that all three problems are in NP, here you only need to show that
the problems are NP-hard. Also, for the remaining problem, you do not need to prove anything.
Problem 4 (optional, no formal credit for this problem)
Determine the complexity of the remaining problem (e.g., L, NL, P), and prove your answer correct (e.g.,
the problem is in P, but it is unlikely to be in NL because complete for P under logspace reductions.)
∗Email to both TA and instructor, and/or slide your solutions under Daniele’s office door.
1