0% found this document useful (0 votes)
22 views

C2 - Social Network Measurement

Uploaded by

hzqjm8grg8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

C2 - Social Network Measurement

Uploaded by

hzqjm8grg8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

SOCIAL NETWORK

MEASUREMENT

Minh Tran, PhD

September, 2024
Content

01 GRAPH REPRESENTATION

02 CONCEPTS AND METRICS

03 SIGNED GRAPH
Undirected graph

Representation of Social Networks using a (a) Graph or (b) Adjacency matrix

For each edge (u, v) in the graph, if the graph is undirected mark a[u][v] and
a[v][u] as 1, and if the edge is directed from u to v, mark a[u][v] as the 1. (Cells
are filled with edge weight if the graph is weighted)
Directed graph

Unweighted graph Weighted graph

● In case of unweighted graphs, the values are 0 or 1


● In case of weighted graphs, the values are weights of the edges if edges are
present, else 0
Question

Write down the adjacency matrix for the given undirected weighted graph
Graph representation Adjacency matrix
Ego networks and whole' networks

* no studied network is 'whole' in practice; it's usually a partial picture of one's real
life networks (boundary specification problem)
** ego not needed for analysis as all alters are by definition connected to ego
Content

01 GRAPH REPRESENTATION

02 CONCEPTS AND METRICS

03 SIGNED GRAPH
Node / Actor / Entity

● “discrete individual, corporate, or collective social units” (Wasserman/Faust


2008:17)

● Examples: people in a group, departments within in a corporation, public


service agency in a city, nation-states in the world system

● Does not imply that they have volition or the ability to “act”

● The order of a graph is the number of nodes (denoted as n) in the graph


Edge / Tie / Link

● A connection between two vertices (nodes) in a graph. In social networks, this


represents a relationship or interaction between two individuals.

● Example: friendships, follows, or connections


○ Directed (Flickr), undirected (Facebook)

● Strong & Weak ties

● The size of the graph refers to the number of edges (denoted as m) in the
graph.
Path length

● Path length: the distance between two nodes, measured as the number of edges
between them

● Average (shortest) path length: is defined as the average number of steps along
the shortest paths for all possible pairs of network nodes.
○ a measure of the efficiency of information or mass transport on a network

● Examples
○ The average number of clicks which will lead you from one website to
another
○ The number of people you will have to communicate through, on an
average, to contact a complete stranger.
Path example

● AD has a path length of 1

● The walk ABCAD is not a path (passes


through A twice!)

● ABCD has a path length of 3

● A and D are connected by 3 paths


○ AD, ? , ?
○ The distance between A and D is equal to
the shortest path
Path example (cont.)

● Directed graphs are similar except for the


possible asymmetry of the relationship

● Degree has two separate components:


○ In-degree: total numbers of alters related to
ego; A=1, B=2, C=1
○ Out-degree: total numbers of points ego
relates to; A=1 , B=1 , C=2

● Paths: CAB is a path, CBA is not a path!


Average path length

Discuss: What is the term ?


Shortest path
Dijkstra's Algorithm

1. Set initial distances for all vertices: 0 for the source vertex, and infinity for all the
other.
2. Choose the unvisited vertex with the shortest distance from the start to be the
current vertex. So the algorithm will always start with the source as the current
vertex.
3. For each of the current vertex's unvisited neighbor vertices, calculate the distance
from the source and update the distance if the new, calculated, distance is lower.
4. We are now done with the current vertex, so we mark it as visited. A visited
vertex is not checked again.
5. Go back to step 2 to choose a new current vertex, and keep repeating these steps
until all vertices are visited.
6. In the end we are left with the shortest path from the source vertex to every
other vertex in the graph.
Centrality in social network

Degree Betweenness

Closeness Eigenvector
Degree

● The number of edges a node has

● The importance of a node is determined by the number of nodes adjacent to it


○ The larger the degree, the more import the node is
○ Only a small number of nodes have high degrees in many real-life networks
Question

● What is the size of the graph?

● What is the In-Degree & Out-Degree


of Node 5 ?

● What is the In-Degree & Out-Degree


of Node 3 with weight ?
Degree centrality

● Degree centrality assigns an importance


score based simply on the number of links
held by each node.

● Showing how many direct, ‘one hop’


connections each node has to other nodes
in the network.

● For finding very connected individuals,


popular individuals, individuals who are likely
Source: to hold most information or individuals who
https://www.fmsasg.com/SocialNetworkAnalysis/ can quickly connect with the wider
network.
Closeness

