Unit 4: Graph Algorithms, Network Optimization, and Greedy Technique - Subjective Questions

CSE408 — Design And Analysis Of Algorithms • Practice Questions with Detailed Answers

20 questions

1

Define a graph and explain its major types, basic terminology, and common representations.

2

Explain the Breadth-First Search algorithm with its procedure, data structure, and time complexity.

3

Show how BFS computes single-source shortest paths in an unweighted graph. Explain why the distances produced by BFS are correct.

4

Describe Depth-First Search, including its recursive procedure, discovery and finishing times, and complexity.

5

Distinguish between Breadth-First Search and Depth-First Search.

6

Explain how DFS can be used to detect cycles and find connected components in graphs.

7

What is topological sorting? Explain both the DFS-based method and Kahn's algorithm for obtaining a topological order.

8

State the conditions under which a topological ordering exists. When is the ordering unique?

9

Define the greedy approach. State its essential properties and general design steps.

10

Explain the exchange argument and the stays-ahead argument used to prove the correctness of greedy algorithms.

11

Explain the greedy solution to the fractional knapsack problem. Solve the instance with capacity and items .

12

Compare the fractional and knapsack problems. Demonstrate why the ratio-based greedy strategy can fail for knapsack.

13

Define a minimum spanning tree and explain the cut property and cycle property used in MST algorithms.

14

Describe Prim's algorithm for finding a minimum spanning tree, and analyze its correctness and complexity.

15

Explain Kruskal's algorithm and the role of the disjoint-set data structure in its implementation.

16

Compare Prim's and Kruskal's minimum spanning tree algorithms.

17

Explain Dijkstra's algorithm for the single-source shortest-path problem. Why does it require nonnegative edge weights?

18

Describe the Bellman-Ford algorithm and explain how it detects a negative-weight cycle.

19

Derive the Floyd-Warshall recurrence for the all-pairs shortest-path problem and explain the algorithm.

20

Compare major approaches for solving single-source and all-pairs shortest-path problems, and state when each should be used.