Question:

Let G be a directed graph whose vertex set is the set of numbers from 1 to 100. There is an edge from a vertex i to j if and only if either j = i + 1 or j = 3i. The minimum number of edges in a path in G from vertex 1 to vertex 100 is:

Show Hint

When solving shortest path problems: Use BFS or Dijkstra’s algorithm for directed graphs and Understand the edge conditions carefully.
Updated On: Dec 29, 2024
  • 4
  • 7
  • 23
  • 99
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

The problem can be solved using Breadth-First Search (BFS) to determine the shortest path. The total number of edges is: 4 + 3 = 7.
Was this answer helpful?
0
0