Question discussion

In a directed weighted graph the edges are A→B (4), A→C (1), C→B (2), B→D (1) and C→D (5). What is the length of the shortest path from A t…

1186Medium DSSSB TGT Computer Science 0 replies

In a directed weighted graph the edges are A→B (4), A→C (1), C→B (2), B→D (1) and C→D (5). What is the length of the shortest path from A to D?

  • A4
  • B5
  • C6
  • D7
Correct answer: A

Explanation

The path A → C → B → D costs 1 + 2 + 1 = 4, which beats A → B → D (5) and A → C → D (6).

Discussion 0

Nobody has replied yet. Start the discussion!