Graph Theory Introduction
- 85Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
85 questions
- 1An undirected graph is one where edges have no_____.
Hint
Think about whether the edge can be traveled in both directions or only one.
Answer
orientation
- 2A directed graph is also called a_____.
Hint
This is a common abbreviation in graph theory.
Answer
digraph
- 3In a weighted graph, edges contain arbitrary values such as cost, distance, or_____.
Hint
Think of what else can be represented besides cost and distance.
Answer
quantity
- 4A tree is an undirected graph with no_____.
Hint
Trees are acyclic by definition.
Answer
cycles
- 5A rooted tree has a designated_____node.
Hint
This is the node where all edges either point away from or towards.
Answer
root
- 6Every tree with n nodes has exactly_____edges.
Hint
Consider the relationship between nodes and edges in a tree.
Answer
n−1
- 7A directed acyclic graph has directed edges and no_____.
Hint
Think about the cycle condition that would prevent a topological ordering.
Answer
cycles
- 8A topological ordering is possible only for_____.
Hint
What type of graph guarantees no cyclic dependencies?
Answer
directed acyclic graphs
- 9A bipartite graph is one whose vertices can be split into two independent groups such that every edge connects between_____.
Hint
Edges only exist between the partitions, not within them.
Answer
the two groups
- 10A complete graph with n vertices is denoted as_____.
Hint
This notation uses the letter K and the number of vertices as a subscript.
Answer
Kn
- 11In a complete graph, there is a unique edge between_____.
Hint
It's the densest possible simple graph.
Answer
every pair of nodes
- 12The simplest way to represent a graph is inside a 2D_____matrix.
Hint
This matrix directly shows connections between nodes.
Answer
adjacency
- 13In an adjacency matrix, the cell M[i][j] represents the_____of going from node i to node j.
Hint
This value could be a cost, distance, or a boolean.
Answer
edge weight
- 14Adjacency matrix requires_____space.
Hint
Think about how many entries are needed for a matrix of size V.
Answer
O(V2)
- 15Adjacency list is a way to represent a graph as a map of nodes to list of_____.
Hint
Each node keeps track of its outgoing connections.
Answer
edges
- 16Adjacency list is great for_____graphs.
Hint
Consider where most entries would be empty in a matrix.
Answer
sparse
- 17Edge list represents a graph as an unordered list of_____.
Hint
Each entry is a triplet representing a directed edge.
Answer
edges
- 18An edge list representation lacks_____.
Hint
Think about what makes it different from an adjacency list or matrix.
Answer
structure
- 19A depth first search runs in time complexity of_____.
Hint
It visits each node and edge at most once.
Answer
O(V+E)
- 20During DFS, we label nodes with an increasing_____.
Hint
This is a unique number assigned to each node as it is explored.
Answer
ID
- 21The low link value of a node is defined as the smallest node ID reachable from that node including_____.
Hint
It starts as the node's own ID and may decrease.
Answer
itself
- 22DFS can be used to count connected components by starting a DFS at every node except if that node has already been_____.
Hint
We skip nodes that have already been assigned to a component.
Answer
visited
- 23DFS can be used to find bridges by checking if the ID of the node the edge comes from is less than the low link value of the node the edge goes to, which indicates a_____.
Hint
This condition means there is no back edge connecting the component to an earlier part.
Answer
bridge
- 24DFS can be extended to find articulation points, which are nodes whose removal increases the number of_____in the graph.
Hint
Think about the effect of removing that node on the graph's connectivity.
Answer
connected components
- 25The BFS algorithm explores nodes in_____.
Hint
It visits all nodes at the same distance before moving further.
Answer
layers
- 26BFS maintains a_____to track which node to visit next.
Hint
This data structure ensures first-in, first-out order.
Answer
queue
- 27BFS is particularly useful for finding the shortest path on an_____graph.
Hint
When all edges have equal cost, BFS finds the shortest path in terms of number of edges.
Answer
unweighted
- 28In BFS on a grid, we can use direction vectors for north, south, east, and_____.
Hint
The four cardinal directions cover all possible moves.
Answer
west
- 29In a grid, we need to check that the new coordinate is within bounds and not a_____cell.
Hint
This type of cell is impassable, like a wall.
Answer
rock
- 30A topological ordering is an ordering of nodes where for each edge from node A to B, node A appears_____node B.
Hint
The ordering respects the direction of edges.
Answer
before
- 31Graphs with directed cycles do not have a topological ordering because there is no place to_____.
Hint
Every node in a cycle depends on another, so there is no node without prerequisites.
Answer
start
- 32In topological sort using DFS, we add nodes to the ordering on the_____call.
Hint
This is when the DFS backtracks from a node.
Answer
recursive callback
- 33The shortest path on a DAG can be found in_____time.
Hint
This is faster than Dijkstra's algorithm on general graphs.
Answer
linear
- 34To find the longest path on a DAG, we can negate all edges and find the_____.
Hint
Negating transforms the problem into a shortest path problem.
Answer
shortest path
- 35Dijkstra's algorithm is a single source shortest path algorithm for graphs with_____edge weights.
Hint
This constraint ensures no negative cycles.
Answer
non-negative
- 36In the lazy implementation of Dijkstra, duplicate key-value pairs are inserted and later_____.
Hint
Outdated entries are skipped when popped from the priority queue.
Answer
ignored
- 37The eager implementation uses an_____priority queue to avoid duplicates.
Hint
This data structure supports key-value updates efficiently.
Answer
indexed
- 38Dijkstra's algorithm can stop early if the destination node has been_____.
Hint
Once a node is processed, its shortest distance is final.
Answer
visited
- 39With a D-ary heap, the optimal degree d is equal to the number of edges divided by the number of_____.
Hint
This balances insertion and removal operations.
Answer
nodes
- 40Bellman-Ford is used when the graph has_____edge weights.
Hint
Dijkstra cannot handle these.
Answer
negative
- 41Bellman-Ford relaxes each edge_____times.
Hint
This is the minimum number of iterations needed to propagate distances.
Answer
V−1
- 42To detect negative cycles, we run the algorithm a second time and mark nodes that can still be relaxed with the value_____.
Hint
This indicates that the distance can be improved indefinitely.
Answer
negative infinity
- 43A negative cycle is a cycle where the sum of edge weights is_____.
Hint
The total weight around the cycle is less than zero.
Answer
negative
- 44Floyd-Warshall is an_____-pairs shortest path algorithm.
Hint
It computes distances between every pair of nodes.
Answer
all
- 45It runs in time complexity $O(_____)$.
Hint
The algorithm uses three nested loops.
Answer
V3
- 46It stores the shortest path between all pairs of nodes in a 2D_____matrix.
Hint
This matrix holds the optimal distances.
Answer
distance
- 47The recurrence for Floyd-Warshall updates the distance from i to j by considering routing through node_____.
Hint
The outer loop iterates over this intermediate node.
Answer
k
- 48To reconstruct paths, we maintain a_____matrix.
Hint
This matrix stores the next node to go to from i to j.
Answer
next
- 49A bridge is an edge whose removal increases the number of_____in the graph.
Hint
It disconnects the graph if removed.
Answer
connected components
- 50An articulation point is a node whose removal increases the number of_____.
Hint
It is a critical vertex for connectivity.
Answer
connected components
- 51Bridges can be found by checking if the ID of the node the edge starts at is less than the low link value of the node it ends at, indicating no alternative path back to the_____.
Hint
This means the edge is the only connection to that part of the graph.
Answer
start (or root)
- 52For a node to be an articulation point via a cycle, its ID must be equal to the low link value of a child, and it must have more than_____outgoing edges.
Hint
A single outgoing edge might not make it an articulation point.
Answer
one
- 53Tarjan's algorithm finds_____components in a directed graph.
Hint
These are self-contained cycles within the graph.
Answer
strongly connected
- 54It uses a stack to maintain valid nodes from which to update_____values.
Hint
These values help identify SCCs.
Answer
low link
- 55A node starts a strongly connected component if its ID is equal to its_____.
Hint
This condition indicates the root of an SCC.
Answer
low link value
- 56When a strongly connected component is found, all nodes in that component are popped from the_____.
Hint
They are removed from the stack as they form a complete SCC.
Answer
stack
- 57The Traveling Salesman Problem asks for the shortest route that visits each city exactly once and returns to the_____.
Hint
The tour must start and end at the same city.
Answer
origin (or starting city)
- 58The naive brute force approach runs in $O(_____)$ time.
Hint
It tries all permutations of cities.
Answer
n!
- 59The dynamic programming solution runs in $O(_____)$ time.
Hint
This involves subsets of cities.
Answer
n22n
- 60The dynamic programming state consists of the set of visited nodes and the index of the_____node.
Hint
This determines which city to extend the tour from.
Answer
last visited
- 61The set of visited nodes is represented as a_____integer.
Hint
It uses bits to indicate which nodes have been visited.
Answer
32-bit
- 62An Eulerian path visits every_____exactly once.
Hint
It uses each edge exactly once, not necessarily each vertex.
Answer
edge
- 63For an undirected graph to have an Eulerian circuit, every node must have_____degree.
Hint
This ensures you can enter and leave each node the same number of times.
Answer
even
- 64For a directed graph to have an Eulerian circuit, every node must have equal in-degree and_____.
Hint
The number of incoming edges must match the number of outgoing edges.
Answer
out-degree
- 65In a directed Eulerian path, at most one node has out-degree minus in-degree equal to one, and at most one node has in-degree minus out-degree equal to_____.
Hint
These are the start and end nodes of the path.
Answer
one
- 66The algorithm to find an Eulerian path uses a depth first search that continues while the current node has_____outgoing edges.
Hint
It explores all edges by repeatedly following unused edges.
Answer
unvisited
- 67A minimum spanning tree connects all nodes while minimizing total_____.
Hint
It seeks the cheapest set of edges to connect the graph.
Answer
edge cost
- 68Prim's algorithm is a_____algorithm that always selects the next best edge.
Hint
It makes locally optimal choices to achieve a global optimum.
Answer
greedy
- 69In the lazy implementation of Prim's, we use a priority queue to sort edges by_____.
Hint
The priority queue always gives the smallest edge.
Answer
minimum edge cost
- 70The eager implementation uses an indexed priority queue to track node-edge pairs and runs in $O(_____\log V)$.
Hint
The complexity depends on the number of edges.
Answer
E
- 71For dense graphs, representing the graph with an_____matrix may perform better.
Hint
This representation has fast edge lookups.
Answer
adjacency
- 72The maximum flow problem asks how much flow can be pushed from source to sink without exceeding edge_____.
Hint
Each edge has a limit on the amount of flow it can carry.
Answer
capacities
- 73The Ford-Fulkerson method repeatedly finds_____paths in the residual graph.
Hint
These paths allow increasing flow.
Answer
augmenting
- 74An augmenting path is a path from source to sink with positive_____capacity.
Hint
It uses edges that still have capacity left.
Answer
remaining
- 75The bottleneck value of an augmenting path is the smallest_____along the path.
Hint
This limits how much flow can be pushed.
Answer
edge capacity
- 76Edmonds-Karp uses_____first search to find the shortest augmenting path.
Hint
This ensures the path has the fewest edges.
Answer
breadth
- 77Capacity scaling pushes flow through larger edges first, using a parameter_____that decreases over time.
Hint
This threshold determines which edges are considered.
Answer
delta
- 78Dinic's algorithm uses a_____graph built via BFS and multiple DFS searches until a blocking flow is reached.
Hint
This graph guides edges toward the sink.
Answer
level
- 79In Dinic, a blocking flow is when no more augmenting paths exist in the current_____graph.
Hint
The level graph has been saturated.
Answer
level
- 80To find a maximum cardinality bipartite matching using max flow, we add a source and sink with edges of capacity_____.
Hint
Each node in the left and right sets can be matched at most once.
Answer
one
- 81Each edge from source to left nodes has capacity one to ensure each left node is matched at most_____.
Hint
It prevents multiple matches from the same left node.
Answer
once
- 82The maximum flow value equals the size of the maximum_____.
Hint
The flow through the middle edges represents matches.
Answer
matching
- 83In the mice and owls problem, we draw an edge between a mouse and a hole if the mouse can reach the hole within a radius_____.
Hint
This is the maximum distance a mouse can run.
Answer
r
- 84The elementary math problem can be reduced to a bipartite matching where left nodes are input pairs and right nodes are_____.
Hint
Each input pair can produce up to three possible answers.
Answer
answers (or results)
- 85To handle multiple repeated input pairs in the elementary math problem, we set the capacity from the source to the input pair node to the_____of that pair.
Hint
If a pair appears multiple times, it can be matched to multiple distinct answers.
Answer
frequency

Ask anything
We've read this whole study set, so questions about it get the best answers.