complete graphs a complete graph is one where there is an edge between every two nodes a c b g
TRANSCRIPT
Complete Graphs
A complete graph is one where there is an edge between every two nodes
A
CB
G
Clique
•Clique: A complete subgraph of a graph
A
CB
D
F
G
E
H1020
16
46
8 24
20
69
13
12
•Problem (Clique): Find the clique with the largest number of nodes in a graph
CNF Can Be Reduced into Clique
•First we need to formulate Clique as a decision problem:
•Decision Problem (Clique): Given a graph and a value K, is there a clique of size K (i.e., with K nodes) in the graph?
We will transform CNF formulas into clique problems such that the formulas can be satisfied if and only if the decision problem for the Clique is true
We are going to show: CNF Clique
CNF Can Be Reduced Into Clique (II)
= (a) (¬a ¬b c d) (¬c ¬d) (¬d)
a
¬a ¬b c d
¬c
¬d
¬d
Connect two nodes from different disjunctions if they are not in conflict (i.e., a and ¬a are in conflict)
Can be made true if and only if there is a Clique of size 4
CNF Can Be Reduced Into Clique (II)
Generally for a given CNF: 1 2 … n
it can be made true if and only if there is a Clique of size n for the corresponding graph
Vertex-Cover
A
CB
D
F
G
E
H1020
16
46
8 24
20
69
13
12
Given a graph G, a vertex cover V is a collection of nodes in G such that for every arc (w,v) either w is in G or v is in G or both
Vertex-Cover Problem: Given a graph, find the vertex-cover containing the minimum number of nodes
Vertex-Cover is NP-Hard
• Hint: 1. Use the complement of a graph. 2. Make simple examples (e.g., graphs with 4-5 nodes)
•Given a graph G, the complement GC is a graph containing the same nodes as G, and the arcs: {(u,v) : (u,v) is not in G}
G: GC :
You are going to show: Clique Vertex-Cover
Independent Set
Given a graph G, an independent set V is a collection of nodes in G such that no two nodes in V have an arc connecting them
A
CB
D
F
G
E
H1020
16
46
8 24
20
69
13
12 U
Independent Set
Independent-Set Problem: Given a graph, find the Independent-set containing the maximum number of nodes
You are going to show: Vertex-Cover Independent-Set
Hint: look at the hint for the transformation of Clique into Vertex-Cover
Constraint-SAT
Definition. A constraint is an expression of the form: (x = y)(x y)
Where x and y are variables that can take values from a set (e.g., {1, 2, 3, 4, …})
Definition. Constraint-SAT: given a sequence of constraints connected by :
1 2 … n
find assignments of the variables that makes the conjunction true
For example: ( x = y) ( x z) (y z)