 So I think I've shown you so many graphs and I'm sure you've explored some of your own in Mathematica So whether you have the desktop version or you're just using a free-of-charge On the Mathematica cloud server itself on the web now I'm sure I'm sure you've seen the beauty of all of these graphs So let's move on to something slightly different and we're going to discuss these things The first one is called a walk and a walk just means I go from node To another node to another node maybe back to that same node Maybe back to that same node then to that node then to that node then back to that node Back to that node. So I've just taken a walk I don't care if I go along the same path again in whichever direction I don't care that I go to another node and I visit that node again doesn't matter a trail is something a bit different in a trail I might visit The same node again, but I don't revisit an edge. I don't revisit an edge a Closed one. This means I start an end this Trail no edges repeated at the same node my start node of my end node is exactly the same node a Path is even more restrictive There I'm not going to revisit any nodes or edges So I'm going to go but I can never go where I've been before So that would be a path now in a connected graph. I can assist this term Slightly separate from these it just really means that I can visit every node In my graph while following an edge There's not a set of Disconnected vertices or nodes which I cannot get to by following That's so it stands slightly separate from this But just see this connected and then usually one of these edges is called a bridge or there might be more than one bridge If I remove that then there's a set of vertices or a vertex that I cannot get to that makes it disconnected So it's usually brought in here, but to see it stands slightly separate from it. So walk. I'm just walking randomly trail I can Visit the same nodes again, but not the edges if I start and stop at the same one It's closed and the path is I cannot repeat anything not a node. I can't revisit a node and I can't go Pass the same edge again a cycle is then just this this idea of a closed walk So I'm going to go all the way all the way all the way and just get back to where I started So this beginning and end is the exact same so I've gone in a cycle You can I can mention remember when we had the cycle graphs, you know, that will be a beautiful example of of a cycle So let's go and just visually explore the definition of these things Inside of Mathematica So here we are in Mathematica and I've prepared this little section here Part actually of notes that I keep on the subject So I have your paths and cycles and I and let's just go through this some text that I've written here in this Just so that we are clear about these definitions and you really have to memorize these They've got to become part of your normal vocabulary so that you understand what these things are So a walk is the movement from one node to another by way of the edges that are incident upon them So I'm just going from node to node that is simply the act of moving along a graph and there's no concerned about repeating or meeting the nodes or the edges and We can be more discerning about we move along a graph and not repeat any edges And that is called a trail and we can be even more discerning Which is then a path in which all the vertices are and the edges are unique. So I cannot repeat any of them a Connected graph is then a graph that in which there's a path between all pairs of vertices a Bridge is in a special edge in that if it is removed the graph becomes disconnected Every disconnected graph can be split up into a number of connected subgraphs In this case the subgraphs are called components. So let's look at this graph So what you see here is this text cell a code cell I should say and what you can see here these little Parentheses and then two stars and anything in between is called a code comment And that is just totally ignored by the Wolfram language It's this code that you can put their little comments to yourself or to someone else who sees your code So I'm creating this computer variable g I'm creating this graph with vertices one two three four five and we have this Undirected edges between one and two two and three three and four and then four and five So you can clearly see this is a disconnected graph because if I am on one two three There's no ways I can get to four five and I can actually use the connected graph q That's a question is G a connected graph and I get the result which says it is false It is not a correct connected graph, but we can see four and five. That's a connected graph one two and three It's a connected graph because I can actually use this connected components Function or keyword pass the argument g and it'll tell me one two and three here the order They doesn't matter and four and five those will be two components and they will be completely connected Now let's look at this graph g that I've constructed here one two two one two six two two three two and five Two and six three and four three and five four and five five and six six and six and six and one with the vertex labels And there's the representation of this graph g So a closed walk is a walk that begins and ends at the same vertex and that's very similar to a closed Trail remember now it's just about the trail then these edges not being repeated If I don't start an end at the same one both of these that just be open and open walk on open trail a Cycle is then a closed walk So I'm gonna start and begin at the same one so that one can be repeated So don't make that mistake if I start an end and it's a cycle You know or closed that is a repeat of a node that is allowed So cycle is a closed walk in which all the edges are different and all the intermediate vertices are different So that's a very special walk. I'm gonna start and end at the same one But it's like a path. So I'm not repeating any nodes or edges except the first and the last one So here it is. Let's have a look. So let's just walk as I written down here from two to five to three to four to Five to six to two. So I started and ended This at the same. So this is closed, but I repeated five so I did repeat five and But I didn't repeat any edges so You know, I could see this as a walk but but also as a trail because none of these edges Let's just go again. Let's just make sure two to five to three to four to five back to two Okay, so to six to two at least so the edges were not I did not repeat any of the edges Now if we walk from six to six to six to six at all we have we actually have a closed walk And it is indeed a cycle because I you know, I have not repeated any of my edges And I it's closed because I start and I end at the same vertex and by definition as I say yeah, that is not You know, that is not repeating that it's just the start and the end and let's take this other one I walk from one to two To three to four to five to six and back back to one That is a cycle because I didn't repeat any of the nodes or edges and I start and stop at the same at the same vertex Just a little one here that which I didn't discuss on the board a cycle such as the walk from two to five to six and two so two five Six and two that is also called a triangle So play around with these try and create these figure out by these definitions What would be you know walk which is very simple a trail a path? What is a connected graph in the disconnected graph you can check that you can check the components Of of a graph as we said here the Connected components of G if it is a disconnected graph and then look at cycles that you can find inside of graphs that you do construct