Graph Routes
Graph Routes
Definition 2.1
- A walk is a sequence of vertices so that there is an edge between consecutive vertices. A walk can repeat vertices and edges.
- A trail is a walk with no repeated edges. A trail can repeat vertices but not edges.
- A path is a trail with no repeated vertex (or edges). A path on n vertices is denoted .
- A closed walk is a walk that starts and ends at the same vertex.
- A circuit is a closed trail; that is, a trail that starts and ends at the same vertex with no repeated edges though.
- A cycle is a closed path; that is, a path that starts and ends at the same vertex. Thus cycles cannot repeat edges or vertices. A cycle on n vertices is denoted .
The length of tours = number of edges.
Definition 2.2
- Let be a graph. Two vertices x and y are connected if there exists a path from x to y in . The graph is connected if every pair of distinct vertices is connected.
Theorem 2.3
- Every walk contains an path.
- Proof:
Prove this by induction. Suppose be the length of ab walk .
When , then the walk does not have any vertices and edges so it contains a single vertex, that is W Supppose and the claim holds for true for all . If has no repeated vertex, then it cannot have any repeated edges and so is an path. Otherwise has a repeated vertex, call it . We can remove all edges and vertices between two appearances of in the ealk, and leave only one copy of . This will produce a shorter walk which is contained in . Thus, by the induction hypothesis we know contains an path , which is also contained in . Thus contains an path .
- Proof:
Definition 2.4
- An object is maximum if it is the largest among all objects under consideration; that is, . An object is maximal if it cannot be made larger.
Theorem 2.5
- If every vertex of a graph has degree at least 2 than contains a cycle.
Eulerian Graphs
Definition 2.6
- Eulerian circuit is a circuit that contains every edge and every vertex of graph .
Theorem 2.7
- A graph is eulerian is connected and every vertex has even degree.
- Proof:
-
is eulerian.
There is a circuit containing every edge and vertex of .
is connected.
The circuit is a trail that starts and ends at the same vertex.
For every vertex, there at least exists a pair of edges in and out.
Every vertex has even degree. is connected and every vertex has even degree. -
The proof processed by induction. Suppose has edges and that for all , with that any connected graph with edges and all vertices of even degree have an eulerian circuit.
By Theorem 2.5, all vertices in have at least degree 2, then contains a cycle . Let be the graph obtained by deleting all the edge of . has less edges than , thus it contains an eulerian circuit. To find the eulerian circuit of , we traverse but when a component of is encountered, we detour along its eulerian circuit. This detour will start and end at the same vertex, and we continue traversing until all edges being traveled, thus completing an eulerian circuit of .
Algorithm for finding Eulerian circuit
Fleury’s Algorithm
- Given a graph where zero or two vertices are odd. If has no odd vertices, then any vertex can be teh starting point. If has odd vertices, then the starting point must be one of the odd vertices. From the starting point, using dfs travel through all edge and label the edge have been traveled. Then we have labeled eulerian circuit or trail. The complexity is the cost of doing dfs.
Hierholzer’s Algorithm
- Given a graph where all vertices are even.
- Select a starting vertex , and find a circuit originating at .
- Find any vertex on has edges not appearing in , find a cicuit originating at .
- Combine and into a single circuit .
- Repeat (2) and (3) until all edge of are used.
Hamiltonian Cycles
Definition 2.10
- Hamiltonian cycle is a cycle in a graph that contains every vertex of .
- Hailtonian path is a path that contains every vertex.
- A graph that contains a hamiltonian cycle is called hamiltonian.
Properties of Hamiltonian Graphs
- must be connected.
- No vertex of have degree less than 2.
- cannot contain a **cut-vertex**, i.e. a vertex whose removal disconnects the graph.
- If contains a vertex of degree 2 then both edges incident to must be included in the cycle.
- If two edges incident to a vertex must be included in the cycle, then all other edges incident to cannot be used in the cycle.
- If in the process of attempting to build a hamiltonian cycle, a cycle is formed that does not span , then cannot be hamiltonian.
Theorem 2.12 (Dirac’s Theorem)
- Let be a graph with vertices. If every vertex of satisfies , then has a hamiltonian cycle.
- Proof: Noted that is connected. Let be a path that contains all vertices in . Let be the set of vertices that are adjacent to i.e. . Let be the set of vertices whise immediate neighbor on is adjacent to i.e. . Since both and have degree we know .
Since , thus , then we have . There exists some vertex s.t. . Consider the cycle , where indicates travaling from to along path . Thus forms a hamiltonian cycle.

