FINAL - Graph Concepts Flashcards
Connected graph (undirected)
There is a path between every pair of vertices
Path
A sequence of distinct edges that joins a sequence of vertices
Simple path
Implies no repeated vertices (and that the term “path” might contain repeated vertices)
Connected component
A maximal connected subgraph of G
Weakly connected graph (directed)
Replacing all its directed edges with undirected edges produces a connected graph
Connected graph (directed)
G contains a directed path from u to v OR from v to u for every pair of vertices u, v
Strongly connected graph (directed)
G contains a directed path from u to v AND from v to u for every pair of vertices u, v
Complete graph
Every pair of distinct vertices is connected by a unique edge (edges to/from for a digraph)
Spanning tree
A subgraph that is a tree and includes all the vertices in G using a minimum number of edges
Tree edge
GRAY->WHITE, from parent to child (discovery edge), forms a spanning tree/forest
Back edge
GRAY->GRAY, loops back to an ancestor
Forward edge
GRAY->BLACK, from ancestor to descendant
Cross edge
GRAY->BLACK, between two unrelated nodes
If G is undirected, a DFS produces only…
tree edges and back edges
For a directed, connected graph with 2 nodes, how many trees will a DFS produce?
It depends on which node is chosen to be the root first!!!!