Graphs (TODO)
Graphs (TODO)
Connectivity
💡 Let be a graph. is called connected if it holds for all that: there exists a --path in .
💡 A graph is called -connected when:
- and
- is a connected graph with
i.e., one has to remove at least vertices (and adjacent edges) in order to turn the graph into a disconnected graph.
💡 If contains a vertex with degree , then is not -connected.
📖 Menger’s Theorem (Vertices):
Let be a graph. Then it holds that is -connected if and only if there exist disjoint --paths.
💡 Let be a graph. is called -edge-connected when:
- is connected with
📖 Menger’s Theorem (Edges):
Let be a graph. Then it holds that is -edge-connected if and only if there exist edge-disjoint --paths.
💡 It always holds that:
Cut Vertices/Cut Edges
💡 Let be a connected graph. A vertex is called a cut vertex if and only if is disconnected.
💡 Let be a connected graph. An edge is called a cut edge if and only if is not connected.
📌 Let be a connected graph. If is a cut edge then it holds that: or is a cut vertex, and analogously for . Note that this does not hold in the other direction for the general case.
💡 Let be a graph. We define an equivalence relation on by
The equivalence classes will be called blocks.
📌 Two blocks intersect, if at all, always in a cut vertex.
Algorithm for Finding Cut Vertices and Cut Edges
Using a slightly modified version of DFS we can find cut vertices and cut edges in linear time (). We use the following recurrence:
where is defined as the smallest number that is reachable from by a directed path consisting of an arbitrary number of tree edges and at max one left-over edge. The number of a vertex is defined as the pre-ordering number of .
Tours/Cycles
💡 Let be a graph. A Hamiltonian cycle is a cycle in that contains every vertex exactly once. A Eulerian tour is a closed walk in that contains every edge exactly once. If a graph contains a Hamiltonian cycle the graph is called hamiltonian.
📖 A connected graph contains a Eulerian tour if and only if the degree of every vertex is even. Such a Eulerian tour can be found in if it exists. If a graph contains a Eulerian tour the graph is called Eulerian.
Note: If in a connected graph all except two vertices have even degree then the graph contains an Eulerian Walk.
Hamiltonian Cycle
📖 Let . A grid contains a Hamiltonian cycle if and only if is even.
📖 A bipartite graph with cannot contain a Hamiltonian cycle.
📖 Dirac’s Theorem:
Every graph with and minimum degree contains a Hamiltonian cycle.
Application: Hamiltonian Cycle in a Hypercube: Gray-Code
Hamiltonian Cycle in a Hypercube: Gray-Code
Eulerian Tour
A Eulerian tour can be found in using the fast and slow runner algorithm described in section 1.5.1 of the script.