 Okay, so the beautiful topic of graph theory, let's write that down. Graph is in graph theory. First of all, it's such a wonderful branch of mathematics. And why it's not taught at schools or at universities, maybe at your college it is taught, you know, at least at the beginning. And why all this emphasis is on calculus, calculus is fantastic, but there's other fantastic stuff too. And something perhaps more proper, oh, it's terrible to say, but more proper branch of mathematics called graph theory. Now with graph theory, you know, this is not what we're talking about or what little graphs can I draw. Little bar chart, little pie charts, it's not the graphs we're talking about. There are only two things in a graph. Number one is a node. Let's make two of them. These are nodes, otherwise known as vertices. And sometimes I like to call them nodes and I think it's more proper and sometimes I like to call them vertices, whatever depends on the class you take, the textbook you read is going to call them one or two of the others. And these are connected or not connected by an edge, an edge. It's a bit of an odd word if you think about it. We're not standing at the edge of a cliff, it's not the edge of a table, it's a connection. But anyway, we call it an edge. So we have these nodes and vertices. I can have another node here and another edge there, but you can see there's no edge between those two. So I can also have the standalone little node there and it's not connected to anything. Shame, it's standing all alone. I can have nothing, suppose. I can also just have a single node and there's nothing connected to it. It's the standing all on its own. It's also a graph. All of these things are graphs. The problem here, and don't make that error, don't see this as a point in a line connecting them. It's not, this is a very abstract thing. It's these nodes and the connections between them. And they exist, they exist all on their own. They don't need anything attached to them. They don't need to explain anything. They are just this wonderful abstract thing. Now we can make many uses of it. This can be a network of our friends. Let's have Sue and Sarah and Amy and whoever, what other ever, just thinking of short names coming into my head. So that can be a social network. It can be places that need to be visited and nodes that need to be travelled. So it's found all these applications, graph theory, but it exists all on its own and its own little world of these very abstract nodes and these very abstract connections between them. So for now, remember, there's nodes or vertices and these edges. And what's that? There's this whole rich world that's going to open up to you. This is really a wonderful, wonderful subject and it's not that difficult. It's easy at least to get the introduction to it. It's quite easy to grasp, but it's such a wonderful field. So let's go to Mathematica and let's look at some very simple lines of code which you can pick up very easily. As I said, Wolfram doesn't pay me for this. I've got nothing to do with the company. I think it's a wonderful language. There's going to be these descriptions down below where you can use it free of charge in a web browser in the cloud. You can buy a subscription. You can buy the full package itself for what it is, for what you get, how powerful it is. I think it really is cheap. Find out from university, your place of work, if they have a site license, you might be able to get it free of charge. Whichever way you go, you can use the Wolfram language. You're going to pick it up so easy. I do have a course on it on Udemy. There'll be a link below. If you do want to do that course, it'll teach you very quickly the fundamentals of it. Wait until the course is on sale. Udemy has sales all the time. Then you get it for very, very cheap. You can get that course very cheaply done. Or just follow along with what I'm going to do. I'll show you the wonderful world of drafts, not only on the board, but mostly in the Wolfram language and show you just how easy it is to do, how easy it is to pick up that language. Learning a computer language together with mathematics is just a proper way to do it. Let's go have a look. So here we are in Mathematica. I've got the desktop version here. I hope from the links down below you've sorted yourselves out. You know you have a place where you can code, whether it's in your browser, online free of charge, whether you've subscribed to the Wolfram programming lab, whether you've subscribed just to the desktop version, whether you have a site license, whether you bought the product outright, doesn't matter. Everything I do here, if you've got access to one of those, you can play along. So I've shown you what a graph is. Let me show you how easy it is just to create a graph. So let's just do some coding. I'm just going to write the word graph. I'm going to write GRA, this list of things appeared here. It's called Mathematica trying to guess at what I want to write. So it's called tab completion. So it's obviously the top one. I'm just going to hit tab and it's going to finish that off for me. I don't even have to write the whole word. But what is this word? What's happening here? Well, this is a keyword, a function in the Wolfram language. And there's over 6,000 of them. And you pass it some information and the Wolfram language knows what to do with that information that you pass it. All the information that you pass go inside of square brackets. So after one of these 6,000 plus functions, you always put a square bracket and you're going to pass some information to this. This information we call arguments. So there's two lots of arguments I want to pass. The first lot is going to be my nodes and the second lot is going to be the edges. Just as I showed you, there were nodes or vertices and there were edges. And let's just create 4 nodes or 4 vertices. Number 1, 2, 3 and 4, we're just going to number them. Now to do this, we have to pass what is called a list. If you group elements together, you call it a list. And just get used to it, everything in the Wolfram language that is a list go inside of curly braces. So 1, 2, 3, 4 close curly braces. So see there, inside curly braces, it's a list of elements and they're separated by commas. 1, 2, 3, 4 are the elements in this list of mine. Now that is going to be my nodes and next off this graph functions, expect you to pass it an argument which gives you the edges. So let's connect 1 to 2 and 2 to 3 and 3 to 4 and 4 back to 1. Let's do that. And the way we're going to do this is type 1. Then I'm going to hit the escape key and type UE, undirected edge. And later on you'll see what a directed edge is. But we're just going to do an undirected edge and I'm going to hit escape again. And it makes that beautiful little barbell sort of thingy. Anyway, and then 2. So there's an edge between node 1 and 2. Let's do 1 between 2. So it's escape, UE, escape. And 3, there's 1 between 3 and 4. And there's 1 between 4 and 1. Now I could have put it the other way. These are not directed. There's not a direction to this edge. It's between 1 and 2 or 2 and 1. It doesn't matter which way around or 1 and 4 and 4 and 1. It doesn't matter. So I'm going to close off every opening bracket or brace or quotation mark must have a closing one. So you see I've passed two arguments to this graph function. These arguments go inside of square brackets. All arguments are separated by commas. Both of the arguments are lists. The first one is a list of nodes. The second one is a list of edges. So then being lists, they go inside of curly braces. I'm going to hold down shift. I'm going to hit enter or return. And there we go. Aren't you proud of yourself? You've created your first graph. Four nodes and four edges. That's absolutely fantastic. Now this is the way the Wolfram language works. You'll see, or mathematical works at least, there's an in and an out. The in one, that's the first thing that we executed. The first line of code. And there's the output of our first line of code. This is called a cell. Look on the right-hand side. I can click on that. That's the whole thing. I click on that little one. That was my input. This was my output. And this is just coding cells. I can do all sorts of other types of cells. And you'll learn about them as we go. Let's just do one more. Let's just do graph again. I'm going to use my tab completion. I'm just going to copy and paste. All I'm going to pass is just the edges. So I'm going to say copy there, because I'm a bit lazy. Paste there and close. And we're going to get exactly the same thing. Mathematica is clever enough to understand that if those are the edges, we have to have nodes. An edge must always have two nodes, one on either side. An edge cannot just stop. Remember I said to you, it's not a thing. It's an abstract thing. It's a connection between two nodes. There's got to be a node on either side. Let's have a look at what happens if we just connect a node to itself. Let's do that. I'm going to say graph once again. And I'm going to connect one to itself. I'm going to connect one to itself. Let's connect also one to two. Let's connect two to three. And let's connect three back to one. Let's see what that looks like. Close my curly brace. Close my square bracket. And there you go. One is connected to itself. That's called a loop edge. That edge is a special kind of edge. It's called a loop. And we'll look at loops. Loops is something we're not going to use too often. We can clearly see there that that is a loop. What can we go on to next? We can have more than one edge connecting two. Let's have a look at graph. Let's have a look. I'm going to say I want one to go to two. And I want two also to go to one. So I could have just written that same thing twice, but let's make one to two and two to one. You see I have multiple edges in this instance, two edges between two vertices. So that is really, really important thing. So these loops and multiple edges. You've got to get used to those. Now let me show you something else that can happen, or that we can at least do in the Wolfram language. Let's do the following. I'm going to say graph. And let's put our edge list once again. I don't want all of them. Let's say so one to two. Let's say two to three. And let's say three all the way back to one. Close. Now I can pass another type of argument. And this one is called vertex labels. So if I say vertex, see it comes up there. So I'm just going to hit the down arrow to get to it and hit tab. And I want to scroll down and use the name tab again and close. Now you see that beautiful little arrow that was done there. If you had to do it by hand, it's just minus and greater than sign. It'll also give you that little arrow, change to a little arrow. But let me show you what happens here. We've got names to the nodes. One, two, and three. And Mathematica got that from the fact that I created these edges. So sometimes it's quite good just to have these vertex labels so that you know what you're talking about. So in short, that is your first video on how to, you know, what graph theory is. It's just this thing with edges and nodes. And I promise you it is something beautiful. It's not difficult to understand. Anyone can learn how to do it. And anyone can see the beauty of it if you use something like Mathematica. I really want to encourage that. It's really going to help your understanding of this very important, very nice subject in mathematics.