Advance

Graphs Data Structure Questions

DSA
10 questions

Question 1

What is the primary advantage of using the Floyd-Warshall algorithm over Dijkstra's algorithm for finding shortest paths in a graph?

Question 2

What is a potential drawback of using A* search in practice?

Question 3

Consider a network flow graph with a source 's' and sink 't'. Applying the Ford-Fulkerson algorithm results in a maximum flow of 10 units. Now, we increase the capacity of an edge on the shortest augmenting path by 2 units. What is the maximum possible flow after this modification?

Question 4

In the worst case, how many iterations does the Bellman-Ford algorithm need to guarantee finding the shortest path?

Question 5

What is the minimum number of edges that need to be removed from a complete graph with 'n' vertices to make it acyclic (i.e., having no cycles)?

Question 6

In the context of shortest path algorithms, what is 'relaxation'?

Question 7

How does Johnson's algorithm address the issue of negative edge weights when using Dijkstra's algorithm?

Question 8

What is the time complexity of the A* search algorithm in the worst case, assuming a consistent heuristic?

Question 9

What is the time complexity of the Edmonds-Karp algorithm when using a Breadth-First Search (BFS) to find augmenting paths in a network flow graph with 'V' vertices and 'E' edges?

Question 10

In the worst-case scenario, what is the time complexity of the Floyd-Warshall algorithm for a graph with 'V' vertices?