Graph Theory
Definitions
A graph is made of a set of vertices (also called nodes) together with a set of edges. We write .
A graph is undirected whenever each of its edges in is an unordered pair and .
Let be a graph. Two vertices are said to be adjacent if there is an edge between and .
An edge is said to be incident to a vertex if one of the two endpoints of is .
The degree of a vertex is equal to the number of edges incident to .
Let be a directed graph. The out-degree of a vertex is equal to the number of edges such that is the starting point of .
Let be a directed graph. The in-degree of a vertex is equal to the number of edges such that is the endpoint of .
Let be an undirected graph. A path of length greater than zero that begins and ends at the same vertex is called a cycle.
Let be a directed graph. A (directed) path of length greater than zero that begins and ends at the same vertex is called a (directed) cycle.
Let be an undirected graph and be two vertices. A path of length k between and is a sequence of vertices.
Let be an undirected graph. We say that is connected if for all vertices , there is a path between and .
Let be a directed graph and be two vertices. A (directed) path of length from to is a sequence of vertices such that and
Theorem (Handshaking Lemma)
Let be a graph, then .
Theorem
Let be a graph. Then has an even number of vertices with an odd degree.
Planar Graphs
A graph is planar if it can be drawn on a plan such that the edges don't intersect.
A graph with vertices has at most edges.
Theorem (Euler's Formula)
Let be a planar and connected graph.
Let and = the number of faces. Then, ,
Lemma
All planar graphs have a vertex of degree at most 5.
Graph Coloration
Give a color to each vertex such that all adjacent vertices have different colors.
Theorem
We can color all planar graphs with at most 6 colors.
Bipartite Graphs
A graph is bipartite if or and all edges in have a vertex in and a vertex in .
Theorem
A graph is 2-colorable if and only if it is bipartite.
Eulerian
Let be a non-directed graph. A cycle (or a path) in G that visits each edge of exactly once is called Eulerian.
Theorem
Let be a non-directed and connected graph. G admits an Euler cycle if and only if all vertices have an even degree.
Theorem
Let be a non-directed graph. admits a Eulerian path that is not a cycle if and only if there are exactly two vertices and of odd degree. This path starts at and finished at or vice-versa.
Hamiltonian
Let be a non-directed graph. A cycle (or a path) in G that visits each vertex exactly once is called Hamiltonian. In this case the first point is visited twice.
Given a cycle or path:
- it is easy to verify if it is Hamiltonian
- does it visit each vertex exactly once?
- it is easy to verify it is is Eulerian
- does it visit each edge exactly once?
Given a non-directed graph:
- it is difficult to verify if it admits a Hamiltonian cycle (or path).
- it is easy to verify if it admits a Eulerian cycle or path
- verify if it satisfies the previous theorem for Eulerian.
Matching
Let be a non-directed graph. A matching is a set of of edges that have no vertices in common.
A matching is called maximum if it contains the greatest number of edges possible.
Application:
- assigning tasks to a group of people.