What's new

Help Can you answer this?

Status
Not open for further replies.

zxcgil

Eternal Poster
Established
1712914863679.png


1. Give one path from 7 to 8.
2. What is the shortest path from 1 to 8?
3. Using DFS, what would be the traversal of the graph?
4. Using BFS, what would be the traversal of the graph? [Type each level, in ascending order]
 

Attachments

Solution
Use this directed graph for items 1 to 4.

1. Give one path from 7 to 8.
*
7-6-5-8
2. What is the shortest path from 1 to 8?
*
1-2-8
3. Using DFS, what would be the traversal of the graph?
*
4. Using BFS, what would be the traversal of the graph? [Type each level, in ascending order]
1. One path from node 7 to node 8 could be:
7 -> 6 -> 5 -> 8

2. The shortest path from node 1 to node 8 depends on the specific graph structure and weights on the edges. To determine the shortest path, you would typically use algorithms like Dijkstra's algorithm or A* search algorithm.

3. Depth-First Search (DFS) traversal of a graph would start at a chosen node and then explore as far as possible along each branch before backtracking. Without the specific graph structure provided, I can't give you the exact traversal path.

4. Breadth-First Search (BFS) traversal of a graph would explore all the neighbor nodes at the present depth prior to moving on to the nodes at the next depth level. Without knowing the exact graph structure, I can't provide the traversal levels.
 
Use this directed graph for items 1 to 4.

1. Give one path from 7 to 8.
*
7-6-5-8
2. What is the shortest path from 1 to 8?
*
1-2-8
3. Using DFS, what would be the traversal of the graph?
*
4. Using BFS, what would be the traversal of the graph? [Type each level, in ascending order]
 
Solution
Status
Not open for further replies.

Similar threads

Back
Top