Graph Algorithms - BFS, DFS, shortest paths, maximum flow, minimum spanning trees - Question Bank
1. For a connected graph G = (V, E), what is the number of edges in any Minimum Spanning Tree?
2. Which algorithm is suitable for finding the shortest paths in a weighted graph that may contain negative edge weights but no negative cycles?
3. In the context of maximum flow, what does the residual graph represent?
4. Which of the following is NOT a common application of BFS?
5. If `dist[v]` stores the shortest distance from the source to vertex `v`, and `w(u, v)` is the weight of edge (u, v), the relaxation step in Dijkstra's algorithm is:
6. DFS is often used for topological sorting of:
7. What characterizes the edges chosen by Kruskal's algorithm for an MST?
8. Prim's algorithm, when implemented with a binary heap, has a time complexity of:
9. What is the relationship between the capacity of a cut and the flow through that cut in a flow network?
10. The Ford-Fulkerson method iteratively finds augmenting paths and increases the flow until:
11. Which algorithm can solve the All-Pairs Shortest Path problem?
12. What is the purpose of the 'visited' array in both BFS and DFS?
13. Consider a directed graph. BFS is typically used to find shortest paths in:
14. The 'finish time' of a vertex in DFS is:
15. If a graph is disconnected, what can we say about its Minimum Spanning Tree?
16. Which of these is a greedy algorithm for finding a Minimum Spanning Tree?
17. What is the residual capacity of an edge (u, v) in a flow network?
18. The Bellman-Ford algorithm performs V-1 iterations of relaxation. If, after V-1 iterations, any edge can still be relaxed, it indicates the presence of a:
19. Which of the following statements about Dijkstra's algorithm is FALSE?
20. In BFS, the 'level' of a node refers to:
21. What is the primary goal of DFS in terms of graph exploration?
22. Kruskal's algorithm relies on which data structure to efficiently check if adding an edge creates a cycle?
23. Which property must a graph satisfy to have a Minimum Spanning Tree?
24. A cut in a flow network is a partition of the vertices into two sets, S and T, such that:
25. The Edmonds-Karp algorithm is a specific implementation of the Ford-Fulkerson method that uses which algorithm to find augmenting paths?
26. If a graph contains a negative cycle reachable from the source, what will happen to Bellman-Ford algorithm?
27. Which of the following is a key component of Dijkstra's algorithm to keep track of the shortest distance found so far from the source to each vertex?
28. In DFS, the 'discovery time' of a vertex is:
29. What does BFS find in an unweighted graph?
30. An augmenting path in the context of maximum flow is a path from the source to the sink along which:
31. Which of the following is NOT a characteristic of a flow network used in maximum flow problems?
32. What is the time complexity of the Floyd-Warshall algorithm for a graph with V vertices?
33. The Floyd-Warshall algorithm computes the shortest paths between:
34. What is the shortest path from a source node to itself in any graph?
35. DFS can be used to detect cycles in a directed graph by keeping track of:
36. In BFS, when we visit a node `u` and explore its neighbor `v`, if `v` has not been visited, `v` is marked as visited and added to the:
37. What is the time complexity of Kruskal's algorithm using a Disjoint Set Union (DSU) data structure?
38. Prim's algorithm and Kruskal's algorithm both find the Minimum Spanning Tree of a graph. What is a key difference in their approach?
39. Which algorithm is commonly used to find a Minimum Spanning Tree (MST)?
40. A Minimum Spanning Tree (MST) of a connected, undirected graph is a subset of the edges that:
41. Which theorem states that the maximum flow in a network is equal to the capacity of a minimum cut?
42. What is the primary application of the Ford-Fulkerson method in graph algorithms?
43. The Bellman-Ford algorithm can find the shortest paths in a graph that contains:
44. What is the time complexity of Dijkstra's algorithm using a binary heap for a graph with V vertices and E edges?
45. Dijkstra's algorithm guarantees finding the shortest path if all edge weights are:
46. Which algorithm finds the shortest path between two nodes in a weighted graph with non-negative edge weights?
47. In Depth-First Search (DFS), what is the maximum depth of the recursion stack in a graph with V vertices and E edges?
48. What data structure is typically used to implement Breadth-First Search (BFS)?
49. Which graph traversal algorithm explores as far as possible along each branch before backtracking?