Can someone try and explain for me how this applies in graphs. Thanks 🙏🏽
Edges go between 2 vertices. Say you have a graph that looks like a -> b -> c You could store the edges in a list of pairs, like [(a, b), (b, c)]. And that's your adjacency list. Another way to do it is to make a table where you mark what is connected to what, like a b c a X X b X X c X (a->a is assumed to be true here) Now replaces all Xs with 1 and the others with 0. Your adjacency matrix is 1,1,0, 0,1,1, 0,0,1
Of course they are, but I'm talking about consistency. Your "diagram" and adjacency list didn't have them.
Schindlabua nicely explained. But those three 1s along the diagonal correspond to loops (edge connecting a vertex to itself). So they shouldn't really be there.
Depends on your graph. Loops in a graph are fine!
Yeah, good point!
thank you man!!!
Python — File Handling
Loop question, I've tried everything that I knew I just don't know. Please help me solve it out
Help me solve this (using loop)
What is wrong? Error on test.
Help me wiht python