Figured out. Because acording to the constraints mentioned in the question edges start from 1 so there is no node for 0, so for 6 nodes we need matrix of size 7 ( for index 0 to 6).
The explanation is incomplete, it doesn't explain how we are avoiding overcounting an edge for cases like example 2, when the other edge is also a part of some other trio.
That is why I have subtracted 6 while counting the degree of a trio. One node of a trio has 2 internal degrees so 3 will have 6 internal degrees. In this way I am avoiding overcounting of internal edges. In case some edge is a part of another trio, it still doesn't matter cuz all trio have to seen uniquely. So I will just count the degree of all nodes of that trio and subtract 6 from it. You can do a dry run and see this. I hope it will be clear ? ...feel free to ask if still any doubt.
Glad... It was helpful. If this happens to be your 2nd or 3rd video on this channel plz consider subscribing it only takes a second and it really motivates me. If not it is fine 😊.
Crystal clear explanation....I guess when who is complete begineer in graph can also easily understand this problem after watching this video💯💯🔥
Subscribed ... Awesome explanation.!!
Thanks and welcome
Complete playlist : ua-cam.com/play/PLL1nj86QUnAzISikKTBGJTXGrSzvqnTBn.html
I have a small doubt, why are we taking size of adjacency matrix as n+1 for n nodes?
Figured out. Because acording to the constraints mentioned in the question edges start from 1 so there is no node for 0, so for 6 nodes we need matrix of size 7 ( for index 0 to 6).
Thanks a lot :)
Welcome 😊
The explanation is incomplete, it doesn't explain how we are avoiding overcounting an edge for cases like example 2, when the other edge is also a part of some other trio.
That is why I have subtracted 6 while counting the degree of a trio. One node of a trio has 2 internal degrees so 3 will have 6 internal degrees. In this way I am avoiding overcounting of internal edges.
In case some edge is a part of another trio, it still doesn't matter cuz all trio have to seen uniquely. So I will just count the degree of all nodes of that trio and subtract 6 from it. You can do a dry run and see this.
I hope it will be clear ? ...feel free to ask if still any doubt.
@@cherrycodingiit-g9273 I re-read the description and I realised that I had misunderstood the question.
Glad... It was helpful. If this happens to be your 2nd or 3rd video on this channel plz consider subscribing it only takes a second and it really motivates me. If not it is fine 😊.