- Proof: Noted that is connected. Let be a path that contains all vertices in . Let be the set of vertices that are adjacent to i.e. . Let be the set of vertices whise immediate neighbor on is adjacent to i.e. . Since both and have degree we know .
Theorem 2.13 (Ore’s Theorem)
- Let be a graph with vertices. If for all distinct nonadjacent vertices, then has a hamiltonian cycle.
Definition 2.14
- The hamiltonian closure of a graph , denoted is the graph obtained from by iteratively adding edges between pairs of nonadjacent vertices whose degree sum is at least , that is we add an edge between and if , until no such pair remains.
Theorem 2.16
- A graph is hamiltonian is hamiltonian.
Lemma 2.17
- If is graph with at least 3 vertices such that its closure is complete, then is hamiltonian.
Theorem 2.18 (Posa’s Theorem)
- Let be a simple graph where the vertices have degree such that and the degrees are listed in increasing order. If for any either or , then is hamiltonian.
- Proof: We will is a complete graph, so by Lemma 2.17 we would know that both and are hamiltonian. Suppose for a contradiction that is not complete. Then there exist nonadjacent vertices and in , and , as otherwise would be added to in the formation of . Choose and among all such nonadjacent pairs in so that the sum of their degrees in (TBD).
The Traveling Salesman Problem
Problem Statement
Given a weighted complete graph, find the hamiltonian cycle with least total weight.
Brute Force Algorithm
- Find all possible hamiltonian cycles and pich the one with smallest weight.
- Time Complexity: .
Nearest Neighbor Algorithm
- Always choose the least weight among adjacent node.
- Time complexity is .
- Repetitive Nearest Neighbor Algorithm means considering every vertex as starting vertex and apply NN. This way may find more optimal solution.
- Approximate Algorithm with lower computation cost but not always optimal.
Cheapest Link Algorithm
- Repeat pick the one with the smallest weight among all edges with two conditions: (1) no vertex has three highlighted edges incident to it; (2) no edge is chosen so that a cycle closes before hitting all the vertices.
- Also an approximate algorithm. Generally perform well than NN.
Nearest Insertion Algorithm
- First choose the smallest edge, hightlight the edge and its endpoints.
- Pick a vertex which is cloest to the one of the two already chosen vertices,, highlight the new vertex and its edges to both previously chosen vertices.
- Pick a vertex that is cloest to the one of the three chosen vertices. Calculate the increase in weight obtained by adding two new edges and deleting a previously chosen edge. Choose the scenario with the smallest total.
- Repeat (3) until all vertices have been included.
Shortest Paths
Dijkstra’s Algorithm
- Given weighted connected simple graph .
- Let be the start vertex, and means the shortest path from to .
- For the current vertex , find the vertex with lowest weight and update
- Repeat step 2 until all vertex have been traveled.
- One source to many vertex. Timecomplexity: .
Theorem 2.24 Walks Using Matrices
Let be the adjacency matrix of graph . in counts the number of walks from to using n edges.
Definition 2.25
- distance: is the shorest length from node to .
- eccentricity: .
- diameter: maximum eccentricity among all vertices. .
- radius: minimum eccentricity. .
Theorem 2.26
- If is disconnected then is connected and .
- Proof: We are going to prove that for any pairs of vertex and , there is a path.
- For , then .
- For , then and are not adjacent in . such that is in different component from and
Theorem 2.27
- For a simple graph if then .
Theorem 2.28
- For any simple graph , .
Definition 2.29
Let be a graph with . Central vertex is the vertex x which has .
Definition
- girth: the minimul length of a cycle in .
- circumference: the maximum length of a cycle.
Theorem 2.31
If is a graph with at least one cycle then .
- Proof note: use the property of shortest path.
Theorem 2.32
Let be a graph with vertices, radius at most , and maximum degree at most , with . Then .
Comments
