 Good, let's very quickly talk about the degrees of a node degrees of a node or graph Now remember if we had a complete graph So what was a complete graph that there is a connection between all of these nodes all of these vertices? Now the degree of this vertex here is the number of edges that are incident upon it There's one two three, so the degrees of this one is three the degrees of this one is also three This one is three and this one is three, so they all are three and that's actually another special type of graph that we call a regular graph a regular on a regular graph All the nodes have similar degree all of the nodes all of the vertices have a similar number of edges incident upon them Now the total degrees of you can talk about a graph total degrees That's where we'll just add up all of the degrees of these nodes as I say There's a special one regular and I want to show you all of this in Mathematica one more thing though And that is a loop a loop counts as two So now the degree of this This node here would be one two three four five So a loop counts as two, so we're not going to work much for loops But for now just remember if you get that kind of question Don't make that little mistake a loop a loop really counts for tools as incident The two edges incident upon upon the loop as far as that's concerned So let's go to Mathematica and we're going to look at the degrees and we're going to look at some regular graphs So let's have a look at this concept of degrees Let's just do let's just create a graph G as a computer variable and I'm going to make it a complete graph Let's go to the complete graph that we had before with ten with ten nodes. There we go beautiful Let's look at the vertex degree. So there's this function vertex Degree and let's query what graph G was all about and we see that all ten of these vertices had a degree of nine All of them had a degree of nine and that's you know, simple you can go count them But it makes obvious it makes obvious sense Now we can also say total so I'm just going to sum up because remember this is just a list of ten elements So let's do a total that will just sum all the elements numerical elements in a list So I'm going to say total vertex degree And I'm going to use graph G again close my my square brackets twice and it adds all of them up 90 Now note something here that the number of degrees of the vertices. They are twice the number of edges Twice number of edges. This is really known. I think as the handshaking lemma now because each edge has two vertices attached to them Because there is the thing called the edge count. Let's have a look at that edge Count if I do each count of G It's going to give me how many edges they are So if you were to go count all of these they're 45 they're 45 and then really the total Total of the vertex degree if I add all of them up vertex degree whoops vertex vertex degree of G and That is really we can ask is that equal to two times to space instead of multiplication the edge count The edge count of G and lo and behold, of course, it's going to be true So that's the hand shaking lemma that we see in action there So let's just have a look at the regular graph and that is where just have a look at a few play with a few of them That is where all the nodes are going to have The the the same degree. So let's just create a graph and you tell me So I'm going to say graph and let's make a list of the nodes first one two three and four There's my vertices and let's connect them. It's an undirected. So I'm going to connect these nodes one undirected edge to two and Let's make three undirected edge and four so they are all connected and let's have vertex labels I always like vertex vertex labels vertex labels and Give their name to the screen. There we go So let's have a look at this Four has degree one three has degree one two has degree one one has degree one all of them Have degree of one that is a regular. That is an absolutely regular graph Let me show you another one. That's an absolute regular graph that you might not have think think about So let's have a graph. Let's just make a list only of the edges So what about one and one they are connected? What about? makes them make it two and three and Let's make it three and two There we go. Let's put in vertex labels vertex labels and the name of those and there we go Look at this One has an edge count of two remember told you a loop is two Two has an edge count of two three hasn't has an edge kind of of two So all three nodes have an edge kind of two. This makes this a very easy regular graph so there we go Regular graphs and the degree of graphs