Actually you are getting confused between adjacency matrix and transitive closure. Both are different from each other. We use adjacency matrix to calculate transitive closure using warshell algo. In case of transitive closure we assume that every node is reachable from itself.
In undirected graph we dont care for direction in the process of reaching a node. for example in the explained graph node B is reachable from other nodes but from B no node can be accessed in case of directed graph. On the other hand if we remove directions from this graph u can see now other nodes can also be reachable by B. In short in directed graph we can move in only one direction through the edge, but in undirected we can move in both the directions.
@@vinaysingh-xi1sw yes i knw that sir i am just confused about diagonal entry In some video they have said there will be 0 in A to A if there is no self loop in some video they have said there will be 1
Adjacency matrix gives information about only neighbor nodes while transitive closure give information about accessibility of one node to other node. For example in the graph i mentioned in the above lecture from A to D their is a path to access node D from A but node D is not directly connected to D through any edge. So we put 1 for A to D in transitive closure but in adjacency matrix we will put 0 in the same position because A is not neighbor of D. For more clarity you can go through lecture for adjacency matrix and find out transitive closure and adjacency matrix of the same graph i mentioned above. Adjacency matrix: ruclips.net/video/6I-FWG4w9dM/видео.html and ruclips.net/video/R1QH42JA9_E/видео.html
Transitive closure is a boolean matrix to shows reachability of the nodes in a graph. So we have to take diagonal values i.e. A to A, B to B etc as 1 because both are same vertex.
@@vinaysingh-xi1sw sir, only when we take transitive closure, we give value one for adjacency matrix and if we just take normal adjacency matrix, then self loop will be 0, correct sir ?
@@joemama9375in case of normal adjacency matrix, if self loop is only one edge like A to A, it is taken as 1. If self loop include path more than two edges like A to B to C, it is taken as 0.
Very good explanation ❤
Make more content like this.
amazing 2 marks aapki wajah and topic understandable. Your explanation is super sir!
Thanks for the compliment. I am glad to hear that content is helpful for you... :)
Is the whole video in english? There are chunks that I cannot understand at all.
Thanks sir!
Sir for self loop should we take always 1?? Am I right
yes you are right.
Sir I couldn't understand how At A matrix 1 came could u please explain me in detail?? It would be a great help to me
Actually you are getting confused between adjacency matrix and transitive closure. Both are different from each other. We use adjacency matrix to calculate transitive closure using warshell algo. In case of transitive closure we assume that every node is reachable from itself.
Whats the procedure for undirected graph .???
In undirected graph we dont care for direction in the process of reaching a node. for example in the explained graph node B is reachable from other nodes but from B no node can be accessed in case of directed graph. On the other hand if we remove directions from this graph u can see now other nodes can also be reachable by B.
In short in directed graph we can move in only one direction through the edge, but in undirected we can move in both the directions.
@@vinaysingh-xi1sw yes i knw that sir i am just confused about diagonal entry
In some video they have said there will be 0 in A to A if there is no self loop in some video they have said there will be 1
Nicely Explained - Is this math based or Cs based?
It is CS based relevant to Data Structure and Algorithms syllabus
Super sir tqq
Thanks
What is adjacency matrix then ?
Adjacency matrix gives information about only neighbor nodes while transitive closure give information about accessibility of one node to other node. For example in the graph i mentioned in the above lecture from A to D their is a path to access node D from A but node D is not directly connected to D through any edge. So we put 1 for A to D in transitive closure but in adjacency matrix we will put 0 in the same position because A is not neighbor of D. For more clarity you can go through lecture for adjacency matrix and find out transitive closure and adjacency matrix of the same graph i mentioned above. Adjacency matrix: ruclips.net/video/6I-FWG4w9dM/видео.html and ruclips.net/video/R1QH42JA9_E/видео.html
@@vinaysingh-xi1sw , thanks
@@Adivasilover10 Welcome
"A" doesn't have self loop how can you take A to A is 1
We take 1 on A to A when there is self loop
Transitive closure is a boolean matrix to shows reachability of the nodes in a graph. So we have to take diagonal values i.e. A to A, B to B etc as 1 because both are same vertex.
@@vinaysingh-xi1sw sir, only when we take transitive closure, we give value one for adjacency matrix and if we just take normal adjacency matrix, then self loop will be 0, correct sir ?
@@joemama9375in case of normal adjacency matrix, if self loop is only one edge like A to A, it is taken as 1. If self loop include path more than two edges like A to B to C, it is taken as 0.