![]() And so when you add the edge, if the nodes that you're adding, the pairs of nodes that you're adding are not in the graph already, NetworkX will automatically add them to the graph. Now notice that I haven't added the nodes themselves. And I could continue adding all the other edges. And then I would add the next edge, which would be the edge B, C. So for example here, I'm adding the edge A, B, which is this edge right here. And then what I can do is I can add edges. So here I'm making G an instance of one of those graphs. ![]() ![]() And then we're going to use the class Graph in order to represent this network that we see here. So the first thing we're going to do is import networkx as nx. So the first thing you need to know is how to create a network in NetworkX. And we're going to use NetworkX in Python in order to work with some of the networks that we look at. And we call these connections edges, or sometimes we call them links or ties as well. And then there are connections between them that can represent various different things. ![]() So we call these things nodes or vertices. So here's an example of a set of things which we call nodes, just circles that have labels A through G. So first of all, a network or a graph, which we also call a graph, is a representation of connections among different sets. And we're going to start talking a little bit about how we can use NetworkX in Python to build some of the different types of networks that we're going to be looking at. Today, we're going to get a little more details about the different network definitions and vocabulary we're going to use through the course. And how social networks show up in all kinds of places and can allow us to answer very cool questions about the complex phenomenon. Last time we talked about why we want to study social networks.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |