Now before we start using Gephi, let me tell you about the software tools that we will and won't be using. In this class, we'll be using Gephi for visualization and for calculating simple network metrics. We'll be using NetLogo to understand the dynamics that shape network formation and also to understand processes occurring on networks. And finally for those of you doing programming assignments we'll be using iGraph for more sophisticated, more flexible calculations. There are actually a lot of alternatives, and let me tell you about some of them, because once you know what capabilities you like, you can readily find them in other software that may be more well-suited to your projects. So there's the software package called Pajek which means spider in Slovenian. It has been developed for a number of years, it's a very mature software package. It has very extensive functionality which you access through drop down menus. And the reason why we're not using it even though I have used it when teaching this type of class in the past is because it only works on the Windows platform and some students have had trouble using Windows emulators on other systems. So I just made the choice to switch over to platform-independent software. However Pajek might be a very good choice. In addition, there is a book, a textbook, called Social Network and, Exploratory Social Network Analysis with Pajek, which guides you through many analyses that you can do with that software. We also will not be using UCINet, which again is fairly mature, or very mature. It has extensive functionality, mostly focused around sociology so, I think until recently UCI Net did not really scale up to large networks. Unfortunately it's, it's also Windows only, and the license may cost you a couple hundred dollars if you're not a, a, a full time student, or somehow affiliated with the university. We also will be using NodeXL, NodeXL is a relative newcomer. Its social network analysis neatly integrated into Excel. It's still, I think, very much in beta, it's being developed. However, it's free. And if you're, are already an Excel user, then this may be a very friendly way to do social network analysis. Again, it's, it's actually Windows only, only, the, Windows version of Excel supports NodeXL, and that's why we're not using it. If you're a programmer, there's an excellent alternative called NetworkX. It has extensive functionality and it's actually built upon, Fortran and C libraries, which are optimized to scale for very, very large matrices. And so you can do calculations for very large networks. It's, on top of that it's open source, so that's definitely something to consider if you have this background. There are many, many other alternatives, most of them are in various phases of development one very mature package is the social network analysis package for R, it, it has a kind of statistics heavy duty functionality for example, p-star models which we won't even get into in, in this course, are supported in this social network analysis package. In addition, if you are interested some, p-star models are used to model networks as they evolve to time. Just a hypothesis about, what's driving edge formation. And if you're interested in visualizing networks over time with kind of an integrated P star model functionality, there's the package SoNIA, that, that you can use for this purpose. Now let's get to our main task for this lecture, which is to work with Gephi. So what I'd like you to do is to download Gephi. It's free, it should work on any platform, and install it. Once you've installed it, download the data file dining.gephi from the Coursera folder for this lecture, and we can start to play. Now that you downloaded Gephi and installed it, we can start to play with this dining.gephi data file. Now I've opened it recently so it's shown in this helpful welcome screen but perhaps you don't have that so you can go to File, Open, and navigate to the directory where you've saved it and then just double click to open it. And here we're waiting for it to load and pretty soon it's going to tell us, for example, the number of nodes and edges. It's going to tell us there are 26 nodes and 52 edges. What kind of data is this? Well, this was data gathered in a girls' dormitory back into the 1940s, where the girls were asked to name their first and second choices for who they would like to sit with at dinner. So, this is the dining table partners' data set. You, you can see a random layout here, and I've done this on purpose to demonstrate how even with such a small network as this one, a random layout can really obscure whatever insights you're trying to see. Now, Gephi helps a little bit. Here we can tell for example, that this girl is relatively popular because lots of other girls have named her as their first or second choice. Now, if we want to know which girl exactly this is, what we do is we select this little arrow. Plus question mark. It's actually an, brings up an edit window over here, and now when we left-click on this node, we find out that this girl's name is Eva, in addition to some other properties. We also may want to know the overall structure so we can select a layout. And here I went to the layout panel, and I'm going to choose a layout. Force Atlas two is one of my favorites, but Yen Phen Hu is also very fine. It turns out it doesn't matter too much when the network is this small. It's more with large networks that you run into utilization difficulties. So, let's try Force Atlas two. And I'm going to click on run. There're all of these different parameters which you can tweak and, and play with that have to do with how the model's running. Essentially, all of these different layout algorithms want to place nodes that are linked close together and ones that are not. It wants them to repel from each other. So we're going to say run. And it ran, it's doing a little bit of spinning. Let's see if it'll actually spin into a good position. Oh, indeed, very nice. Okay. Let's stop it right there. And you may notice that now some nodes are out of use, so you can click this little magnifying glass that will center it on the graph but it may end up looking a little bit too small. So I'm going to use the track pad or you can use your mouse wheel to just zoom in. And then I'm going to right click and drag and zoom in some more. And this I think shows off the layout of the girls' preferences a little bit more clearly. You may want to tweak things just a little bit. I'm going to select the hand to drag the node just here. It wasn't quite clear who was, who was picking whom, so maybe I just move it a little bit, right, so a, a little bit of minor adjustment is no big deal. If you're moving things around because you want them to look a certain way to prove some point, then I wouldn't, I wouldn't do this. But just for us and wanting to see who exactly has picked whom, I think it's perfectly fine. Okay. Some other things that you can do is you can change the color for all the nodes. So, if we want them all to be red, and then we, and so I right-click to choose the color, and then I left-click to set them all to red. I may want to, yes okay, these were a little overlapped. So we just want to avoid overlaps where we don't know where there's an edge. Is incident on the node, or the node is over the edge and it's actually obscuring it. We can also adjust the size if they seem a little bit big. I'm going to right click on the size. Well actually, 1.0, that's already quite, quite fine. I guess you could try a fraction of the size. I'm going to left-click and now they're tiny, so let's go back to 1.0. Inset that. Oops, alright. Let's see. Five? Apparently it wasn't five before. Okay. There we go. So they're a size five. We may find this more informative if instead of having to click on this edit attribute where we then click on individual nodes and find out, hey, this girl is Hazel. And this one is Maxine, this is where I'm seeing all this info after I've selected the Edit tool. Perhaps if we just show the labels for all the nodes, so I'm just gonna click on this T down here that says show node labels. And they are way too big so we're just going to have to try and scale then down a little bit. There we go. And, we can go back to the layout and say label adjust. Try to move these around so that the labels don't overlap as much, and it's actually done it. I don't know if you could see it, it popped up very quickly. And now, all the labels are fairly visible. Another thing that we may want to do is to color the edges differently depending on whether this is a girl's first or second choice. So I'm going to go to the partition tab, click on it. I'm going to click on edges and I'm going to click this little reload. Load the different partitions or actually characteristics of the edges that are discreet categories and I'm going to click on label. And this has whether it was first choice or second choice, so I am going to click apply. And now we see all of the second choices in blue and the first choices in red. And I will start here because we need to explain some additional concepts before we can use Gephi, oh, but actually, let me show you. So, we're we are right now in, in overview mode where we have all these different tools that we can use. We can also click on data laboratory, And in data laboratory, we have a spreadsheet of all of the node information, and if we click on edges, we have all of the edge information as well. And finally in Preview we can preview the visualization that then we can export. So I'm going to click Refresh now to see it. I can, I should probably see the node labels so I'm going to click that and hit refresh. And then, I'm going to unclick curve so that we get the arrows for the directionality of the edge and perhaps I can also well change the background, in this case maybe I want a blue background or something like that. No, not a blue background. Let's go back to white. And then if I wanted to export this I would click this button down here and I could choose whether to export it as a pdf or a png or an sv2 file. I'm not going to do that right now because we have some more work to do. So I'm going to go back to overview and stop here while we learn a few more concepts and then we'll be back.