Graph Algorithms

This quiz covers fundamental concepts and algorithms related to graph theory, including graph traversal, shortest path finding, and graph connectivity.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

In a graph, what is the maximum number of edges that can exist between any two vertices?

  1. 1
  2. 2
  3. 3
  4. It depends on the number of vertices in the graph
Question 2 Multiple Choice (Single Answer)

Which graph traversal algorithm visits each vertex exactly once and returns to the starting vertex?

  1. Depth-First Search (DFS)
  2. Breadth-First Search (BFS)
  3. Dijkstra's Algorithm
  4. Kruskal's Algorithm
Question 3 Multiple Choice (Single Answer)

What is the time complexity of Dijkstra's algorithm for finding the shortest path in a weighted graph?

  1. O(V)
  2. O(V^2)
  3. O(E log V)
  4. O(E^2)
Question 4 Multiple Choice (Single Answer)

Which graph algorithm is used to find the minimum spanning tree of a weighted graph?

  1. Depth-First Search (DFS)
  2. Breadth-First Search (BFS)
  3. Dijkstra's Algorithm
  4. Kruskal's Algorithm
Question 5 Multiple Choice (Single Answer)

What is the name of the algorithm that finds all the connected components in an undirected graph?

  1. Depth-First Search (DFS)
  2. Breadth-First Search (BFS)
  3. Dijkstra's Algorithm
  4. Kruskal's Algorithm
Question 6 Multiple Choice (Single Answer)

In a graph, what is the maximum number of edges that can exist in a tree with n vertices?

  1. n-1
  2. n
  3. n+1
  4. 2n-1
Question 7 Multiple Choice (Single Answer)

Which graph traversal algorithm is used to find the shortest path between two vertices in an unweighted graph?

  1. Depth-First Search (DFS)
  2. Breadth-First Search (BFS)
  3. Dijkstra's Algorithm
  4. Kruskal's Algorithm
Question 8 Multiple Choice (Single Answer)

What is the name of the algorithm that finds the longest path between two vertices in a directed acyclic graph (DAG)?

  1. Depth-First Search (DFS)
  2. Breadth-First Search (BFS)
  3. Dijkstra's Algorithm
  4. Longest Path Algorithm
Question 9 Multiple Choice (Single Answer)

Which graph algorithm is used to find the minimum cut in a graph?

  1. Depth-First Search (DFS)
  2. Breadth-First Search (BFS)
  3. Dijkstra's Algorithm
  4. Kruskal's Algorithm
Question 10 Multiple Choice (Single Answer)

In a graph, what is the name of the algorithm that finds all the cycles in the graph?

  1. Depth-First Search (DFS)
  2. Breadth-First Search (BFS)
  3. Dijkstra's Algorithm
  4. Cycle Detection Algorithm
Question 11 Multiple Choice (Single Answer)

What is the name of the algorithm that finds the strongly connected components in a directed graph?

  1. Depth-First Search (DFS)
  2. Breadth-First Search (BFS)
  3. Dijkstra's Algorithm
  4. Strongly Connected Components Algorithm
Question 12 Multiple Choice (Single Answer)

In a graph, what is the name of the algorithm that finds the topological order of the vertices in a directed acyclic graph (DAG)?

  1. Depth-First Search (DFS)
  2. Breadth-First Search (BFS)
  3. Dijkstra's Algorithm
  4. Topological Sort Algorithm
Question 13 Multiple Choice (Single Answer)

Which graph algorithm is used to find the maximum flow in a flow network?

  1. Depth-First Search (DFS)
  2. Breadth-First Search (BFS)
  3. Dijkstra's Algorithm
  4. Ford-Fulkerson Algorithm
Question 14 Multiple Choice (Single Answer)

In a graph, what is the name of the algorithm that finds the minimum cost spanning tree of a weighted graph?

  1. Depth-First Search (DFS)
  2. Breadth-First Search (BFS)
  3. Dijkstra's Algorithm
  4. Prim's Algorithm
Question 15 Multiple Choice (Single Answer)

Which graph algorithm is used to find the shortest path between two vertices in a directed graph with negative edge weights?

  1. Depth-First Search (DFS)
  2. Breadth-First Search (BFS)
  3. Dijkstra's Algorithm
  4. Bellman-Ford Algorithm