Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer all of the question. Marks for each question is indicated on the right side a . Construct an adjacency matrix for the following graph:

Answer all of the question. Marks for each question is indicated on the right side
a. Construct an adjacency matrix for the following graph:
2
b. Consider A graph G with vertices (1,2,3,4} and edges ,(4,1),(2,1),(2,4). For every vertex u, find its indegree in (u) and its outdegree out (u). What is the value of the following Sum for this graph?
uinv?in(u)+ out (u)=
3
c. In the following graphs, assume that if there is ever a choice amongst multiple nodes, both the BFS and DFS algorithms will choose the left-most node first.
A'B'C
2
Starting from the node S at the top, which algorithm will visit the least number of nodes before visiting the goal node G? Breadth First Search, Depth First Search, or both Algorithm will encounter the same number of nodes? Explain.
2. a. Apply DFS and show the discovery and finishing time of each node considering the source node is B
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions