GATE CSE 2023: Question Number 20 1 Master Paper: Question 20 Figure 1: Question Description Screenshot from the master question paper GATE Answer Key: 2 My Opinion: Possible answers should be 2 and 4 for this question as question is based on certain assumptions which are not given in the question. Explanation: There are two possible choices for the adjacency matrix for the given undi- rected graph G and hence two possible answers. Our first choice could be: 1 A ( G ) = 0 1 0 0 0 1 0 1 1 0 0 1 1 0 1 0 1 0 1 1 0 0 1 1 0 The problem with this matrix is that Handshaking lemma is not satisfied here because sum of each row gives the total degree of each vertex and so here total degree of all the vertices = 1 + 3 + 3 + 3 + 2 = 12 and total edges in the graph G is 7 and so, sum of degrees of all vertices ̸ = 2 × number of edges The reason is, this matrix is made on the assumption that self-loop has degree 1 and that’s why Handshaking Lemma is failed here be- cause the reason we take the degree of the self-loop as 2 to make Handshaking Lemma satisfied. Hence, if we make the assumption that self-loop has degree 1 then the answer will be 2 because of 2 self-loops, each with degree 1 and sum of all the eigenvalues of a matrix gives the trace of that matrix. Now, our second choice could be: A ( G ) = 0 1 0 0 0 1 0 1 1 0 0 1 2 0 1 0 1 0 2 1 0 0 1 1 0 Here, Handshaking lemma is satisfied because total degree=14 and sum of all the rows is 14 which gives the total degree for all the vertices and Hence, total number of edges is 7 Therefore, sum of degrees of all vertices = 2 × number of edges Again the reason is, this matrix is made on the assumption that self- loop has degree 2 and that’s why Handshaking Lemma is satisfied here because the reason we take the degree of the self-loop as 2 to make Handshaking Lemma satisfied. Hence, if we make the assumption that self-loop has degree 2 then the answer will be 4 because of there are 2 self-loops, each with degree 2 and sum of all the eigenvalues of a matrix gives the trace of that matrix. Graph Theory is still young and different authors use different conventions, 2 notation and definitions. Some authors use entry 1 for the self loop in the adjacency matrix for the corresponding undirected graph and some use entry 2 for the self loop in the adjacency matrix for the corresponding undirected graph. Now, I am giving the evidences that what I have written above is logically correct based on different graph theory books. 2 Evidences in the support of first choice of the Adjacency Matrix: 1) Graph Theory With Applications by Bondy and Murthy According to Bondy and Murthy, Adjacency matrix is defined as a v × v matrix A ( G ) = [ a ij ] , in which a ij is the number of edges joining v i and v j They have also given an example in Chapter 1: Graphs and Subgraphs. The following screenshot is taken from the graph theory book by Bondy and Murthy: Figure 2: Screenshot from Bondy and Murthy book to support self-loop has entry 1 in adjacency matrix 3 2) Graph Theory Reinhard Diestel They have defined the Adjacency Matrix as: Adjacency Matrix A = ( a ij ) n × n of G is defined by a ij := { 1 if v i v j ∈ E 0 otherwise Though they have not given any example for an adjacency matrix of a graph with self-loop but definition shows that self-loop has entry 1 in the Adjacency Matrix. 2) Convention followed by other authors A ) Introduction to Graph Theory by Douglas B. West They have not defined Adjacency Matrix for a graph with self-loop. They have defined Adjacency Matrix for loopless graphs. B ) Graph Theory by Harary They have defined the Adjacency Matrix as: The adjacency matrix A = [ a ij ] of a labeled graph G with p points is the p × p matrix in which a ij = 1 if v i is adjacent with v j and a ij = 0 otherwise. So, it is cleared from the definition that self-loop has entry 1 for the undirected graph G in the Adjacency matrix. C ) Graph Theory by Narsingh Deo They have taken entry 1 for the self-loop of a undirected graph G by writ- ing ”A self-loop at the i th vertex corresponds to x ij = 1 ” 3 Evidences in the support of second choice of the Adjacency Matrix: 1 ) Graph Theory and its Applications (3rd Edition) by Jonathan L. Gross, Jay Yellen and Mark Anderson This is a very famous graph theory book and it is also avalable on the Amazon. The author “Jonathan Gross” is a Professor of Computer Science at Columbia 4 University (considered as one of the top universities in the world) Now, To claim that entry 2 for the self loop of the undirected graph G in the corresponding Adjacency Matrix : It can be seen in the Chapter 2 STRUC- TURE AND REPRESENTATION with the Exercise 2 6 1 at page no. 104 and the solution at page no. 528 in the pdf format of the book which can be downloaded from here. I am attaching the corresponding question and its solution from the above men- tioned exercise of the corresponding book. Figure 3: Exercise 2 6 1 at page no. 104 from the graph theory book by Jonathan Gross Figure 4: Solution of the Exercise 2 6 1 at page no. 528 from the graph theory book by Jonathan Gross 5 It is cleared from the above screenshots that self-loop for the undi- rected graph G has entry 2 in the corresponding Adjacency Matrix. 2 ) Algebraic Coding Theory and Information Theory This book is published by American Mathematical Society(AMS) and DIMACS and can be found on AMS Bookstore or Amazon or the Google Books. In this book, it is also mentioned that self-loop has entry 2 in the Adjacency Matrix for the corresponding graph G. I am attaching the screenshot from this book for the confirmation of this fact. Figure 5: Relevant screenshot from Algebraic Coding Theory, Page No. 63 6 The complete page no. 63 from this book is given below: Figure 6: Algebraic Coding Theory, Page No. 63 3 ) Universit` a degli Studi di Udine Graph Theory Course This is the university situated in Italy where in the graph theory course, it is also taught that self-loop has entry 2 in Adjacency Matrix of the correspond- ing undirected graph G. The following screenshot is taken from the graph theory course by mentioned university and its link can be found here 7 Figure 7: Image Source: Universit` a degli Studi di Udine Graph Theory Course Figure 8: Image Source: Universit` a degli Studi di Udine Graph Theory Course In the above link, it is mentioned that: Notice that a simple loop in an undirected graph is represented by setting to 2 the corresponding matrix entry. Why? Edges in an undirected graph are represented with two entries a i,j and a j,i in the adjacency matrix. This is the case also for self-edges (in this case both entries coincide). One can also have multiple self-edges. Such edges are represented by setting the corresponding diagonal element of the adjacency matrix equal to twice the multiplicity of the edge. 3 ) Wikipedia In wikipedia page of Adjacency Matrix, it is also mentioned that self-loop has entry 2 in the Adjacency Matrix for the undirected graph G. 8 Please find the attached screenshot from the wikipedia page of Adjacency Ma- trix: Figure 9: Image Source: Wikipedia page of Adjacency Matrix of an undirected graph 4 ) Medium Blog Brooke Bradley has published a blog which also mentioned that self-loop has entry 2 in the Adjacency Matrix for the corresponding undirected graph G. 9 Please find the attached screenshot from the blog below: Figure 10: Image Source: Medium Blog: How to Represent an Undirected Graph as an Adjacency Matrix 10 Figure 11: Image Source: Medium Blog: How to Represent an Undirected Graph as an Adjacency Matrix Here it is also mentioned that: Notice that a loop is represented as a 2. For undirected graphs, each loop adds 2 since it counts each time the edge meets the node. (If there were two loops for node 1, the entry would be 4.) 4 Final Remark As we have already seen many evidences for both self-loop with entries 1 or 2 in the Adjacency matrix for the corresponding undirected graph G (but each entry of 1 or 2 should be consistent for the whole matrix) from the reliable resources (textbooks etc) and the reason is also mentioned in the beginning. Therefore, it is logically correct to take self-loop with entries 1 and 2 in the Adjacency Matrix for the corresponding undirected graph G. Hence, I am kindly requesting you, to please change answer key from 2 to 2 , 4 because both the answers i.e. 2 and 4 are possible and logi- cally correct based on the above evidences. 5 References 1. GRAPH THEORY WITH APPLICATIONS by J. A. Bondy and U. S. R. Murty, Departmnent of Combinatorics and Optimization, University of Waterloo, Ontario, Canada. 11 2. Graph Theory by Reinhard Diestel. 3. Introduction to Graph Theory, Second Edition, by Douglas B. West, Uni- versity of Illinois — Urbana. 4. Graph Theory with Applications to Engineering and Computer Science by Narsing Deo, Millican Chair Professor, Dept. of Computer Science, Director, Center for Parallel Computation, University of Central Florida 5. Graph Theory by FRANK HARARY, Professor of Mathematics, Univer- sity of Michigan 6. Graph Theory and its Applications (3rd Edition) by Jonathan L. Gross, Jay Yellen and Mark Anderson 7. Algebraic Coding Theory and Information Theory, Edited by: A. Ashikhmin : Bell Labs, Lucent Technologies, Murray Hill, NJ A. Barg : University of Maryland, College Park, MD, A co-publication of the AMS and DIMACS. 8. Universita degli Studi di Udine Graph Theory Course 9. Wikipedia page of Adjacency Matrix 10. Medium Blog: How to Represent an Undirected Graph as an Adjacency Matrix by Brooke Bradley 12