Graphs Flashcards
Graph
A set of vertices connected pairwise by edges.
Path
A sequence of vertices connected by edges.
Cycle
Path whose first and last vertices are the same.
Connected vertices
Two vertices are connected if there is a path between them.
Euler Tour
A cycle that uses each edge exactly once.
Hamilton tour
A cycle that uses each vertex exactly once.
Planar Graph
A graph that can be embedded in the plane.
I.e., it can be drawn on the plane in such a way that its edges intersect only at their endpoints.
I.e. it can be drawn in such a way that no edges cross each other.
Isomorphic Graphs
When two adjacency lists represent the same graph.
Sparse graphs
Graphs that have a huge number of vertices, but a small average vertex degree.
Describe
the Depth-first Search algorithm
DFS (to visit a vertex v)
- Mark v as visited.
- Recursively visit all unmarked vertices w adjacent to v.
2 Applications of Depth-first search
- Find all vertices connected to a given source vertex.
- Find a path between two vertices.
Describe
the Breadth-first Search algorithm
BFS (from a source vertex s)
Put s on a FIFO queue, and mark s as visited.
Repeat until the queue is empty:
- Remove the last recently added vertex v.
- add each of v’s unvisited neighbours to the queue, and mark them as visited.
Define
vertex connectivity
Vertices v and w are connected if there is a path between them.
Digraph
Directed graph.
A set of vertices connected pairwise by directed edges.
Strongly connected vertices
Vertices v and w are strongly connected if there is both a directe path from v to w and a directed path from w to v.