0% found this document useful (0 votes)
3 views101 pages

01_intro_complexity

The document outlines a course on Algorithmic Complexity at Université Paris Cité, focusing on measuring the difficulty of problems in relation to algorithm efficiency in terms of time and space. It covers the basics of complexity theory, various complexity classes, and problem classifications, including decision, function, enumeration, and optimization problems. Additionally, it introduces concepts such as asymptotic bounds, mappings, and graph theory, providing a foundation for understanding algorithmic complexity.

Uploaded by

chikhimedwassim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views101 pages

01_intro_complexity

The document outlines a course on Algorithmic Complexity at Université Paris Cité, focusing on measuring the difficulty of problems in relation to algorithm efficiency in terms of time and space. It covers the basics of complexity theory, various complexity classes, and problem classifications, including decision, function, enumeration, and optimization problems. Additionally, it introduces concepts such as asymptotic bounds, mappings, and graph theory, providing a foundation for understanding algorithmic complexity.

Uploaded by

chikhimedwassim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 101

Université Paris Cité – LIPADE

Algorithmic Complexity
Introduction

Jean-Guy Mailly ([email protected])

2023
Infos sur l’UE
1

I Jean-Guy Mailly : [email protected]


Bureau 814 I
I 15h de cours : lundi, 11h00–12h30, Curie A
I 15h de TD : lundi, 15h45–17h15, Vieussens B (IAD/VMI)
jeudi, 13h30–15h00, Cordier D (DCI/RSA)
I Modalités de contrôle de connaissances :
I Un contrôle continu vers la mi-semestre
I Un examen en fin de semestre
I Note finale : max(EX , EX +CC )
2
I Moodle: Cours IFFAX020 Complexité Algorithmique
https://moodle.u-paris.fr/course/view.php?id=5486

J.-G. Mailly | Intro to Complexity


Aims
2

Algorithmic Complexity
Measure the hardness of a problem w.r.t. the efficiency of algorithms
to solve it
I Time
I Space

Goal of the Course


I Bases of complexity theory
I Main complexity classes (time and space)
I Complexity of usual problems
I Being able to determine the complexity of a problem

J.-G. Mailly | Intro to Complexity


Resources
3

When solving a problem, two kinds of resources are used


I time
I number of seconds
I number of steps for the computation
I space
I number of bytes used to execute the program
I number of variables used to represent and solve the problem

Complexity Theory
I Classification of problems w.r.t. the resources required to solve
them
I The more we need time and/or space, the harder it is
I Comparison of problems (depending on the class they belong)
I Solving problems by translating them into other problems (with
the same complexity)

J.-G. Mailly | Intro to Complexity


Outline
4

Mappings and Asymptotic Bounds

Problems and Languages

Graph Theory
Non-Directed Graphs
Directed Graphs

Logic

J.-G. Mailly | Intro to Complexity


Mappings and Asymptotic Bounds
5

Integer mappings
We use mappings f : N → N to represent the time (or space) used to
solve a problem
I Intuition: If the problem entry has size n, f (n) steps are required
to compute the result
I If needed, we use the closest integer value (e.g. log(n) means
dlog(n)e)

J.-G. Mailly | Intro to Complexity


Mappings and Asymptotic Bounds
5

Integer mappings
We use mappings f : N → N to represent the time (or space) used to
solve a problem
I Intuition: If the problem entry has size n, f (n) steps are required
to compute the result
I If needed, we use the closest integer value (e.g. log(n) means
dlog(n)e)

Asymptotic bounds – O notation


Given a mapping f , O(f (n)) is the set of mappings g s.t. ∃no , c,

∀n ≥ n0 , g(n) ≤ c × f (n)

I Intuition: When n is large enough, g is smaller than f modulo


some constant c
J.-G. Mailly | Intro to Complexity
Example
6

g(n)

I We suppose that we
have an algorithm
which solves a graphs
problem in
g(n) = 4×n2 +3×n+2
steps, when n is the
size of the graph (i.e.
number of vertices)

n
J.-G. Mailly | Intro to Complexity
Example
6

g(n) 5 × f (n)

I We suppose that we
have an algorithm
which solves a graphs
problem in
g(n) = 4×n2 +3×n+2
steps, when n is the
size of the graph (i.e.
number of vertices)
I When n becomes large
enough, g(n) ≤
5 × f (n) = 5 × n2 , so
g(n) ∈ O(n2 )
n
J.-G. Mailly | Intro to Complexity
Example
6

g(n) 5 × f (n)

I We suppose that we
have an algorithm
which solves a graphs
problem in
g(n) = 4×n2 +3×n+2
steps, when n is the
size of the graph (i.e.
number of vertices)
I When n becomes large
enough, g(n) ≤
5 × f (n) = 5 × n2 , so
g(n) ∈ O(n2 )

n0 n
J.-G. Mailly | Intro to Complexity
On Usual O Families
7

From Slow to Fast Increase


C is an arbitrary constant, and log is any logarithmic function
Family of Functions Name
O(1) Constant
O(log(n)) Logarithmic
O((log(n))c ) Polylogarithmic
O(n) Linear
O(n log(n)) Linearithmic
O(n2 ) Quadratic
O(nC ) Polynomial
O(C n ) Exponential
O(n!) Factorial

On the Sum of Functions


