So let's take a look at this little chunk of a Facebook social network graph here.
Got a bunch of users here and
they're connected to each other with friendship relationships.
And you can see some patterns in this graphs,
some things to note about this graph.
For example, one thing that you note is that not
everybody is friends with everybody else.
Of course, not everybody is friends with everybody in the world.
You have this group of friends, and moreover, within your group of friends not
all your group of friends are friends with each other either.
So for example, 25 is friends with 23, 18 and 65, but 65 and
18 are not friends with each other.
So that's a couple of things that you can notice.
And a question that we might want to ask is
what does a given user's group of friends look like?
How connected are they?
What are their relationships, how big is it?
And we might want to ask a bunch of questions about a particular user's group
of friends.
So we're going to define the concept of an Egonet.
An Egonet is just a subgraph of a larger social network graph
that's essentially centered on one particular user.
It includes all of their friends and then relationships between their friends.
So for example, let's take that node 25 again and look at the Egonet for 25.
So the Egonet for 25 is going to include the nodes 23, 65, and 18.
Because of the fact that 25 is directly connected to each of these users,
via a friendship relation.
But it's also going include this edge right here between 65 and
23, because 65 and 23 are also friends.
So that is the complete Egonet for 25.
And you can see it's a subgraph of the entire graph.
So we can get rid of all the other nodes and edges, and
we're left with just this Egonet.
Actually, before I go on to tell you what you're going to do in your assignment,
the method you're going to implement,
I'm going to have you practice this a little bit on your own.
So what I want you to do next, is I want you to extract the Egonet for user 50.