Look at the adjacency matrix of a directed graph below, analyze the statements, and choose the right answer:
$$ A_{ij} = \begin{pmatrix} 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 \\  0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 \end{pmatrix} $$

OBS: To BFS and DFS consider starting at node 1 and in an ascending order.

I - This graph has a Cycle, so we can say that there is at least one back edge.

II - The order that the nodes are visited using DFS is 1-4-2-6-7-5-3.

III - The order that the nodes are visited using BFS is 1-4-5-2-6-7-3.

IV - Besides the graph presented by the matrix being a directed graph, in an undirected graph there are no forward and no cross edges.

a) I, II, III and IV are correct.

b) II and IV are correct.

c) I, II, IV are correct.

d) I, II, III are correct.

e) None of the above.

Original idea by: Tássia Martins

Comments

  1. Nice question, but we already have many concerning visiting orders.

    ReplyDelete

Post a Comment

Popular posts from this blog