If f (n) = g(n) + h(n), O(f (n)) = max(O(g(n), O(h(n))
J.-G. Mailly | Intro to Complexity
Explanation of the O “Hierarchy”
8

I O(1) = {g | ∃n0 , c, ∀n ≥ n0 , g(n) ≤ c × 1}

Fast

O(1)

J.-G. Mailly | Intro to Complexity


Explanation of the O “Hierarchy”
8

I O(1) = {g | ∃n0 , c, ∀n ≥ n0 , g(n) ≤ c × 1}


I O(log(n)) = {g | ∃n0 , c, ∀n ≥ n0 , g(n) ≤ c × log(n)}

Fast

Slower

O(1)

O(log(n))

J.-G. Mailly | Intro to Complexity


Explanation of the O “Hierarchy”
8

I O(1) = {g | ∃n0 , c, ∀n ≥ n0 , g(n) ≤ c × 1}


I O(log(n)) = {g | ∃n0 , c, ∀n ≥ n0 , g(n) ≤ c × log(n)}
I ...

Fast

Slower

O(1) •••

O(log(n))

J.-G. Mailly | Intro to Complexity


Explanation of the O “Hierarchy”
8

I O(1) = {g | ∃n0 , c, ∀n ≥ n0 , g(n) ≤ c × 1}


I O(log(n)) = {g | ∃n0 , c, ∀n ≥ n0 , g(n) ≤ c × log(n)}
I ...
I O(n!) = {g | ∃n0 , c, ∀n ≥ n0 , g(n) ≤ c × n!}
Fast

Slower

O(1) ••• Slower again

O(log(n))

O(n!)

J.-G. Mailly | Intro to Complexity


Outline
9

Mappings and Asymptotic Bounds

Problems and Languages

Graph Theory
Non-Directed Graphs
Directed Graphs

Logic

J.-G. Mailly | Intro to Complexity


Different Kinds of Problems (1/2)
10

Decision Problem, Function Problem


A decision problem over a set of input data E is a mapping from any
element in E to a value in {false, true} (' {0, 1} ' {NO,YES}).
A function problem over a set of input data E is a mapping from any
element in E to a single outcome.

Solving an Equation
Decision Problem Does the equation f (x) = y have a solution?
Function Problem Give a solution of the equation f (x) = y

J.-G. Mailly | Intro to Complexity


Different Kinds of Problems (2/2)
11

Enumeration Problem, Optimization Problem


Given a function problem P,
The enumeration problem ENUM-P over E is a mapping from any
element ei ∈ E to the set of all outcome of P over ei .
The optimization problem OPT-P over E is a mapping from any
element in E to a single outcome which minimizes a given criterion.

Solving an Equation
Enumeration Problem Give all the solutions of the equation f (x) = y
Optimization Problem Give a minimal solution of the equation
f (x) = y

J.-G. Mailly | Intro to Complexity


Languages
12

Definition
I Set of symbols Σ called vocabulary or alphabet.
I A word w is a sequence of symbols w1 w2 . . . wk , with wi ∈ Σ for
all i.
I Σ∗ = {w1 w2 . . . wk | wi ∈ Σ, k ∈ N}
I a language L is any subset of Σ∗ , the complement of L is
L̄ = Σ∗ \ L

Language ' Decision Problem


I For any language L, P(L) is the decision problem:
Given x ∈ Σ∗ , does x belong to L?
I For any decision problem P, L(P) is the language:
{x ∈ instances of P | x is a positive instance of P}

J.-G. Mailly | Intro to Complexity


Outline
13

Mappings and Asymptotic Bounds

Problems and Languages

Graph Theory
Non-Directed Graphs
Directed Graphs

Logic

J.-G. Mailly | Intro to Complexity


Non-Directed Graphs
14

Definition
A non-directed graph is a pair G = hN, Ei where N is the set of nodes
and E ⊆ pairs(N) is the set of edges, with
pairs(N) = {{xi , xj } | xi , xj ∈ N}

J.-G. Mailly | Intro to Complexity


Non-Directed Graphs
14

Definition
A non-directed graph is a pair G = hN, Ei where N is the set of nodes
and E ⊆ pairs(N) is the set of edges, with
pairs(N) = {{xi , xj } | xi , xj ∈ N}

G = hN, Ei, with N = {x1 , x2 , x3 , x4 , x5 , x6 , x7 } and


E = {{x1 , x2 }, {x2 , x3 }, {x3 , x4 }, {x4 , x5 }, {x5 , x6 }, {x6 , x7 }, {x7 , x5 }}

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Subgraphs
15

Definition
A subgraph in a non-directed graph G = hN, Ei is a pair
G0 = hN 0 , E 0 i, with N 0 ⊆ N and E 0 ⊆ pairs(N 0 ) ∩ E. If
E 0 = pairs(N 0 ) ∩ E, we say that G0 is the subgraph of G induced by N 0

J.-G. Mailly | Intro to Complexity


Subgraphs
15

Definition
A subgraph in a non-directed graph G = hN, Ei is a pair
G0 = hN 0 , E 0 i, with N 0 ⊆ N and E 0 ⊆ pairs(N 0 ) ∩ E. If
E 0 = pairs(N 0 ) ∩ E, we say that G0 is the subgraph of G induced by N 0

G0 = h{x1 , x2 , x3 }, {{x1 , x2 }}i is a subgraph of G

x6
⇒ x1 x2 x3
x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Subgraphs
15

Definition
A subgraph in a non-directed graph G = hN, Ei is a pair
G0 = hN 0 , E 0 i, with N 0 ⊆ N and E 0 ⊆ pairs(N 0 ) ∩ E. If
E 0 = pairs(N 0 ) ∩ E, we say that G0 is the subgraph of G induced by N 0

G0 = h{x1 , x2 , x3 }, {{x1 , x2 }}i is a subgraph of G

x6
⇒ x1 x2 x3
x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Subgraphs
15

Definition
A subgraph in a non-directed graph G = hN, Ei is a pair
G0 = hN 0 , E 0 i, with N 0 ⊆ N and E 0 ⊆ pairs(N 0 ) ∩ E. If
E 0 = pairs(N 0 ) ∩ E, we say that G0 is the subgraph of G induced by N 0

G0 = h{x1 , x2 , x3 }, {{x1 , x2 }}i is a subgraph of G


G0 = h{x1 , x2 , x3 }, {{x1 , x2 }, {x2 , x3 }}i is the subgraph of G induced
by {x1 , x2 , x3 }

x6
⇒ x1 x2 x3
x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Subgraphs
15

Definition
A subgraph in a non-directed graph G = hN, Ei is a pair
G0 = hN 0 , E 0 i, with N 0 ⊆ N and E 0 ⊆ pairs(N 0 ) ∩ E. If
E 0 = pairs(N 0 ) ∩ E, we say that G0 is the subgraph of G induced by N 0

G0 = h{x1 , x2 , x3 }, {{x1 , x2 }}i is a subgraph of G


G0 = h{x1 , x2 , x3 }, {{x1 , x2 }, {x2 , x3 }}i is the subgraph of G induced
by {x1 , x2 , x3 }

x6
⇒ x1 x2 x3
x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Chain
16

Definition
A chain in a non-directed graph G = hN, Ei is a vector of nodes
(n1 , . . . , nk ) such that ∀0 ≤ i < k , {ni , ni+1 } ∈ E.

J.-G. Mailly | Intro to Complexity


Chain
16

Definition
A chain in a non-directed graph G = hN, Ei is a vector of nodes
(n1 , . . . , nk ) such that ∀0 ≤ i < k , {ni , ni+1 } ∈ E.

(x3 , x4 , x5 , x6 ) and (x3 , x4 , x5 , x7 ) are chains of G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Chain
16

Definition
A chain in a non-directed graph G = hN, Ei is a vector of nodes
(n1 , . . . , nk ) such that ∀0 ≤ i < k , {ni , ni+1 } ∈ E.

(x3 , x4 , x5 , x6 ) and (x3 , x4 , x5 , x7 ) are chains of G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Chain
16

Definition
A chain in a non-directed graph G = hN, Ei is a vector of nodes
(n1 , . . . , nk ) such that ∀0 ≤ i < k , {ni , ni+1 } ∈ E.

(x3 , x4 , x5 , x6 ) and (x3 , x4 , x5 , x7 ) are chains of G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Chain
16

Definition
A chain in a non-directed graph G = hN, Ei is a vector of nodes
(n1 , . . . , nk ) such that ∀0 ≤ i < k , {ni , ni+1 } ∈ E.

(x3 , x4 , x5 , x6 ) and (x3 , x4 , x5 , x7 ) are chains of G


(x1 , x6 ) is not a chain of G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Chain
16

Definition
A chain in a non-directed graph G = hN, Ei is a vector of nodes
(n1 , . . . , nk ) such that ∀0 ≤ i < k , {ni , ni+1 } ∈ E.

(x3 , x4 , x5 , x6 ) and (x3 , x4 , x5 , x7 ) are chains of G


(x1 , x6 ) is not a chain of G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Clique
17

Definition
A clique in a non-directed graph G = hN, Ei is subgraph
G0 = hN 0 , E 0 i, with N 0 ⊆ N and E 0 ⊆ pairs(N 0 ) ∩ E, such that
∀xi , xj ∈ N 0 , xi 6= xj , {xi , xj } ∈ E 0

J.-G. Mailly | Intro to Complexity


Clique
17

Definition
A clique in a non-directed graph G = hN, Ei is subgraph
G0 = hN 0 , E 0 i, with N 0 ⊆ N and E 0 ⊆ pairs(N 0 ) ∩ E, such that
∀xi , xj ∈ N 0 , xi 6= xj , {xi , xj } ∈ E 0

h{x5 , x6 , x7 }, {{x5 , x6 }, {x6 , x7 }, {x7 , x5 }, }i is a clique in G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Clique
17

Definition
A clique in a non-directed graph G = hN, Ei is subgraph
G0 = hN 0 , E 0 i, with N 0 ⊆ N and E 0 ⊆ pairs(N 0 ) ∩ E, such that
∀xi , xj ∈ N 0 , xi 6= xj , {xi , xj } ∈ E 0

h{x5 , x6 , x7 }, {{x5 , x6 }, {x6 , x7 }, {x7 , x5 }, }i is a clique in G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Cycle
18

Definition
A cycle in a non-directed graph G = hN, Ei is a chain (n1 , . . . , nk )
such that n1 = nk . The length of the cycle is k − 1

J.-G. Mailly | Intro to Complexity


Cycle
18

Definition
A cycle in a non-directed graph G = hN, Ei is a chain (n1 , . . . , nk )
such that n1 = nk . The length of the cycle is k − 1

(x5 , x6 , x7 , x5 ) is a cycle of length 3 in G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Cycle
18

Definition
A cycle in a non-directed graph G = hN, Ei is a chain (n1 , . . . , nk )
such that n1 = nk . The length of the cycle is k − 1

(x5 , x6 , x7 , x5 ) is a cycle of length 3 in G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Directed Graphs
19

Definition
A directed graph is a pair G = hN, Ei where N is the set of nodes and
E ⊆ N × N is the set of edges

J.-G. Mailly | Intro to Complexity


Directed Graphs
19

Definition
A directed graph is a pair G = hN, Ei where N is the set of nodes and
E ⊆ N × N is the set of edges

G = hN, Ei, with N = {x1 , x2 , x3 , x4 , x5 , x6 , x7 } and E =


{(x1 , x2 ), (x2 , x3 ), (x3 , x4 ), (x4 , x3 ), (x4 , x5 ), (x5 , x6 ), (x6 , x7 ), (x7 , x5 )}

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Subgraphs
20

Definition
A subgraph in a directed graph G = hN, Ei is a pair G0 = hN 0 , E 0 i,
with N 0 ⊆ N and E 0 ⊆ (N 0 × N 0 ) ∩ E. If E 0 = (N 0 × N 0 ) ∩ E, we say
that G0 is the subgraph of G induced by N 0

J.-G. Mailly | Intro to Complexity


Subgraphs
20

Definition
A subgraph in a directed graph G = hN, Ei is a pair G0 = hN 0 , E 0 i,
with N 0 ⊆ N and E 0 ⊆ (N 0 × N 0 ) ∩ E. If E 0 = (N 0 × N 0 ) ∩ E, we say
that G0 is the subgraph of G induced by N 0

G0 = h{x1 , x2 , x3 }, {(x1 , x2 )}i is a subgraph of G

x6
⇒ x1 x2 x3
x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Subgraphs
20

Definition
A subgraph in a directed graph G = hN, Ei is a pair G0 = hN 0 , E 0 i,
with N 0 ⊆ N and E 0 ⊆ (N 0 × N 0 ) ∩ E. If E 0 = (N 0 × N 0 ) ∩ E, we say
that G0 is the subgraph of G induced by N 0

G0 = h{x1 , x2 , x3 }, {(x1 , x2 )}i is a subgraph of G

x6
⇒ x1 x2 x3
x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Subgraphs
20

Definition
A subgraph in a directed graph G = hN, Ei is a pair G0 = hN 0 , E 0 i,
with N 0 ⊆ N and E 0 ⊆ (N 0 × N 0 ) ∩ E. If E 0 = (N 0 × N 0 ) ∩ E, we say
that G0 is the subgraph of G induced by N 0

G0 = h{x1 , x2 , x3 }, {(x1 , x2 )}i is a subgraph of G


G0 = h{x1 , x2 , x3 }, {(x1 , x2 ), (x2 , x3 )}i is the subgraph of G induced by
{x1 , x2 , x3 }

x6
⇒ x1 x2 x3
x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Subgraphs
20

Definition
A subgraph in a directed graph G = hN, Ei is a pair G0 = hN 0 , E 0 i,
with N 0 ⊆ N and E 0 ⊆ (N 0 × N 0 ) ∩ E. If E 0 = (N 0 × N 0 ) ∩ E, we say
that G0 is the subgraph of G induced by N 0

G0 = h{x1 , x2 , x3 }, {(x1 , x2 )}i is a subgraph of G


G0 = h{x1 , x2 , x3 }, {(x1 , x2 ), (x2 , x3 )}i is the subgraph of G induced by
{x1 , x2 , x3 }

x6
⇒ x1 x2 x3
x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Path
21

Definition
A path in a directed graph G = hN, Ei is a vector of nodes (n1 , . . . , nk )
such that ∀0 ≤ i < k , (ni , ni+1 ) ∈ E.

J.-G. Mailly | Intro to Complexity


Path
21

Definition
A path in a directed graph G = hN, Ei is a vector of nodes (n1 , . . . , nk )
such that ∀0 ≤ i < k , (ni , ni+1 ) ∈ E.

(x3 , x4 , x5 , x6 ) is a path of G, but (x3 , x4 , x5 , x7 ) is not

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Path
21

Definition
A path in a directed graph G = hN, Ei is a vector of nodes (n1 , . . . , nk )
such that ∀0 ≤ i < k , (ni , ni+1 ) ∈ E.

(x3 , x4 , x5 , x6 ) is a path of G, but (x3 , x4 , x5 , x7 ) is not

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Path
21

Definition
A path in a directed graph G = hN, Ei is a vector of nodes (n1 , . . . , nk )
such that ∀0 ≤ i < k , (ni , ni+1 ) ∈ E.

(x3 , x4 , x5 , x6 ) is a path of G, but (x3 , x4 , x5 , x7 ) is not

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Path
21

Definition
A path in a directed graph G = hN, Ei is a vector of nodes (n1 , . . . , nk )
such that ∀0 ≤ i < k , (ni , ni+1 ) ∈ E.

(x3 , x4 , x5 , x6 ) is a path of G, but (x3 , x4 , x5 , x7 ) is not


(x1 , x6 ) is not a path of G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Path
21

Definition
A path in a directed graph G = hN, Ei is a vector of nodes (n1 , . . . , nk )
such that ∀0 ≤ i < k , (ni , ni+1 ) ∈ E.

(x3 , x4 , x5 , x6 ) is a path of G, but (x3 , x4 , x5 , x7 ) is not


(x1 , x6 ) is not a path of G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Clique
22

Definition
A clique in a directed graph G = hN, Ei is subgraph G0 = hN 0 , E 0 i,
with N 0 ⊆ N and E 0 ⊆ (N 0 × N 0 ) ∩ E, such that ∀xi , xj ∈ N 0 , xi 6= xj ,
(xi , xj ) ∈ E 0

J.-G. Mailly | Intro to Complexity


Clique
22

Definition
A clique in a directed graph G = hN, Ei is subgraph G0 = hN 0 , E 0 i,
with N 0 ⊆ N and E 0 ⊆ (N 0 × N 0 ) ∩ E, such that ∀xi , xj ∈ N 0 , xi 6= xj ,
(xi , xj ) ∈ E 0

h{x5 , x6 , x7 }, {(x5 , x6 ), (x6 , x7 ), (x7 , x5 )}i is not a clique in G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Clique
22

Definition
A clique in a directed graph G = hN, Ei is subgraph G0 = hN 0 , E 0 i,
with N 0 ⊆ N and E 0 ⊆ (N 0 × N 0 ) ∩ E, such that ∀xi , xj ∈ N 0 , xi 6= xj ,
(xi , xj ) ∈ E 0

h{x5 , x6 , x7 }, {(x5 , x6 ), (x6 , x7 ), (x7 , x5 )}i is not a clique in G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Clique
22

Definition
A clique in a directed graph G = hN, Ei is subgraph G0 = hN 0 , E 0 i,
with N 0 ⊆ N and E 0 ⊆ (N 0 × N 0 ) ∩ E, such that ∀xi , xj ∈ N 0 , xi 6= xj ,
(xi , xj ) ∈ E 0

h{x5 , x6 , x7 }, {(x5 , x6 ), (x6 , x7 ), (x7 , x5 )}i is not a clique in G


h{x3 , x4 }, {(x3 , x4 ), (x4 , x3 )}i is a clique in G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Clique
22

Definition
A clique in a directed graph G = hN, Ei is subgraph G0 = hN 0 , E 0 i,
with N 0 ⊆ N and E 0 ⊆ (N 0 × N 0 ) ∩ E, such that ∀xi , xj ∈ N 0 , xi 6= xj ,
(xi , xj ) ∈ E 0

h{x5 , x6 , x7 }, {(x5 , x6 ), (x6 , x7 ), (x7 , x5 )}i is not a clique in G


h{x3 , x4 }, {(x3 , x4 ), (x4 , x3 )}i is a clique in G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Cycle
23

Definition
A cycle in a directed graph G = hN, Ei is a path (n1 , . . . , nk ) such that
n1 = nk . The length of the cycle is k − 1

J.-G. Mailly | Intro to Complexity


Cycle
23

Definition
A cycle in a directed graph G = hN, Ei is a path (n1 , . . . , nk ) such that
n1 = nk . The length of the cycle is k − 1

(x3 , x4 , x3 ) is a cycle of length 2 in G


(x5 , x6 , x7 , x5 ) is a cycle of length 3 in G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Cycle
23

Definition
A cycle in a directed graph G = hN, Ei is a path (n1 , . . . , nk ) such that
n1 = nk . The length of the cycle is k − 1

(x3 , x4 , x3 ) is a cycle of length 2 in G


(x5 , x6 , x7 , x5 ) is a cycle of length 3 in G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Cycle
23

Definition
A cycle in a directed graph G = hN, Ei is a path (n1 , . . . , nk ) such that
n1 = nk . The length of the cycle is k − 1

(x3 , x4 , x3 ) is a cycle of length 2 in G


(x5 , x6 , x7 , x5 ) is a cycle of length 3 in G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Cycle
23

Definition
A cycle in a directed graph G = hN, Ei is a path (n1 , . . . , nk ) such that
n1 = nk . The length of the cycle is k − 1

(x3 , x4 , x3 ) is a cycle of length 2 in G


(x5 , x6 , x7 , x5 ) is a cycle of length 3 in G
(x2 , x3 , x4 , x3 ) is not a cycle of G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Cycle
23

Definition
A cycle in a directed graph G = hN, Ei is a path (n1 , . . . , nk ) such that
n1 = nk . The length of the cycle is k − 1

(x3 , x4 , x3 ) is a cycle of length 2 in G


(x5 , x6 , x7 , x5 ) is a cycle of length 3 in G
(x2 , x3 , x4 , x3 ) is not a cycle of G

x6

x1 x2 x3 x4 x5

x7

J.-G. Mailly | Intro to Complexity


Outline
24

Mappings and Asymptotic Bounds

Problems and Languages

Graph Theory
Non-Directed Graphs
Directed Graphs

Logic

J.-G. Mailly | Intro to Complexity


Propositional Logic
25

Definition
Propositional logic is a mathematical formalism which studies
propositions, i.e. logical objects which can be true or false. A
propositional formula is the combinations of propositions with
connectives

J.-G. Mailly | Intro to Complexity


Propositional Logic
25

Definition
Propositional logic is a mathematical formalism which studies
propositions, i.e. logical objects which can be true or false. A
propositional formula is the combinations of propositions with
connectives
Examples of propositions:
I it’s raining
I it’s sunny
I I need an umbrella
I I need sunscreen

J.-G. Mailly | Intro to Complexity


Propositional Logic
25

Definition
Propositional logic is a mathematical formalism which studies
propositions, i.e. logical objects which can be true or false. A
propositional formula is the combinations of propositions with
connectives
Examples of propositions:
I it’s raining
I it’s sunny
I I need an umbrella
I I need sunscreen
Propositions are usually represented by Boolean variables, i.e.
mathematical objects which can be assigned a value from a binary
set B = {0, 1} (sometimes written {False, True} or {⊥, >})

J.-G. Mailly | Intro to Complexity


Syntax of Propositional Logic
26

Let V = {x1 , . . . , xn } be a set of Boolean variables


atom ∀xi ∈ V , xi is a (well-formed) formula
negation if ϕ is a formula, then ¬ϕ is a formula
conjunction if ϕ1 and ϕ2 are formulas, then ϕ1 ∧ ϕ2 is a formula

J.-G. Mailly | Intro to Complexity


Syntax of Propositional Logic
26

Let V = {x1 , . . . , xn } be a set of Boolean variables


atom ∀xi ∈ V , xi is a (well-formed) formula
negation if ϕ is a formula, then ¬ϕ is a formula
conjunction if ϕ1 and ϕ2 are formulas, then ϕ1 ∧ ϕ2 is a formula
disjunction if ϕ1 and ϕ2 are formulas, then ϕ1 ∨ ϕ2 is a formula

J.-G. Mailly | Intro to Complexity


Syntax of Propositional Logic
26

Let V = {x1 , . . . , xn } be a set of Boolean variables


atom ∀xi ∈ V , xi is a (well-formed) formula
negation if ϕ is a formula, then ¬ϕ is a formula
conjunction if ϕ1 and ϕ2 are formulas, then ϕ1 ∧ ϕ2 is a formula
disjunction if ϕ1 and ϕ2 are formulas, then ϕ1 ∨ ϕ2 is a formula
implication if ϕ1 and ϕ2 are formulas, then ϕ1 ⇒ ϕ2 is a formula

J.-G. Mailly | Intro to Complexity


Syntax of Propositional Logic
26

Let V = {x1 , . . . , xn } be a set of Boolean variables


atom ∀xi ∈ V , xi is a (well-formed) formula
negation if ϕ is a formula, then ¬ϕ is a formula
conjunction if ϕ1 and ϕ2 are formulas, then ϕ1 ∧ ϕ2 is a formula
disjunction if ϕ1 and ϕ2 are formulas, then ϕ1 ∨ ϕ2 is a formula
implication if ϕ1 and ϕ2 are formulas, then ϕ1 ⇒ ϕ2 is a formula
equivalence if ϕ1 and ϕ2 are formulas, then ϕ1 ⇔ ϕ2 is a formula

J.-G. Mailly | Intro to Complexity


Syntax of Propositional Logic
26

Let V = {x1 , . . . , xn } be a set of Boolean variables


atom ∀xi ∈ V , xi is a (well-formed) formula
negation if ϕ is a formula, then ¬ϕ is a formula
conjunction if ϕ1 and ϕ2 are formulas, then ϕ1 ∧ ϕ2 is a formula
disjunction if ϕ1 and ϕ2 are formulas, then ϕ1 ∨ ϕ2 is a formula
implication if ϕ1 and ϕ2 are formulas, then ϕ1 ⇒ ϕ2 is a formula
equivalence if ϕ1 and ϕ2 are formulas, then ϕ1 ⇔ ϕ2 is a formula
We use parentheses to simplify the reading and clarify priorities

J.-G. Mailly | Intro to Complexity


Syntax of Propositional Logic
26

Let V = {x1 , . . . , xn } be a set of Boolean variables


atom ∀xi ∈ V , xi is a (well-formed) formula
negation if ϕ is a formula, then ¬ϕ is a formula
conjunction if ϕ1 and ϕ2 are formulas, then ϕ1 ∧ ϕ2 is a formula
disjunction if ϕ1 and ϕ2 are formulas, then ϕ1 ∨ ϕ2 is a formula
implication if ϕ1 and ϕ2 are formulas, then ϕ1 ⇒ ϕ2 is a formula
equivalence if ϕ1 and ϕ2 are formulas, then ϕ1 ⇔ ϕ2 is a formula
We use parentheses to simplify the reading and clarify priorities

Formulas Not Formulas

I x1 , ¬x1 , ¬¬x1 I x1 ¬, ¬x1 ¬


I x1 ∧ x2 , x1 ∨ x2 I x1 ∧, ∨x1
I x1 ∧ (x3 ∨ (x4 ⇒ x1 )) I x1 ⇒ (∨x2 )
I ϕ∧ψ I ∧ψ
J.-G. Mailly | Intro to Complexity
Semantics of Propositional Logic
27

Let V = {x1 , . . . , xn } be a set of Boolean variables. An interpretation


ω is a mapping from V to B. Interpretations can be extended to
formulas:
atom if ϕ = xi , then ω(ϕ) = ω(xi )
negation if ϕ = ¬ϕ1 , then ω(ϕ) = 1 − ω(ϕ1 )
conjunction if ϕ = ϕ1 ∧ ϕ2 , then ω(ϕ) = min(ω(ϕ1 ), ω(ϕ2 ))

J.-G. Mailly | Intro to Complexity


Semantics of Propositional Logic
27

Let V = {x1 , . . . , xn } be a set of Boolean variables. An interpretation


ω is a mapping from V to B. Interpretations can be extended to
formulas:
atom if ϕ = xi , then ω(ϕ) = ω(xi )
negation if ϕ = ¬ϕ1 , then ω(ϕ) = 1 − ω(ϕ1 )
conjunction if ϕ = ϕ1 ∧ ϕ2 , then ω(ϕ) = min(ω(ϕ1 ), ω(ϕ2 ))
disjunction if ϕ = ϕ1 ∨ ϕ2 , then ω(ϕ) = max(ω(ϕ1 ), ω(ϕ2 ))

J.-G. Mailly | Intro to Complexity


Semantics of Propositional Logic
27

Let V = {x1 , . . . , xn } be a set of Boolean variables. An interpretation


ω is a mapping from V to B. Interpretations can be extended to
formulas:
atom if ϕ = xi , then ω(ϕ) = ω(xi )
negation if ϕ = ¬ϕ1 , then ω(ϕ) = 1 − ω(ϕ1 )
conjunction if ϕ = ϕ1 ∧ ϕ2 , then ω(ϕ) = min(ω(ϕ1 ), ω(ϕ2 ))
disjunction if ϕ = ϕ1 ∨ ϕ2 , then ω(ϕ) = max(ω(ϕ1 ), ω(ϕ2 ))
implication if ϕ = ϕ1 ⇒ ϕ2 , then ω(ϕ) = ω(¬ϕ1 ∨ ϕ2 )

J.-G. Mailly | Intro to Complexity


Semantics of Propositional Logic
27

Let V = {x1 , . . . , xn } be a set of Boolean variables. An interpretation


ω is a mapping from V to B. Interpretations can be extended to
formulas:
atom if ϕ = xi , then ω(ϕ) = ω(xi )
negation if ϕ = ¬ϕ1 , then ω(ϕ) = 1 − ω(ϕ1 )
conjunction if ϕ = ϕ1 ∧ ϕ2 , then ω(ϕ) = min(ω(ϕ1 ), ω(ϕ2 ))
disjunction if ϕ = ϕ1 ∨ ϕ2 , then ω(ϕ) = max(ω(ϕ1 ), ω(ϕ2 ))
implication if ϕ = ϕ1 ⇒ ϕ2 , then ω(ϕ) = ω(¬ϕ1 ∨ ϕ2 )
equivalence if ϕ = ϕ1 ⇔ ϕ2 , then ω(ϕ) = ω((ϕ1 ⇒ ϕ2 ) ∧ (ϕ2 ⇒ ϕ1 ))

J.-G. Mailly | Intro to Complexity


Semantics of Propositional Logic
Example of Interpretation
28

V = {x1 , x2 , x3 , x4 }, ω(x1 ) = ω(x4 ) = 0, ω(x2 ) = ω(x3 ) = 1


I ω(¬x1 ) = 1 − ω(x1 ) = 1, ω(¬x2 ) = 1 − ω(x2 ) = 0

J.-G. Mailly | Intro to Complexity


Semantics of Propositional Logic
Example of Interpretation
28

V = {x1 , x2 , x3 , x4 }, ω(x1 ) = ω(x4 ) = 0, ω(x2 ) = ω(x3 ) = 1


I ω(¬x1 ) = 1 − ω(x1 ) = 1, ω(¬x2 ) = 1 − ω(x2 ) = 0

Intuitively:
I the negation takes the opposite of the original value

J.-G. Mailly | Intro to Complexity


Semantics of Propositional Logic
Example of Interpretation
28

V = {x1 , x2 , x3 , x4 }, ω(x1 ) = ω(x4 ) = 0, ω(x2 ) = ω(x3 ) = 1


I ω(¬x1 ) = 1 − ω(x1 ) = 1, ω(¬x2 ) = 1 − ω(x2 ) = 0
I ω(x1 ∧ x2 ) = min(ω(x1 ), ω(x2 )) = min(0, 1) = 0

Intuitively:
I the negation takes the opposite of the original value

J.-G. Mailly | Intro to Complexity


Semantics of Propositional Logic
Example of Interpretation
28

V = {x1 , x2 , x3 , x4 }, ω(x1 ) = ω(x4 ) = 0, ω(x2 ) = ω(x3 ) = 1


I ω(¬x1 ) = 1 − ω(x1 ) = 1, ω(¬x2 ) = 1 − ω(x2 ) = 0
I ω(x1 ∧ x2 ) = min(ω(x1 ), ω(x2 )) = min(0, 1) = 0
I ω(x2 ∧ x3 ) = min(ω(x2 ), ω(x3 )) = min(1, 1) = 1

Intuitively:
I the negation takes the opposite of the original value

J.-G. Mailly | Intro to Complexity


Semantics of Propositional Logic
Example of Interpretation
28

V = {x1 , x2 , x3 , x4 }, ω(x1 ) = ω(x4 ) = 0, ω(x2 ) = ω(x3 ) = 1


I ω(¬x1 ) = 1 − ω(x1 ) = 1, ω(¬x2 ) = 1 − ω(x2 ) = 0
I ω(x1 ∧ x2 ) = min(ω(x1 ), ω(x2 )) = min(0, 1) = 0
I ω(x2 ∧ x3 ) = min(ω(x2 ), ω(x3 )) = min(1, 1) = 1

Intuitively:
I the negation takes the opposite of the original value
I the conjunction is true iff both values are true

J.-G. Mailly | Intro to Complexity


Semantics of Propositional Logic
Example of Interpretation
28

V = {x1 , x2 , x3 , x4 }, ω(x1 ) = ω(x4 ) = 0, ω(x2 ) = ω(x3 ) = 1


I ω(¬x1 ) = 1 − ω(x1 ) = 1, ω(¬x2 ) = 1 − ω(x2 ) = 0
I ω(x1 ∧ x2 ) = min(ω(x1 ), ω(x2 )) = min(0, 1) = 0
I ω(x2 ∧ x3 ) = min(ω(x2 ), ω(x3 )) = min(1, 1) = 1
I ω(x1 ∨ x2 ) = max(ω(x1 ), ω(x2 )) = max(0, 1) = 1

Intuitively:
I the negation takes the opposite of the original value
I the conjunction is true iff both values are true

J.-G. Mailly | Intro to Complexity


Semantics of Propositional Logic
Example of Interpretation
28

V = {x1 , x2 , x3 , x4 }, ω(x1 ) = ω(x4 ) = 0, ω(x2 ) = ω(x3 ) = 1


I ω(¬x1 ) = 1 − ω(x1 ) = 1, ω(¬x2 ) = 1 − ω(x2 ) = 0
I ω(x1 ∧ x2 ) = min(ω(x1 ), ω(x2 )) = min(0, 1) = 0
I ω(x2 ∧ x3 ) = min(ω(x2 ), ω(x3 )) = min(1, 1) = 1
I ω(x1 ∨ x2 ) = max(ω(x1 ), ω(x2 )) = max(0, 1) = 1
I ω(x1 ∨ x4 ) = max(ω(x1 ), ω(x4 )) = max(0, 0) = 0
Intuitively:
I the negation takes the opposite of the original value
I the conjunction is true iff both values are true

J.-G. Mailly | Intro to Complexity


Semantics of Propositional Logic
Example of Interpretation
28

V = {x1 , x2 , x3 , x4 }, ω(x1 ) = ω(x4 ) = 0, ω(x2 ) = ω(x3 ) = 1


I ω(¬x1 ) = 1 − ω(x1 ) = 1, ω(¬x2 ) = 1 − ω(x2 ) = 0
I ω(x1 ∧ x2 ) = min(ω(x1 ), ω(x2 )) = min(0, 1) = 0
I ω(x2 ∧ x3 ) = min(ω(x2 ), ω(x3 )) = min(1, 1) = 1
I ω(x1 ∨ x2 ) = max(ω(x1 ), ω(x2 )) = max(0, 1) = 1
I ω(x1 ∨ x4 ) = max(ω(x1 ), ω(x4 )) = max(0, 0) = 0
Intuitively:
I the negation takes the opposite of the original value
I the conjunction is true iff both values are true
I the disjunction is true iff at least one of the values is true

J.-G. Mailly | Intro to Complexity


Other Notations for Interpretations
29

Sets of Atoms
I An interpretation can be written as the set of atoms which are
assigned 1

J.-G. Mailly | Intro to Complexity


Other Notations for Interpretations
29

Sets of Atoms
I An interpretation can be written as the set of atoms which are
assigned 1
I Example: V = {x1 , x2 , x3 }, ω(x1 ) = 0, ω(x2 ) = ω(x3 ) = 1 is
equivalent to ω = {x2 , x3 }

J.-G. Mailly | Intro to Complexity


Other Notations for Interpretations
29

Sets of Atoms
I An interpretation can be written as the set of atoms which are
assigned 1
I Example: V = {x1 , x2 , x3 }, ω(x1 ) = 0, ω(x2 ) = ω(x3 ) = 1 is
equivalent to ω = {x2 , x3 }

Vectors of Bits
I An interpretation can be written as a vector of 0 and 1; the order
has to be fixed (usually lexicographical order)

J.-G. Mailly | Intro to Complexity


Other Notations for Interpretations
29

Sets of Atoms
I An interpretation can be written as the set of atoms which are
assigned 1
I Example: V = {x1 , x2 , x3 }, ω(x1 ) = 0, ω(x2 ) = ω(x3 ) = 1 is
equivalent to ω = {x2 , x3 }

Vectors of Bits
I An interpretation can be written as a vector of 0 and 1; the order
has to be fixed (usually lexicographical order)
I Example: V = {x1 , x2 , x3 }, ω(x1 ) = 0, ω(x2 ) = ω(x3 ) = 1 is
equivalent to ω = 011

J.-G. Mailly | Intro to Complexity


Satisfaction of Formulas
30

I If ω(ϕ) = 1, then ω is a model of ϕ. We also say that ϕ is


satisfied by ω
I If ω(ϕ) = 0, then ω is a counter-model of ϕ
I mod(ϕ) is the set of models of ϕ
I If mod(ϕ) = ∅, then ϕ is inconsistent (or insatisfiable)
I If mod(ϕ) 6= ∅, then ϕ is consistent (or satisfiable)
I If mod(ϕ) is the set of all possible interpretations, then ϕ is valid

J.-G. Mailly | Intro to Complexity


Satisfaction, Consequence, Equivalence
31

We define some meta-language symbols for reasoning about


interpretations and formulas:
I ω |= ϕ means that (the interpretation) ω satisfies (the formula) ϕ,
i.e. ω ∈ mod(ϕ)
I ϕ ` ψ means that (the formula) ψ is a consequence of (the
formula) ϕ, formally defined as mod(ϕ) ⊆ mod(ψ)
I ϕ ≡ ψ means that ϕ and ψ are equivalent, formally defined as
ϕ ` ψ and ψ ` ϕ (which implies mod(ϕ) = mod(ψ))

J.-G. Mailly | Intro to Complexity


Normal Forms
32

I A formula is a literal iff it is an atom or the negation of an atom


x1 and ¬x1 are literals; x1 ∨ x2 is not a literal

J.-G. Mailly | Intro to Complexity


Normal Forms
32

I A formula is a literal iff it is an atom or the negation of an atom


x1 and ¬x1 are literals; x1 ∨ x2 is not a literal
I A formula is a clause iff it is a disjunction of literals
x1 ∨ x2 ∨ ¬x3 is a clause ; x1 ∨ (x2 ∧ x3 ) is not a clause

J.-G. Mailly | Intro to Complexity


Normal Forms
32

I A formula is a literal iff it is an atom or the negation of an atom


x1 and ¬x1 are literals; x1 ∨ x2 is not a literal
I A formula is a clause iff it is a disjunction of literals
x1 ∨ x2 ∨ ¬x3 is a clause ; x1 ∨ (x2 ∧ x3 ) is not a clause
I A formula is a cube iff it is a conjunction of literals
x1 ∧ x2 ∧ ¬x3 is a cube ; x1 ∧ (x2 ∨ x3 ) is not a cube

J.-G. Mailly | Intro to Complexity


Normal Forms
32

I A formula is a literal iff it is an atom or the negation of an atom


x1 and ¬x1 are literals; x1 ∨ x2 is not a literal
I A formula is a clause iff it is a disjunction of literals
x1 ∨ x2 ∨ ¬x3 is a clause ; x1 ∨ (x2 ∧ x3 ) is not a clause
I A formula is a cube iff it is a conjunction of literals
x1 ∧ x2 ∧ ¬x3 is a cube ; x1 ∧ (x2 ∨ x3 ) is not a cube

Conjunctive Normal Form


A formula is in Conjunctive Normal Form (CNF) iff it is a conjunction
of clauses

J.-G. Mailly | Intro to Complexity


Normal Forms
32

I A formula is a literal iff it is an atom or the negation of an atom


x1 and ¬x1 are literals; x1 ∨ x2 is not a literal
I A formula is a clause iff it is a disjunction of literals
x1 ∨ x2 ∨ ¬x3 is a clause ; x1 ∨ (x2 ∧ x3 ) is not a clause
I A formula is a cube iff it is a conjunction of literals
x1 ∧ x2 ∧ ¬x3 is a cube ; x1 ∧ (x2 ∨ x3 ) is not a cube

Conjunctive Normal Form


A formula is in Conjunctive Normal Form (CNF) iff it is a conjunction
of clauses

Disjunctive Normal Form


A formula is in Disjunctive Normal Form (DNF) iff it is a disjunction of
cubes

J.-G. Mailly | Intro to Complexity


Normal Forms
Examples
33

Examples of CNF formulas


I (x1 ∨ x2 ) ∧ (x3 ∨ x4 )
I (x1 ∨ ¬x2 ∨ x5 ) ∧ (x3 ∨ x5 )

Examples of DNF formulas


I (x1 ∧ x2 ) ∨ (x3 ∧ x4 )
I x1 ∨ (x2 ∧ x4 ) ∨ (x3 ∧ x4 ∧ ¬x5 )

J.-G. Mailly | Intro to Complexity


Normal Forms
Semantics of CNF Formulas 34

I A clause is satisfied if at least one of its literals is satisfied


I A CNF formula is satisfied if all its clauses are satisfied

Example
With ω(x1 ) = ω(x2 ) = 1 and ω(x3 ) = ω(x4 ) = 0
I (x1 ∨ x2 ) ∧ (x3 ∨ x4 ) is not satisfied

J.-G. Mailly | Intro to Complexity


Normal Forms
Semantics of CNF Formulas 34

I A clause is satisfied if at least one of its literals is satisfied


I A CNF formula is satisfied if all its clauses are satisfied

Example
With ω(x1 ) = ω(x2 ) = 1 and ω(x3 ) = ω(x4 ) = 0
I (x1 ∨ x2 ) ∧ (x3 ∨ x4 ) is not satisfied
With ω(x1 ) = ω(x3 ) = 1 and ω(x2 ) = ω(x4 ) = 0
I (x1 ∨ x2 ) ∧ (x3 ∨ x4 ) is satisfied

J.-G. Mailly | Intro to Complexity


Normal Forms
Semantics of DNF Formulas 35

I A cube is satisfied if all its literals are satisfied


I A DNF formula is satisfied if at least one of its cubes is satisfied

Example
With ω(x1 ) = ω(x3 ) = 1 and ω(x2 ) = ω(x4 ) = 0
I (x1 ∧ x2 ) ∨ (x3 ∧ x4 ) is not satisfied

J.-G. Mailly | Intro to Complexity


Normal Forms
Semantics of DNF Formulas 35

I A cube is satisfied if all its literals are satisfied


I A DNF formula is satisfied if at least one of its cubes is satisfied

Example
With ω(x1 ) = ω(x3 ) = 1 and ω(x2 ) = ω(x4 ) = 0
I (x1 ∧ x2 ) ∨ (x3 ∧ x4 ) is not satisfied
With ω(x1 ) = ω(x2 ) = 1 and ω(x3 ) = ω(x4 ) = 0
I (x1 ∧ x2 ) ∨ (x3 ∧ x4 ) is satisfied

J.-G. Mailly | Intro to Complexity

You might also like