Skip to content

Commit 1ddc683

Browse files
More notes and etc
1 parent d9e1e7b commit 1ddc683

7 files changed

Lines changed: 36 additions & 19 deletions

OMSCS/Courses/GA/08.2 - NP - Knapsack.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,4 @@ Recall that Knapsack's DP solution requires $O(nB)$ time, which is not polynomia
5252

5353

5454
## Ungraded Homework
55-
Prove that Knapsack is NP-Complete: [[8.99.1 - Knapsack is NP-Complete (TODO)]]
56-
55+
Prove that Knapsack is NP-Complete: [[8.99.1 - Knapsack is NP-Complete]]

OMSCS/Courses/GA/Practice Problems/8.10f - NP-C Generalization - Set Cover.md

Whitespace-only changes.

OMSCS/Courses/GA/Practice Problems/8.15 - Maximum Common Subgraph.md renamed to OMSCS/Courses/GA/Practice Problems/8.15 - Maximum Common Subgraph (TODO).md

File renamed without changes.

OMSCS/Courses/GA/Practice Problems/8.20 - Dominating Set (TODO).md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ tags:
44
- Algorithms
55
- Practice
66
---
7-
# 8.20 - Dominating Set (TODO)
7+
# 8.20 - Dominating Set
88
> In an undirected graph $G=(V,E)$, we say $D \subseteq V$ is a dominating set if every $v \in V$ is either in $D$ or adjacent to at least one member of $D$. In the DOMINATING SET problem, the input is a graph and a budget $b$, and the aim is to find a dominating set in the graph of size at most $b$, if one exists. Prove that this problem is NP-complete.
99
10-
This feels similar to Homework 10 and also Set Cover from 8.10f ([[8.10 - NP-Completeness by Generalization]]). In this problem, we can reproject the edges of $G$ in a Vertex Cover problem as vertices in $G'$ in a Set Cover / "Allocations" problem.
10+
This feels similar to Homework 10 and also Set Cover from 8.10f ([[8.10 - NP-Completeness by Generalization]]). In 8.10f and HW10, we can reproject the edges of $G$ in a Vertex Cover problem as vertices in $G'$ in a Set Cover / "Allocations" problem. We don't get to restrict the set of vertices from $G$ that Dominating Set is allowed to consider. Also in a Bipartite graph, the only way to ensure a dominating set would be to select at least all vertices in one of the partitions of the graph.
1111

12-
We don't get to restrict the set of vertices from $G$ that Dominating Set is allowed to consider. Also in a Bipartite graph, the only way to ensure a dominating set would be to select at least all vertices in one of the partitions of the graph.
13-
14-
What other problems are similar and available in the course? [[06.1 - NP - Theory Guidance]]
12+
One note is that in min-VC, isolated vertices are never selected. In min-DS, isolated vertices are always selected. Therefore, we definitely need to remove degree-0 vertices from G so they don't show up in the DS problem's solution.
1513

14+
Another note is that only one vertex in a given clique needs to be selected in min-DS. However, in min-VC, $n-1$ vertices from a clique of size $n$ must be selected in order to cover all edges within that clique. A helpful note from the TA mentioned projecting each edge as a vertex within $G$, keeping the edge. This "locks" the vertex behind that edge, requiring that the edge be covered in order to also "dominate" the vertex. This requires some additional output transformation, when one of those artificial vertices is selected for the dominating set.

OMSCS/Courses/GA/Practice Problems/8.99.1 - Knapsack is NP-Complete (TODO).md

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
tags:
3+
- OMSCS
4+
- Algorithms
5+
- Practice
6+
---
7+
# 8.99.1 - Knapsack is NP-Complete
8+
Prove that the Knapsack problem is NP-Complete. Relevant lectures:
9+
- [[02.1 - Dynamic Programming 2 - Knapsack]]
10+
- [[08.2 - NP - Knapsack]]
11+
12+
Can't we just reduce from SSS? The book refers to these as being the same problem.
13+
14+
- Input Transformation
15+
- Convert each value from the SSS problem to a knapsack item with value/weight equal to the SSS value.
16+
- Choose the variant of knapsack which disallows repeating items.
17+
- Set $B=g$
18+
- Set $g=g$
19+
- Output Transformation
20+
- If no return no.
21+
- Otherwise, return $S$.
22+
- ~~This one is interesting, because Knapsack does not ever return "No". Instead it attempts to maximize the value gained from the available items, within capacity $B$.~~ Nevermind there's a search variant of Knapsack.
23+
24+
That said, knapsack is a maximizing problem, not a search problem. How do we validate that the result is the max?
25+
26+
From the textbook, a goal $g$ is added to make this problem a search problem.
27+
28+
> We are also given a weight capacity $W$ and a goal $g$ (the former is present in the original optimization problem, the latter is added to make it a search problem).
29+
30+
So in the search variant of the knapsack problem, we simply add $g=g$ to ensure that the goal is the same as the capacity.

OMSCS/Courses/GA/Practice Problems/Suggested NP Theory Problems.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ tags:
1414
- **8.14** – Clique & Independent Set
1515
- [[8.14 - Clique + IS]]
1616
- **8.15** – Maximum Common Subgraph
17-
- [[8.15 - Maximum Common Subgraph]]
17+
- [[8.15 - Maximum Common Subgraph (TODO)]]
1818
- **8.17** – problem Π
1919
- [[8.17 - Problem Pi]]
2020
- **8.20** – Dominating Set

0 commit comments

Comments
 (0)