Columbia University**We aren't endorsed by this school
Course
CSOR 4231
Subject
Computer Science
Date
Dec 17, 2024
Pages
3
Uploaded by CaptainDugongPerson57
CSOR W4231 (sec. 002): Analysis of AlgorithmsNov 25, 2024Homework 6: Due on Dec 9, by 2:30pmInstructor:Alex AndoniInstructions.Please follow the homework policy and submission instructions in the Course Informationhandout. A few highlights to remember:•submission is via GradeScope:https://www.gradescope.com/using codeKZBNBB, where the“stu-dent ID” must be your uni(likeaa3815, otherwise we can’t match your homework to you);•you are encouraged (but not required) to use LaTeX, using the provided template;•follow the stated collaboration and academic honesty policies;•write your name, uni, and collaborators on each problem;•make sure to identify the start of each problem in GradeScope, including the ones that you didn’tsolve;•if you don’t know how to solve a particular part of a problem, just write “empty”.“Design an algorithm” entails proving both correctness and runtime bound; also the default expec-tation is for a deterministic algorithms (unless otherwise stated).Note that, for each bullet item of aproblem, you can use the previous bullets as “black box”, even if you didn’t manage to solve them.Similarly, you can use anything from the lectures as black-box.1Problem 1 (30pts)a) IfG= (N, E) is an undirected graph andu, vare two nodes, denote byμ(u, v) the maximumnumber of edge-disjoint paths fromutov(i.e. paths that do not share any edges, though they mayshare vertices). Show thatμ(u, v) can be computed using a maximum flow algorithm.b) For an undirected graphGand nodesu, v, denote byλ(u, v) the minimum number of edges whoseremoval disconnectsufromv(i.e. there is a setLofλ(u, v) edges such that the graphG0= (N, E\L)has no path fromutov). Use the max flow – min cut theorem to prove that for every graphGand every pair of nodesu, v, we have thatμ(u, v) =λ(u, v).c) The edge connectivity of a connected undirected graphG= (N, E), denotedλ(G), is the minimumnumber of edges whose removal disconnects the graph. Observe thatλ(G) = min{λ(u, v)|u, v∈N}.Show that the edge connectivity can be computed by running a maximum flow algorithm on at most|N|flow networks, each havingO(|N|) nodes andO(|E|) edges.1
Problem 2 (40pts)Suppose we want to solve thes-tshortest path in a weighted directed graphGwith the extra conditionthat the number of edges must be at mostk, wherekis the smallest number of edges in any path fromstot(ie, length of the shortest path in the unweighted version of the graph). You are to solve this problemby formulating it as an LP. You can assume that all weights are positive.a) For a given graphG= (V, E, w), nodess, t, and a boundk, formulate the problem of finding thes-tshortest path with at mostkedges as an LP program withe=|E|variables.Hint:first thinkof how you would formulate the program if you could set the unknownsxito be from{0,1}, andthen relax to 0≤xi≤1.b) Show that the (optimal) value of the obtained LP is upper bounded by the shortests-tpath withat mostkedges.c) Show that if the value of your LP isv, then there exists a shortest path ofkedges and of weightv.Hint:use flow decomposition theorem. Can any path (with non-zero flow) have length more thank?Problem 3 (30pts)In this problem, you’ll have to reduce the optimization version to decision version of the problemLONGEST-SIMPLE-PATH. The LONGEST-SIMPLE-PATH problem is as follows: given an directedunweighted graphG= (N, E), and nodess, t, find the longest simples-tpath, i.e., a path fromstotwhere each node appears at most once.The decision version of the LONGEST-SIMPLE-PATH problem is as follows: given also a parameterb≥1, is the LONGEST-SIMPLE-PATH length at leastb?Now suppose we have a magic algorithmMthat solves the above decision version of the problem inpolynomial time. Prove that, in this case, we can recover, in polynomial time, the actual longest simplepath. No need to analyze the run-time/correctness.Extra problems for your practice (not to be turned in)•Practice the graph algorithms that we learn for some specific graphs of your choice. For example,do exercises 24.1-1, 24.3-1, 25.2-1, 26.2-3.•For example, draw an arbitrary directed or undirected graph, pick a source node and apply Breadth-First Search. Compute the BFS tree, the distances, and the partition of nodes into layers. Does thetree depend on the order in which nodes appear in the adjacency lists? (Recall that the adjacency listof a node contains the adjacent nodes in arbitrary order.) How about the distances and the layers?2 Similarly with Depth-First Search. Compute the DFS tree, the discovery and finish times of thenodes, classify the edges (tree, forward, back, cross). Compute the strongly connected componentsfor a directed graph. Draw a weighted undirected graph, and apply Prim’s and Kruskal’s algorithmto it.•Practice doing NP-reductions. Read the reductions in Section 34.5 of CLRS and try some of theexercises, for example exercises 34.5-1, 34.5-5, 34.5-6, 34.5-7. Make sure that your reductions go in2
the right direction (from the problem that you know is hard to the problem that you want to proveis hard).•Show that for any decision problem in NP, there is an algorithm that can solve it that runs in time2O(nk), for some contantk >0.3