Graph Theory

Definitions

A graph GG is made of a set VV of vertices (also called nodes) together with a set EE of edges. We write G=(V,E)G=(V,E).

A graph is undirected whenever each of its edges in EE is an unordered pair {u,v}\{u,v\} and uvu \neq v.

Let G=(V,E)G = (V, E) be a graph. Two vertices u,vVu, v ∈ V are said to be adjacent if there is an edge between uu and vv.

An edge eEe ∈ E is said to be incident to a vertex uVu ∈ V if one of the two endpoints of ee is uu.

The degree of a vertex uVu ∈ V is equal to the number of edges incident to uu.

Let G=(V,E)G = (V, E) be a directed graph. The out-degree of a vertex uVu ∈ V is equal to the number of edges ee such that uu is the starting point of ee.

Let G=(V,E)G = (V, E) be a directed graph. The in-degree of a vertex uVu ∈ V is equal to the number of edges ee such that uu is the endpoint of ee.

deg(u)=indeg(u)+outdeg(u)deg(u) = \mathrm{indeg}(u) + \mathrm{outdeg}(u)

Let G=(V,E)G = (V, E) be an undirected graph. A path of length greater than zero that begins and ends at the same vertex is called a cycle.

Let G=(V,E)G = (V, E) 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 G=(V,E)G = (V, E) be an undirected graph and u,vVu, v ∈ V be two vertices. A path of length k between uu and vv is a sequence of vertices.

Let G=(V,E)G = (V, E) be an undirected graph. We say that GG is connected if for all vertices u,vVu, v ∈ V, there is a path between uu and vv.

Let G=(V,E)G = (V, E) be a directed graph and u,vVu, v \in V be two vertices. A (directed) path of length kk from uu to vv is a sequence of vertices x0,x1,...,xkx_0, x_1, ..., x_k such that x0=u,xk=vx_0 = u, x_k = v and (x0,x1)E,(x1,x2)E,...,(xk1,xk)E(x_0, x_1) \in E, (x_1, x_2) \in E, ..., (x_{k-1}, x_k) \in E

Theorem (Handshaking Lemma)

Let G=(V,E)G = (V, E) be a graph, then uVdeg(u)=2E\sum_{u \in V} \mathrm{deg}(u) = 2|E|.

Theorem

Let G=(V,E)G = (V, E) be a graph. Then GG 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 vv vertices has at most v2v^2 edges.

Theorem (Euler's Formula)

Let G=(V,E)G = (V, E) be a planar and connected graph.

Let v=V,e=Ev = |V|, e = |E| and ff = the number of faces. Then, ve+f=2v-e+f = 2, e3v6e \leq 3v-6

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 G=(V,E)G = (V,E) is bipartite if V=v1v2V=v_1 \cup v_2 or v1v2=v_1 \cap v_2 = \varnothing and all edges in EE have a vertex in v1v_1 and a vertex in v2v_2.

Theorem

A graph is 2-colorable if and only if it is bipartite.

Eulerian

Let G=(V,E)G=(V,E) be a non-directed graph. A cycle (or a path) in G that visits each edge of EE exactly once is called Eulerian.

Theorem

Let G=(V,E)G=(V,E) be a non-directed and connected graph. G admits an Euler cycle if and only if all vertices have an even degree.

Theorem

Let G=(V,E)G = (V,E) be a non-directed graph. GG admits a Eulerian path that is not a cycle if and only if there are exactly two vertices U1U_1 and U2U_2 of odd degree. This path starts at U1U_1 and finished at U2U_2 or vice-versa.

Hamiltonian

Let G=(V,E)G = (V,E) 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 G=(V,E)G = (V,E) be a non-directed graph. A matching is a set of EEE \subseteq E 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.