● The average of the shortest path length from the node to every other node in the network

● “Central” nodes are important, as they can reach the whole network more quickly than
non-central nodes

● Importance measured by how close a node is to other nodes


Question

Code: C2_Q3.ipynb
Compute CC(3) and CC(4). Comment on results.
Harmonic centrality

● What happens when we have disconnected components?

● Key Idea
○ Sum of reciprocal distances instead of reciprocal of sum of distances!
○ SUM (1/dist(u,v))
■ In the limit – 1/inf 0.
Closeness centrality

● Closeness centrality scores each node based


on their ‘closeness’ to all other nodes in the
network.

● Calculating the shortest paths between all


nodes, then assigns each node a score based
on its sum of shortest paths.

● For finding the individuals who are best


placed to influence the entire network most
Source: quickly.
https://www.fmsasg.com/SocialNetworkAnalysis/
Betweenness

● Node betweenness counts the number of shortest paths that pass one node

● Nodes with high betweenness are important in communication and information


diffusion
Question

Code: C2_Q3.ipynb
Compute CB(4) and CB(5). Normalizing the results.
Betweenness centrality

● Betweenness centrality measures the


number of times a node lies on the shortest
path between other nodes.

● Showing which nodes are ‘bridges’ between


nodes in a network. It does this by
identifying all the shortest paths and then
counting how many times each node falls on
one.

Source: ● For finding the individuals who influence the


https://www.fmsasg.com/SocialNetworkAnalysis/ flow around a system.
Eigenvector

● One’s importance is determined by his friends’

● If one has many important friends, he should be important as well

● The centrality corresponds to the top eigenvector of the adjacency matrix A

● A variant of this eigenvector centrality is the PageRank score


Eigenvector centrality

● Eigenvector centrality measures a node’s


influence based on the number of links it has
to other nodes in the network.

● Calculating the extended connections of a


node to identify nodes with influence over
the whole network, not just those directly
connected to it.
eigenvector
● Handy for understanding human social
Source: networks, but also for understanding
https://www.fmsasg.com/SocialNetworkAnalysis/ networks like malware propagation.
Interpretation of measures
Interpretation of measures
Reciprocity (degree of)
Density

● Graph density describes the general level of connectedness in a graph


● Graph is complete if all points are adjacent to each other
● The more points that are connected, the greater the density

● There are two components for density


○ Inclusiveness: number of points that are included in the graph because they are
connected
○ Total degree: sum of degree of all the points
Density example
Question

Compute the density of this graph


Clustering centrality

● Clustering centrality is a measure of the extent to which nodes in a network


tend to cluster together.

● Clustering Coefficient
○ Measures how connected the neighbors of a node are to each other.
○ A higher clustering coefficient indicates that a node's neighbors are more
interconnected.

● Global vs. Local Clustering


○ Local Clustering: Focuses on individual nodes and their immediate neighbors.
○ Global Clustering: Averages the local clustering coefficients across the entire
network.
Local clustering coefficient
Global clustering coefficient
Key players

● Key players are the most influential or central nodes within a network. These
individuals or entities play critical roles in the flow of information, connectivity,
and overall network dynamics.

● Central Nodes
○ Degree, Betweenness, Closeness, Eigenvector

● Peripheral Nodes

● Influencers
Practical application with Python

Problem:The Quest for the Influencer

In a bustling city, a startup named NetWorks specialized in


social media marketing. They were on a mission to launch an
eco-friendly product and make it go viral. However, they
faced a challenge: finding the right influencers, or “key
players”, who could spread the word effectively.

With millions of social media users, identifying these key


players felt impossible. One day, the team leader, Sarah,
turned to her data scientists and said, “We need to find
those influencers who can make our product the talk of the
town. But how?”

And thus, the quest to identify the key players began.

● Code: C2_Q4.ipynb
Content

01 GRAPH REPRESENTATION

02 CONCEPTS AND METRICS

03 SIGNED GRAPH
What is a signed graph?

Founded: 2009 by Jan Koum and Brian Acton.


Acquired by Facebook (Meta): 2014.
User Base: Over 2 billion monthly active users (as of 2024).

● Impact on Social Networking


○ Global communication, privacy and security
○ Community interaction, influence in developing regions

● Challenges and Considerations


○ Misinformation spread
○ Security concerns, regulatory scrutiny
Questions

1. Difference between social network and social media


2. Comparing Facebook,YouTube, and WhatsApp in social network
3. How to collect data?
4. List applications in business and advertising

You might also like