Chapter 20 DSA - Graphs
tree
A ________ is an undirected connected graph without cycles
connected component
A ________ is the subset of vertices visited during a traversal that begins at a given vertex
circuit
A _________ is a special cycle that passes through every vertex in a graph exactly once
topological
A ______________ order is a list of vertices in a directed graph without cycles such that vertex x precedes vertex y if the graph has a directed edge from x to y
n-1
A connected undirected graph that has n vertices must have at least ________ edges
edges
A path is a sequence of _________ in a graph The _______ of a weighted graph have numeric labels
subgraph
A subset of a graph's vertices and edges is known as a ___________
euler circuit
A(n) _________ begins at a vertex v, passes through every edge exactly once, and terminates at v - exists if and only if each vertex touches an even number of edges
hamilton circuit
A(n) _________ begins at a vertex v, passes through every vertex exactly once, and terminates at v
graph traversal algorthm
Algorithm that stops when it has visited all the vertices that it can reach
simple cycles
All _________ begin and end at the same vertex and do not pass through any other vertices more than once * It cannot pass through a vertex more than once
stack
An iterative DFS traversal algorithm uses a(n) _________
y adjacent x
If a graph has a directed edge from vertex x to vertex y, which of the following is true about x and y?
digraph
The edges in a __________ indicate a direction
height
The sum of the weights of the edges in a path can be called all of the following Except
connected undirected graph
This type of graph cannot contain a cycle if it has n vertices and exactly n-1 edges When this type of graph has n vertices and n-1 edges must contain at least one cycle
adjacent
Two vertices that are joined by an undirected edge are said to be ____________ to each other
multigraph
a __________ can have duplicate edges between vertices
edge
a complete graph has a(n) ____________ between each pair of distinct vertices
true
a connected graph can have a pair of vertices without an edge between them
false
a connected graph has an edge between every pair of vertices
true
a connected undirected graph that has n vertices and exactly n-1 edges cannot contain a cycle
two
a graph consists of _______ sets
connected
a graph is ________ if each pair of distinct vertices has a path between them
disconnected
a graph is ____________ if it has at least one pair of vertices without a path between them
planar graph
a graph that can be drawn in a plane in at least one way so that no two edges cross
complete graph
a graph that has an edge between every pair of distinct vertices
weighted graph
a graph whose edges are labeled with numeric value
minimum spanning tree
a graph's spanning tree for which the sum of its edge weights is minimal among all spanning trees for the graph
simple path
a path in a graph that does not pass through a vertex more than once
cycle
a path that begins and ends at the same vertex
loop
a self edge is also called a _____________
path
a sequence of edges in a graph that begins at one vertex and ends at another vertex
false
a simple cycle only passes through one vertex
false
a simple path may pass through the same vertex more than once
spanning tree
a subgraph of a connected, undirected graph that contains all of the graph's vertices and enough of its edges to form a tree cost is calculated by finding the sum of the costs of the edges in the spanning tree
n-1
a tree with n nodes must contain ___________ edges
true
adjacent vertices are joined by an edge
true
all connected graphs are connected
false
all paths begin and end at the same vertex
self edge
an edge that begins and ends at the same vertex
true
each edge in a graph cannot begin and end at the same vertex
undirected graph
graphs that do not indicate a direction each distinct pair of vertices in an undirected graph has only one edge between them
directed graph
graphs that have each edge has a direction Can have two edges between a pair of vertices -> one in each direction
false
in a digraph, each pair of vertices may be joined by only one edge
breadth first search
proceeds along a path from a vertex as deeply into the graph as possible before backing up
true
the adjacency matrix for an undirected graph is symmetrical
false
the adjacency matrix of a graph is always symmetric with respect to the diagonal line
shortest path
the path between two vertices in a weighted graph is the path that has the smallest sum of its edge weights
depth first search
visits every vertex adjacent to a vertex that it can before visiting any other vertex