- Form the set-cover problem as an integer linear program, and then relax it to a linear program. Define your variables. [Hint: you might want to have a constraint like for each element .]
- Let denote the optimal solution to the relaxed LP you defined in part (a). Let be the maximum number of subsets in which any element appears. Here's the rounding algorithm: given , we include if and only if . Let is selected by the rounding algorithm . Prove that the collection of subsets where chosen by the rounding algorithm is a set cover.
- Let OPT be value of the optimal solution of the set-cover. Prove that the rounding algorithm in (b) gives an -approximation.
We can now relax the problem by allowing
We now prove that the selection of subsets selected using the rounding algorithm is a set cover. Given an , lets show that there is some such that where has been selected using the rounding algorithm.
When know that is included in at most (or equal to) subsets, therefore we know that what this means is that therefore since the solution still respects the constraint: then if each then the sum would be less than 1 which is a contradiction, therefore there is at least one such that , by construction our round algorithm will select , on the other hand and therefore so is covered, since this holds for any the entire collection is covered.
Note that and suppose that the optimal solution from the relaxation is given by where the are used to differentiate from the OPT solution, let the solution given by taking the optimal relaxation solution and doing rounding be given by where maps to 0 if the value is less than and 1 otherwise.
Let's now observe a few relationships between these solutions. First note that by relaxing a binary varaible it allows for the binary values to be taken on, but also other values, within these new possible values we may be able to find a solution which yields a better objective value. Thus we have .Note that if then we know that and so there is some such that , at the same time if then thus we have simply: as needed.
Here's the metric traveling salesman problem. You are given a complete graph , where represents the cities the salesman needs to visit. For each edge , we associate it with a cost . We call it "metric" because for every triplet of vertices , it respects the triangle inequality, i.e. .
The goal is to have a tour of the cities (i.e. a Hamiltonian cycle of ) such that each city is visited exactly once (except for the starting city where you have to come back to), and the total cost is minimized.
Here is our approximation algorithm, which is also a greedy algorithm: Among all pairs of cities, find the two closest cities, say and , and start by building a tour on that pair of cities; the tour consists of going from to and then back to again. This is the first iteration. In each subsequent iteration, we extend the tour on the current subset by including one additional city, until we include the full set of cities. Specifically in each iteration, we find a pair of cities and for which the cost is minimum; let be the city that follows in the current tour on . We add to , and replace the path with and . See the picture below for illustration:
Let OPT be the value of the optimal solution of the metric traveling salesman problem. Prove that the approximation algorithm above gives a 2-approximation.
Firstly observe that the specified algorithm is very similar to Prim's algorithm, which generates a minimal spanning tree. We make the followign claim at iteration the cost subtour constructed by the approximation algorithm is less than or equal to 2 times the cost of the sub-spanning tree constructed by prim's algorithm. Let and denote the cost at iteration of of the approximation and prim's algorithm respectively.
Base case: On the first iteration the approximation algorithm selects the two vertices that are closest together ( ) and constructs the tour this cost is equal to , on the other hand the subtree constructed by prim is simply and therefore it's cost is only so we have that as needed.
Induction Step: Assume that the statement holds true for and lets show it holds true for . At iteration since the pseudocode of the approximation algorithm selects the next vertex in the same way a prim, they both select some new vertex where this vertex forms the smallest distance with respect to all of the vertices which have been selected already (which is also the same for both algorithms at this iteration). Suppose this smallest distance was observed with the pair , which is to say that was minimized.
Recall that the approximation states that it will remove the vertex after in the tour (which we will denote as ) and then inserts instead. The increase in cost by doing so is equal to , now we remark the following therefore Keep remembering that this edge is the exact same edge that prim will have chosen at iteration because both of these algorithms select their next vertices in the same manner. Thus we have Thus the induction step is proven.
What we can infer is that after both algorithms terminate on the same iteration, the approximation algorithm has created a tour and prim has created a minimal spanning tree such that . Now note that given a minimal spanning tree we know that it's cost is always going to be less than or equal to OPT, this is because by removing a single edge from OPT which is a tour, we obtain a spanning tree whose cost is less than or equal to the cost of the tour, but also it's a spanning tree and so the minimal spanning tree will have cost less than or equal to it, so now we have that hence the approximation algorithm yields a 2-approximation.
The set is called the cut determined by the vertex set . The size of the cut is denoted by . The Max-Cut problem asks you to find the cut with maximum size, i.e., .
Here is a randomized algorithm for Max-Cut: Take a uniform random subset of , and choose to be the cut. Let OPT be the size of the maximum cut in .
Prove that the randomized algorithm gives a cut of expected size at least half of the optimal solution, i.e., OPT.In order to solve this we must know the meaning of a uniform random subset of , to select a uniform random subset means that there is equal probability for a given vertex to either be in or for it to not be in , what this means is that given any we have that , observe that we have the indicator function which equals when an edge is in the cut and 0 when it is not, and that the indicator function can be thought of as a random variable.
Note that , since expected value is linear then we know
Now let's note that for a given fixed we know that therefore we continue the chain of equalities from our previous paragraph obtaining:
Note that the size of the cut is clearly upperbounded by how many edges your graph actually has, so that thus connecting everything we obtain that as needed.
- Prove that there exists a randomized algorithm that will approximately solve Max-SAT within an approximation ratio of .
- Provide a de-randomization of the algorithm that uses the method of conditional expectations.
Our randomized algorithm simply assigns random truth values to all variables, since each clause is a sequence of logical or operations taken at once and it uses distinct variables, then there is exactly one way for it to be false, and possible truth assigments to these variables, therefore the probability that the whole statement is true is given by
If there are clauses total, then the expected number of satisfied clauses is simply given by , since the optimal number of satisfied clauses is then this provides a approximation.
Note that if our random assigment doesn't yield a solution that satisfies at least clauses, we simply try a new random assignment, it should only take a few iterations until we do at least as well as the expected value.