Adjacency Matrix

Question 1
Marks : +2 | -2
Pass Ratio : 100%
Given an adjacency matrix A = [ [0, 1, 1], [1, 0, 1], [1, 1, 0] ], The total no. of ways in which every vertex can walk to itself using 2 edges is ________
2
4
6
8
Explanation:
A2 = [ [2, 1, 1], [1, 2, 1], [1, 1, 2] ], all the 3 vertices can reach to themselves in 2 ways, hence a total of 3*2, 6 ways.
Question 2
Marks : +2 | -2
Pass Ratio : 100%
Adjacency matrix of all graphs are symmetric.
False
True
Explanation:
Only undirected graphs produce symmetric adjacency matrices.
Question 3
Marks : +2 | -2
Pass Ratio : 100%
The number of elements in the adjacency matrix of a graph having 7 vertices is __________
7
14
36
49
Explanation:
There are n*n elements in the adjacency matrix of a graph with n vertices.
Question 4
Marks : +2 | -2
Pass Ratio : 100%
On which of the following statements does the time complexity of checking if an edge exists between two particular vertices is not, depends?
Depends on the number of edges
Depends on the number of vertices
Is independent of both the number of edges and vertices
It depends on both the number of edges and vertices
Explanation:
To check if there is an edge between to vertices i and j, it is enough to see if the value of A[i][j] is 1 or 0, here A is the adjacency matrix.
Question 5
Marks : +2 | -2
Pass Ratio : 100%
Which of these adjacency matrices represents a simple graph?
[ [1, 0, 0], [0, 1, 0], [0, 1, 1] ]
[ [1, 1, 1], [1, 1, 1], [1, 1, 1] ]
[ [0, 0, 1], [0, 0, 0], [0, 0, 1] ]
[ [0, 0, 1], [1, 0, 1], [1, 0, 0] ]
Explanation:
A simple graph must have no-self loops, should be undirected.
Question 6
Marks : +2 | -2
Pass Ratio : 100%
What is the maximum number of possible non zero values in an adjacency matrix of a simple graph with n vertices?
(n*(n-1))/2
(n*(n+1))/2
n*(n-1)
n*(n+1)
Explanation:
Out of n*n possible values for a simple graph the diagonal values will always be zero.
Question 7
Marks : +2 | -2
Pass Ratio : 100%
For the adjacency matrix of a directed graph the row sum is the _________ degree and the column sum is the ________ degree.
in, out
out, in
in, total
total, out
Explanation:
Row number of the matrix represents the tail, while Column number represents the head of the edge.
Question 8
Marks : +2 | -2
Pass Ratio : 100%
In the given connected graph G, what is the value of rad(G) and diam(G)?
2, 3
3, 2
2, 2
3, 3
Explanation:
Value of eccentricity for vertices A, C is 2 whereas for F, B, D, E it is 3.
Question 9
Marks : +2 | -2
Pass Ratio : 100%
What would be the number of zeros in the adjacency matrix of the given graph?
10
6
16
0
Explanation:
Total number of values in the matrix is 4*4=16, out of which 6 entries are non zero.
Question 10
Marks : +2 | -2
Pass Ratio : 100%
The time complexity to calculate the number of edges in a graph whose information in stored in form of an adjacency matrix is ____________
O(V)
O(E2)
O(E)
O(V2)
Explanation:
As V entries are 0, a total of V2-V entries are to be examined.