Comp6651 Final Fall 2020
Comp6651 Final Fall 2020
Fall 2020
Instructions:
• Solve the following problems, write up your solutions, digitize them into a single PDF
file, and upload it on Moodle by the deadline. No late submissions will be accepted.
Double-check your submission to make sure that no pages are missing.
• For any algorithms we have done in class, you do not need to provide the pseudocode.
However, if you are modifying the algorithm, you do need to provide the pseudocode.
• Do not spend too much time on any one problem. Read through all of them first and
attack them in the order that allows you to make the most progress.
• The 20% rule: You will receive 20% of the points for any (sub)problem for which
you write “I do not know how to answer this question.” You will receive 10% if you
leave a question blank. If instead you submit irrelevant or erroneous answers you will
receive 0 points. You may receive partial credit for the work that is clearly “on the
right track.”
1. (Computational) [10 pts]
Consider the following LP in standard form. Rewrite it in slack form and solve it
using Simplex. For each step of Simplex write down the entering variable, the leaving
variable, and the basic feasible solution.
2
Maximize x
3 1
+ x2
Subject to x1 + x2 ≤8
1
x + x2
2 1
≤ 13
2
x1 ≤5
x2 ≤6
x1 , x2 ≥0
(a) State this problem as a flow network G = (V, E), c, s, t. State precisely: what V
is, what E is, what capacities are assigned to edges e ∈ E.
(b) How can you use maximum flow value to decide if it is possible to satisfy all
requirements or not? How can you use maximum flow to design an actual schedule
provided that it is possible to satisfy all requirements?
(a) For each statement below state whether it is TRUE or FALSE (exclusive). For
each answer provide a brief justification or a small counter-example. Guesses
without justification or with incorrect justification receive 0 marks.
• If L ∈ N P then L∗ ∈ N P.
• If L1 ≤p L2 and L2 ≤p L3 then L1 ≤p L3 .
(b) Let G = (V, E) be a simple undirected graph that represents a friendship network,
i.e., vertices are people and there is an edge between two people if and only if they
are friends (we assume friendship is reciprocal). A subset of people S ⊆ V form
a tightly-knit community, TKC for short, if all people in S are friends with each
other. The TKC problem asks whether all people in a given friendship network G
can be split into k disjoint TKCs (friendships across different TKCs are allowed).
State the TKC problem as a language LT KC . Prove that LT KC is N P-complete.
Recall that COL = {hG, ki : G has a valid coloring with at most k colors} is
N P-complete.
Example: The following graph can be split into 2 TKCs (circled in the picture), but
not into 1 TKC.
f g
b
a c d e
End of Example
Example: Let I1 = [4, 10), I2 = [1, 6), I3 = [1, 5) and I4 = [7, 9). Then I1 ∪I2 ∪I3 ∪I4 =
[1, 10). Thus, the grand interval is [1, 10). This interval is covered by two input intervals
I1 ∪ I3 = [1, 10), but not by any single input interval. Thus S = {1, 3} is an optimal
solution.
End of Example
5. (Approximation Algorithms) [20 pts]
Let G = (V, E) be a simple undirected graph. A cycle of length 3 in G is called a
triangle. A subset of edges C ⊆ E is an edge-cover of triangles if every triangle in G
contains at least one edge from C. The Edge-Cover of Triangles problem asks to find
an edge-cover of triangles of minimum size, i.e., minimize |C|. Design a simple and
efficient 3-approximation algorithm for this problem. Hint: borrow inspiration from
the 2-approximation algorithm for Vertex Cover. In Vertex Cover you cover edges by
vertices, in this problem you cover triangles by edges.
Example: In the following graph, C = {{a, b}, {b, c}, {a, c}} (shown in red) is an
edge-cover of all triangles, because each triangle contains at least one edge from C.
d b e
a c
f
End of Example
(a) State this problem formally in the usual format Input: . . ., Output: . . ..
(b) State the semantic array.
(c) State the computational array.
(d) Briefly justify why the above two arrays are equal.
(e) What running time will an algorithm based on the computational array have?
Why?
Example 1: k = 2, n = 10. The first segment type has e1 = 100, m1 = 50; the second
segment type has e2 = 0, m2 = −10.
We create a roller coaster consisting of the first two segments of type 1. The excitement
after these two segments is 200, but motion sickness is 100. To reduce the motion
sickness, the next 5 segments are of type 2 each. Thus, the excitement after the first 7
segments is 200, but motion sickness is 50 (reduced due to segments of type 2). This
allows us to place another segment of type 1 as the 8th segment, and to complete the
roller coaster, we use segments of type 2 in the last two places. Thus, the overall
excitement is 300 and motion sickness is maintained between 0 and 100 during the
entire ride.
End of Example
Example 2: k = 2, n = 10. The first segment type has e1 = 100, m1 = 11; the second
segment type has e2 = 10, m2 = 1.
Then we create a roller coaster consisting of the first 9 segments of type 1 and the last
10th segment of type 2. Total excitement is 9e1 + e2 = 910. Motion sickness after the
first segment is m1 = 11, after the second segment is 2m1 = 22, and so on. After the
9th segment accumulated motion sickness is 9m1 = 99, so we cannot use type 1 for the
last segment, as it would push motion sickness beyond 100. Since we use segment of
type 2 in the last place, the motion sickness after the last segment will be 100, which
is within the tolerance level.
End of Example