Graph Theory Flashcards
Edge
Line Segments or curves that start and end at vertices.
Graph
Consists of a finite set of vertices(points) and line segments or edges(curves). Edges start and end at vertices.
Equivalent Graph
- Same number of vertices and edges.
2. Check for adjacent vertices connected in the same way.
Adjacent Vertices
Two vertices with an edge connecting them.
Degree of a Vertex
Found by counting the total number of edges at the vertex. Loops add two.
Loop
Edge which connects a vertex to itself. Degree is 2.
Path
- A route in a graph sequence of adjacent vertices.
- Written as a list of vertices.
- Using an edge only once.
Circuit
A path that begins and ends at the same vertex
Connected Graph
Every pair of vertices has a path that contains them. You can travel from any vertex to any other vertex in the graph.
Bridge
An edge when removed changes the graph from connected to disconnected.
Euler Path
A path that travels through EVERY edge of a graph once and only once.
Euler Circuit
A circuit using EVERY edge exactly once. Must begin and end at the same vertex.
Euler’s Theorem
The number of odd vertices determines if a graph has Euler paths and Euler circuits.
For Connected graphs:
No odd -> at least on Euler Circuit/Path
2 -> No Euler Circuit, 1 or more Euler paths
greater than 2 -> No Euler paths/circuits
Fleury’s Algorithm
Helps to find Euler Paths and Circuits.
1) If 2 odd vertices(exactly) choose one odd to start the path and end at the other odd.
2) If no odd, then an Euler circuit, start at any vertex
3) Number the edges as you trace through the graph. After you travel over an edge dot that edge. Do not choose a bridge if you have the choice. Only travel over the bridge if there’s no other alternative.
Components
Pieces of a disconnected Graph
Traveling Salesperson Problem
The problem to find the Hamilton Circuit with the optimal solution, that is to say, with the smallest sum of weights.
Complete Graph
A graph that has an edge between each pair of vertices.
Number of Hamilton Circuits in a complete graph?
(n-1)! where n=vertices
Neighbors
Two vertices connected by an edge. In a complete graph all vertices are neighbors.
Weighted Graph
A graph whose edges have numbers that can be summed.
Nearest Neighbor Method
- Use a complete weighted graph
- Identify the starting vertex
- Choose edge with smallest weight. Move along edge to second vertex.
- Choose next connected edge with smallest weight that does not lead to a vertex already visited.
- Continue steps until all vertices are visited
- Return to the starting point
- Sum up weights
Brute Force Method
- Model problem wit a complete weighted graph
- Make a list of all possible Hamilton Circuits.
- Determine the sum of the weights of the edges for each of the Hamilton Circuits.
- The Hamilton Circuit with the smallest weight sum is the optimal solution
Tree
Connected Graph. No Circuits. One and only one path joining any two vertices. Every Edge is a bridge. N vertices, has n-1 edges.
Minimal Spanning Tree
Spanning tree with the smallest possible total weight.
Kruskal’s Algorithm
Used to find a minimal spanning tree of a connected, weighted graph.
- Draw all Vertices
- List the weights of the edged in order from smallest to largest.
- Add in edge with the smallest weight
- Continue to add acceptable edges that do not form a circuit. Stop when all vertices are connected.