Dynamic Graph Algorithms
- 45Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What makes an algorithm dynamic in the setting described?
What makes an algorithm dynamic in the setting described?
45 questions
- 1
What makes an algorithm dynamic in the setting described?
- A
It generates its own sequence of inputs without user interaction
- B
It repeatedly receives changes to its input and reports updated outputs
- C
It reports outputs only after all input changes have finished
- D
It processes a fixed input once and reports a final output
Correct answer
BIt repeatedly receives changes to its input and reports updated outputs
Explanation
A dynamic algorithm interacts with a user who updates the input, and it maintains or reports the output as those changes arrive.
- A
- 2
In the dynamic graph setting, what does it mean for the update sequence to be generated online?
- A
The algorithm chooses all updates after examining the final graph
- B
The entire update sequence is known before preprocessing begins
- C
Each update or query is provided as the process runs
- D
Updates are selected randomly from a fixed distribution
Correct answer
CEach update or query is provided as the process runs
Explanation
Online means updates and queries arrive one at a time during execution, rather than being provided in advance.
- A
- 3
What does Gi represent in the lecture’s notation?
- A
The graph before any updates are applied
- B
The ith update in the update sequence
- C
The graph after the first i updates
- D
The graph containing exactly i vertices
Correct answer
CThe graph after the first i updates
Explanation
The sequence begins with G0; after each update, the resulting graph is denoted by the next indexed graph.
- A
- 4
Which operations are typical updates in a dynamic graph problem?
- A
Replacing every edge with a weighted edge
- B
Changing vertex labels while keeping all edges fixed
- C
Reordering the graph’s vertices without changing its structure
- D
Inserting or deleting an edge, and sometimes a vertex
Correct answer
DInserting or deleting an edge, and sometimes a vertex
Explanation
The described dynamic graph updates are usually edge insertions or deletions, and sometimes vertex insertions or deletions.
- A
- 5
Which pair of tasks was given as an example of dynamic graph queries?
- A
Counting graph drawings and listing all possible vertex orders
- B
Determining the graph’s color scheme and renaming its components
- C
Finding every vertex label and sorting edges alphabetically
- D
Checking connectivity and asking for the distance between two nodes
Correct answer
DChecking connectivity and asking for the distance between two nodes
Explanation
Examples include checking whether the graph is connected and querying the distance between two specified nodes.
- A
- 6
What is the defining guarantee of a worst-case update time of T?
- A
The total time over all steps is exactly T
- B
Every individual step takes at most T time
- C
The average step takes at most T time over a chosen distribution
- D
Only the most expensive step takes at most T time
Correct answer
BEvery individual step takes at most T time
Explanation
Worst-case update time bounds every individual step by T.
- A
- 7
When is an amortized update time of at most T established over k steps?
- A
When the first step takes at most kT and later steps are unbounded
- B
When the total processing time over those steps is at most kT
- C
When the average is taken over a probability distribution and is at most T
- D
When every one of the k steps takes at most T
Correct answer
BWhen the total processing time over those steps is at most kT
Explanation
Amortized time is averaged over the sequence of steps: total time through k steps must be at most kT. It is not an average over a distribution.
- A
- 8
How is preprocessing time treated when measuring update time?
- A
It is divided equally among all updates by definition
- B
It is measured separately and is not counted as update time
- C
It is included only when the algorithm is fully dynamic
- D
It is counted as the first update’s processing time
Correct answer
BIt is measured separately and is not counted as update time
Explanation
Preprocessing is the time spent processing the initial graph G0 and is distinguished from update time.
- A
- 9
Which description correctly distinguishes fully dynamic, incremental, and decremental algorithms?
- A
Fully dynamic handles insertions only; incremental handles both changes; decremental handles queries only
- B
Fully dynamic handles queries only; incremental handles deletions; decremental handles insertions
- C
Fully dynamic handles deletions only; incremental handles queries; decremental handles both changes
- D
Fully dynamic handles insertions and deletions; incremental handles insertions; decremental handles deletions
Correct answer
DFully dynamic handles insertions and deletions; incremental handles insertions; decremental handles deletions
Explanation
A fully dynamic algorithm supports both insertions and deletions; incremental and decremental algorithms support only insertions and only deletions, respectively.
- A
- 10
What is a matching in a graph?
- A
A set of paths that all begin at the same vertex
- B
A set of vertices in which every pair is joined by an edge
- C
A set of edges that together connect every vertex
- D
A set of edges no two of which share a vertex
Correct answer
DA set of edges no two of which share a vertex
Explanation
A matching consists of disjoint edges, meaning no two selected edges share a vertex.
- A
- 11
What does the size of a maximum matching represent?
- A
The total number of edges incident to matched vertices
- B
The smallest number of edges whose deletion disconnects the graph
- C
The largest number of pairwise vertex-disjoint edges in the graph
- D
The largest number of vertices reachable from a chosen vertex
Correct answer
CThe largest number of pairwise vertex-disjoint edges in the graph
Explanation
A maximum matching is a matching with as many edges as possible; its size is the largest number of pairwise vertex-disjoint edges.
- A
- 12
What does [0mμ(G) denote in the dynamic matching discussion?
- A
The number of connected components in G
- B
The maximum degree of a vertex in G
- C
The number of edges in a minimum spanning tree of G
- D
The size of a maximum matching in G
Correct answer
DThe size of a maximum matching in G
Explanation
The notation μ(G) is used for the size of a maximum matching of graph G.
- A
- 13
Why can one edge insertion or deletion change the maximum matching size by at most one?
- A
A maximum matching cannot change after an edge update
- B
Every matching has exactly one edge for each graph update
- C
A single edge can be added to or removed from a matching at one time
- D
An edge update changes the number of vertices by one
Correct answer
CA single edge can be added to or removed from a matching at one time
Explanation
One inserted edge can increase the maximum matching size by at most one, and deleting one edge can decrease it by at most one.
- A
- 14
What is the basic rebuild strategy for maintaining an approximate matching?
- A
Update the exact matching after every edge change and never recompute
- B
Recompute the matching only when the graph becomes disconnected
- C
Store every previous matching and report their average size
- D
Recompute an approximate matching, then reuse its reported size for a period before recomputing
Correct answer
DRecompute an approximate matching, then reuse its reported size for a period before recomputing
Explanation
The simple strategy computes an approximate matching from scratch, then returns that stored estimate for a prescribed number of updates before rebuilding.
- A
- 15
Why can the stored matching estimate remain useful between rebuilds?
- A
The stored estimate is recalculated implicitly after every update
- B
Edge updates cannot affect a matching unless they change a vertex
- C
The maximum matching size changes by at most one per update, so its drift is limited during the waiting period
- D
The maximum matching size is identical in every graph in an update sequence
Correct answer
CThe maximum matching size changes by at most one per update, so its drift is limited during the waiting period
Explanation
Because each edge update changes the maximum matching size by at most one, limiting the number of updates between rebuilds limits how far the true value can drift from the stored estimate.
- A
- 16
Why is the number of edges in a graph bounded by 2nμ(G) in the matching argument?
- A
A maximum matching partitions all graph edges into groups of exactly 2n
- B
Every edge belongs to a maximum matching, which has at most 2n edges
- C
Every edge must touch an edge of a maximum matching; removing the matching edges’ endpoints can account for at most 2n edges per matched edge
- D
Each vertex has degree at most 2μ(G), so the graph has at most 2nμ(G) edges
Correct answer
CEvery edge must touch an edge of a maximum matching; removing the matching edges’ endpoints can account for at most 2n edges per matched edge
Explanation
If an edge were disjoint from all edges in a maximum matching, it could be added to that matching. Thus every edge touches a matched edge. Removing the endpoints of one matched edge removes at most 2n edges, yielding the stated bound.
- A
- 17
Suppose an algorithm can handle L updates with rebuild time tb and worst-case per-update time tu. What amortized update-time bound does the rebuild reduction give for handling an ongoing sequence?
- A
tb+L/tu
- B
tb/L+tu
- C
Ltb+tu
- D
tbtu/L
Correct answer
Btb/L+tu
Explanation
Rebuilding once per phase of L updates spreads the rebuild cost across those updates, giving amortized time tb/L+tu.
- A
- 18
What is the main purpose of rebuilding in the background?
- A
To spread rebuild work across updates and avoid a single large update-time spike
- B
To eliminate preprocessing by delaying all work until the last update
- C
To make every update perform a complete rebuild
- D
To ensure that the algorithm never needs to process past updates
Correct answer
ATo spread rebuild work across updates and avoid a single large update-time spike
Explanation
Background rebuilding distributes the work of a rebuild over multiple updates, converting a large time spike into bounded work per step.
- A
- 19
During the first L/4 steps of a phase in the background-rebuilding method, what is the algorithm doing?
- A
Discarding the phase’s starting graph and rebuilding only at its end
- B
Applying two new updates at a time to the old data structure
- C
Building a data structure for the graph at the phase’s start while distributing the rebuild work
- D
Reporting answers from a fully up-to-date new data structure
Correct answer
CBuilding a data structure for the graph at the phase’s start while distributing the rebuild work
Explanation
The red period uses the first quarter of a phase to build a data structure for the snapshot graph at the phase’s start, spreading the rebuild time across those steps.
- A
- 20
Why does the new data structure need a catch-up period after its initial rebuild?
- A
The rebuild deliberately removes all edges inserted during preprocessing
- B
It was built for an earlier graph snapshot and must process updates that arrived while it was being built
- C
Its stored answers must be averaged with those of the old data structure
- D
It must wait until a deletion-only sequence becomes fully dynamic
Correct answer
BIt was built for an earlier graph snapshot and must process updates that arrived while it was being built
Explanation
The rebuilt structure represents the graph at the phase’s start, so it is behind the current graph by the updates that arrived during rebuilding.
- A
- 21
What happens during the catch-up period in the described schedule?
- A
The algorithm performs no work until the next phase begins
- B
The rebuilt structure processes one update per step and remains permanently behind
- C
The rebuilt structure processes two updates per step to catch up
- D
The algorithm rebuilds the structure from scratch after each update
Correct answer
CThe rebuilt structure processes two updates per step to catch up
Explanation
During the next quarter of the phase, the new structure is fed two updates per step, allowing it to catch up with the update sequence.
- A
- 22
When does the background-rebuilt data structure process updates at the ordinary rate and provide current answers?
- A
Only at the boundary between consecutive phases
- B
During the final half of the phase, after it has caught up
- C
Only during the catch-up period, while processing two updates per step
- D
During the first quarter, before rebuilding is complete
Correct answer
BDuring the final half of the phase, after it has caught up
Explanation
After rebuilding and catching up, the structure is current during the final half of the phase and can process one update per step.
- A
- 23
Why are two offset copies of the partially correct schedule used?
- A
One copy handles insertions while the other handles deletions
- B
They allow the algorithm to avoid preprocessing both copies
- C
Their correct periods are shifted so that at every step at least one copy is correct
- D
They divide each update’s work in half and jointly produce an exact answer
Correct answer
CTheir correct periods are shifted so that at every step at least one copy is correct
Explanation
A single scheduled copy is correct only during part of its phase. Shifting a second copy’s schedule ensures that one of the two copies is correct at every time step.
- A
- 24
What worst-case update-time bound results from background rebuilding, given rebuild time tb, phase length L, and ordinary update time tu?
- A
Ltb+tu
- B
tb+Ltu
- C
tb/L+tu
- D
tb/L2+tu
Correct answer
Ctb/L+tu
Explanation
Spreading rebuild work over a phase of length L costs about tb/L per step; ordinary update work adds tu.
- A
- 25
What is a one-batch decremental connectivity problem in the described reduction?
- A
Given a sequence of queries, construct a minimum spanning tree after each query
- B
Given one set of edge deletions, determine whether the resulting graph remains connected
- C
Given an unbounded sequence of insertions, report the number of connected components
- D
Given one vertex insertion, find a shortest path between every pair of vertices
Correct answer
BGiven one set of edge deletions, determine whether the resulting graph remains connected
Explanation
The one-batch problem starts with a graph and a single deletion set, then asks whether the graph after that batch of deletions is connected.
- A
- 26
How does the lecture turn a one-batch algorithm into an algorithm for a sequence of updates?
- A
For update i, form a batch containing the first i updates and run the one-batch algorithm on it
- B
For every update, ignore all earlier updates and use only that update as the batch
- C
Run the one-batch algorithm only once, before any updates are given
- D
Combine all future updates into the first batch before they arrive
Correct answer
AFor update i, form a batch containing the first i updates and run the one-batch algorithm on it
Explanation
At step i, the reduction forms a batch from the update prefix through step i and feeds that batch to the one-batch algorithm.
- A
- 27
If the one-batch algorithm has linear initialization time and takes i2 time to process a prefix batch of size i, what is the resulting per-step cost bound for an algorithm limited to L updates?
- A
At most 2L
- B
At most L3
- C
At most L
- D
At most L2
Correct answer
DAt most L2
Explanation
The batch at step i takes i2 time, so across a sequence limited to L updates, the largest such cost is at most L2.
- A
- 28
Using rebuild scheduling, what worst-case update-time expression follows from linear initialization time and per-step batch cost at most L2?
- A
m/L2+L
- B
m/L+L2
- C
mL+L2
- D
m+L2
Correct answer
Bm/L+L2
Explanation
The initialization cost is spread over L updates, contributing m/L, while the per-step batch cost contributes at most L2.
- A
- 29
What choice of L balances m/L and L2 to obtain the stated update-time scale?
- A
L=m1/2, giving a scale of m1/2
- B
L=m1/3, giving a scale of m2/3
- C
L=m2/3, giving a scale of m1/3
- D
L=m, giving a scale of m2
Correct answer
BL=m1/3, giving a scale of m2/3
Explanation
Setting L=m1/3 makes both m/L and L2 equal to m2/3.
- A
- 30
After deleting tree edges from an initial spanning tree, how many resulting tree components can there be if d edges are deleted?
- A
At least d2
- B
At most d+1
- C
At most d−1
- D
Exactly 2d
Correct answer
BAt most d+1
Explanation
Deleting one edge from a tree increases its number of components by one, so deleting d tree edges produces at most d+1 components.
- A
- 31
Why is it sufficient to check whether non-tree edges reconnect components created by deleting tree edges?
- A
The surviving tree edges connect vertices within each component, so connectivity between components must come from other surviving edges
- B
A spanning tree contains all edges needed to reconnect itself after deletion
- C
Every non-tree edge is guaranteed to join two different components
- D
Non-tree edges are the only edges that remain after any deletion batch
Correct answer
AThe surviving tree edges connect vertices within each component, so connectivity between components must come from other surviving edges
Explanation
The remaining tree edges already connect each resulting tree component internally. The graph’s overall connectivity depends on whether surviving non-tree edges link those components.
- A
- 32
What does an Euler tour provide for representing a tree in the one-batch algorithm?
- A
A representation in which each tree edge is replaced by one point
- B
A sequence obtained by walking around the tree in which each tree edge appears twice
- C
A path that visits every vertex exactly once and uses every edge once
- D
A list containing only the leaves, ordered by their degrees
Correct answer
BA sequence obtained by walking around the tree in which each tree edge appears twice
Explanation
The described Euler-tour representation records a walk around the tree as a sequence, and each tree edge corresponds to two appearances in the tour.
- A
- 33
How are non-tree edges represented in the two-dimensional range-query structure?
- A
Each is stored as a single coordinate equal to the edge’s weight
- B
Each is stored as a rectangle covering every occurrence of both endpoints
- C
Each is stored as a point whose coordinates are the first tour positions of its endpoints
- D
Each is stored as an interval containing all tree edges on its cycle
Correct answer
CEach is stored as a point whose coordinates are the first tour positions of its endpoints
Explanation
For each non-tree edge, the algorithm places a point using the first occurrence of each endpoint in the Euler-tour sequence as its two coordinates.
- A
- 34
What operation does the described two-dimensional range-query structure support?
- A
Compute a minimum spanning tree of the points in a rectangle
- B
Delete an entire row or column and enumerate every point outside it
- C
Insert or delete points and return a point lying in a specified rectangle
- D
Sort all points by distance and return the nearest pair
Correct answer
CInsert or delete points and return a point lying in a specified rectangle
Explanation
The structure supports point insertion and deletion and can report a point inside a queried rectangle.
- A
- 35
How are deletions of non-tree edges handled in the one-batch algorithm?
- A
Delete the corresponding points from the range-query structure
- B
Leave the points in place because only tree-edge deletions matter
- C
Convert each deleted edge into a new tree edge
- D
Remove the endpoints from the Euler-tour sequence
Correct answer
ADelete the corresponding points from the range-query structure
Explanation
A deleted non-tree edge is removed from the graph’s corresponding point representation in the range-query structure.
- A
- 36
What does deleting a tree edge do to the Euler-tour representation used by the batch algorithm?
- A
It splits the tour sequence into intervals corresponding to the resulting tree components
- B
It changes only the coordinates of non-tree edges incident to leaves
- C
It removes every occurrence of each endpoint from the sequence
- D
It merges the two tree components into a single tour interval
Correct answer
AIt splits the tour sequence into intervals corresponding to the resulting tree components
Explanation
A tree-edge deletion partitions the tree and its Euler-tour sequence into intervals associated with the resulting components.
- A
- 37
Why does the one-batch algorithm perform roughly d2 rectangle queries after a batch of d deletions?
- A
The algorithm must query every pair of vertices in the graph
- B
Each deleted edge creates exactly d2 new points
- C
Each range query takes d2 time, and only one query is made
- D
The deletions create O(d) relevant intervals, and pairs of intervals can be checked using rectangle queries
Correct answer
DThe deletions create O(d) relevant intervals, and pairs of intervals can be checked using rectangle queries
Explanation
The deletion batch produces O(d) intervals. Checking the relevant pairs of intervals requires O(d2) queries, which gives the stated batch-processing scale.
- A
- 38
Why can a multi-batch algorithm potentially lead to a better dynamic update time than a one-batch algorithm?
- A
It eliminates the need to initialize any data structure
- B
It makes every batch contain all possible future updates
- C
It can process updates in stages with differently sized batches instead of repeatedly handling the entire prefix
- D
It guarantees that deletions never split a spanning tree
Correct answer
CIt can process updates in stages with differently sized batches instead of repeatedly handling the entire prefix
Explanation
A multi-batch reduction can schedule a large first batch followed by smaller later batches, using the staged structure to improve the balance of costs.
- A
- 39
In the two-batch illustration, which relationship between batch sizes was proposed?
- A
The first batch is larger than the second, with example scales m2/3 and m1/3
- B
The second batch is larger than the first, with example scales m2/3 and m1/3
- C
Both batches have equal size, each with scale m1/3
- D
The first batch has constant size and the second has scale m
Correct answer
AThe first batch is larger than the second, with example scales m2/3 and m1/3
Explanation
The illustration uses a first batch of scale m2/3 and a smaller second batch of scale m1/3.
- A
- 40
What is a vertex sparsifier in the setting described?
- A
A data structure that stores only the sequence of graph updates
- B
A tree that preserves the degrees of every nonterminal vertex exactly
- C
A subgraph that preserves every edge of the original graph but removes all terminals
- D
A smaller graph that contains the terminals and preserves selected information about the original graph relevant to them
Correct answer
DA smaller graph that contains the terminals and preserves selected information about the original graph relevant to them
Explanation
A vertex sparsifier is a compact graph containing the terminal set and preserving useful graph information related to those terminals.
- A
- 41
What size goal is sought for a graph H that sparsifies a graph with terminal set S?
- A
Its size should be proportional to the number of terminals, rather than the full graph size
- B
Its size should include every nonterminal vertex and no terminal vertices
- C
Its size should equal the number of edges in the original graph
- D
Its size should be independent of the number of terminals and the original graph
Correct answer
AIts size should be proportional to the number of terminals, rather than the full graph size
Explanation
The goal is to shrink a large graph to a graph whose size is proportional to the small terminal set, while preserving relevant information.
- A
- 42
What distance guarantee was described for the shortest-path sparsifier example?
- A
All distances between all vertex pairs are preserved exactly
- B
Terminal-pair distances are preserved within a factor of k
- C
Only distances from nonterminals to terminals are preserved within a factor of k
- D
Terminal-pair distances are reduced by exactly k
Correct answer
BTerminal-pair distances are preserved within a factor of k
Explanation
The example sparsifier preserves distances between terminal pairs up to a factor of k.
- A
- 43
What does a minmax path between s and t minimize?
- A
The sum of all edge weights on the path
- B
The largest edge weight on the path
- C
The number of vertices on the path
- D
The smallest edge weight on the path
Correct answer
BThe largest edge weight on the path
Explanation
A minmax path minimizes the maximum edge weight encountered along the path, not the total weight or the minimum edge weight.
- A
- 44
What key property does a minimum spanning tree have with respect to minmax paths?
- A
The tree preserves the total weight of every path in the graph
- B
The tree path between any two vertices minimizes the number of edges in every graph path
- C
The unique tree path between any two vertices is a minmax path in the graph
- D
Every graph minmax path is itself a path containing only tree edges
Correct answer
CThe unique tree path between any two vertices is a minmax path in the graph
Explanation
A minimum spanning tree preserves minmax-path information: its unique path between any two vertices is a minmax path in the original graph.
- A
- 45
Why would replacing the largest edge on a tree path with a lighter alternative edge contradict that the tree is a minimum spanning tree?
- A
The replacement would disconnect every terminal from the tree
- B
The replacement would increase the number of vertices in the tree
- C
The replacement would make the alternative path’s maximum edge weight larger
- D
The replacement would produce a spanning tree with smaller total weight
Correct answer
DThe replacement would produce a spanning tree with smaller total weight
Explanation
If another path connects the endpoints using edges lighter than the tree path’s largest edge, adding an appropriate alternative edge and removing that largest edge yields a spanning tree of smaller total weight, contradicting minimum-spanning-tree optimality.
- A

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