Lesson 1
Lesson 1
Social Networks
2022/2023, Semester A
Slava Novgorodov 1
Lesson #1
• Administrative questions
• Course overview
• Introduction to Social Networks
• Basic definitions
• Network properties
2
Administrative questions
• Course format:
– Lecture (2h) + Recitation (1h) every week (by Slava)
– 3 Homework tasks during the semester
• Submission in pairs
• Theoretical + Practical (Python) questions
– Final exam (format will be discussed later)
– Final grade = 85% Exam + 15% HW
5
Social Networks
6
Social Networks
Social actors
7
Social Networks
9
Social Networks
• The research around Social Networks started
at the beginning of 1930s (first sociograms)
13
Three aspects
• Theory
– Network formation, dynamics…
– Influence detection
– Communities
• Experimental studies
– Observe patterns
– Test theories
• Methodology
– How to analyze networks?
14
Applications in Social Networks
15
6 degrees of separation
16
6 degrees of separation
The Small World experiment:
Model the population as a social network and attempt to find the
average path length between any two nodes.
1. Select individuals in two far (socially and geographically) points
– Omaha, Nebraska and Boston, Massachusetts
2. The individual in Omaha received a letter he/she needs to pass
to an individual in Boston. If they know each other, great.
Otherwise, the letter should be sent to a friend who may know
the destination individual.
Results: 64 letters reached the target within 5.5 hops on average
Facebook case: Around 4 degrees of separation (https://arxiv.org/abs/1111.4570)
17
Community detection
18
Community detection
19
Influence Maximization
20
Link prediction
• “Suggested friends” feature
21
Product adoption
22
Product adoption
26
Summary
In this course we are going to focus on:
• Practical study of the data to find principles
• Mathematical models of the networks
– Small-world model, structural balance,
• Algorithms (analyzing the network)
– Communities detection, link prediction, influence
maximization…
• Applications
27
Structure of the Network
28
Components of the Network
•.
30
Directed/Undirected Graphs
Undirected graph:
• Undirected, symmetrical edges
• Examples:
• Friends (on Facebook)
• Classmates
Directed graph:
• Directed edges
• Examples:
• Followers (Instagram)
• Phone calls
31
Node degree (Undirected)
Node degree (ki) – number of
edges adjacent to the node i
Example:
k5= 2, k3= 3
Average degree:
<k> = 1/|V| * (k1 + … + k|V|) = 2|E|/|V|
32
Node degree (Directed)
In-degree (kiin) – number of
edges that goes to the node
Out-degree (kiout) – number of
edges that goes from the node
Total degree is a sum of in and out degrees.
Example:
k5in= 2, k5out= 0, k5= 2+0=2 k1in= 0, k1out= 1, k1= 1
35
Representing networks:
Edge list
• (1, 2)
• (2, 3)
• (2, 4)
• (2, 5)
• (4, 5)
• (4, 6)
• (6, 3)
36
Representing networks:
Adjacency list
Easier for large and sparse graphs
• 1: 2
• 2: 3, 4, 5
• 3:
• 4: 5, 6
• 5:
• 6: 3
37
Social Networks are sparse
Most of the real world social networks are sparse
38
Edge attributes
• Weight (# messages, frequency of interaction)
• Ranking (most favorite actor, second favorite..)
• Type (friend, colleague, coauthor)
• Sign (positive/negative relationships)
• Properties depending on the other graph
(number of common friends)
39
Connectivity of Undirected graphs
• Connected graph - any two nodes can be joined by a
path (sequence of edges)
• Disconnected graph made out of 2 or more connected
components
40
Connectivity of Directed graphs
• Strongly connected directed graph – has a
node from each node to each other node and
vice-versa
41
Quiz
For each of the examples, answer if the graph is
directed/undirected and if edges are weighted or not
• Classmates –
• Facebook friends –
• Mobile phone calls –
• Twitter followers –
• Likes of Facebook –
42
Quiz
For each of the examples, answer if the graph is
directed/undirected and if edges are weighted or not
43
Network Properties
44
Key Network Properties
45
Degree distribution
• P(k) – probability that a randomly chosen
node has a degree k
46
Path length
• Path - sequence of edges which connect a
sequence of vertices which are all distinct
47
Clustering coefficient
• Clustering coefficient of a node – fraction of
the neighbors that are connected
• Node i, with degree ki
• Ci = 2 * (# of edges between the neighbors)/ ki *(ki – 1)
• Intuitively: # of closed triangles / # of all triangles
B B B B
A C A C A C A C
D D D D
CA = 0 CA = 1/3 CA = 2/3 CA = 48
1
Clustering coefficient
• Clustering coefficient of a node – fraction of
the neighbors that are connected
49
Thank you!
Questions?
50