C2 - Social Network Measurement
C2 - Social Network Measurement
MEASUREMENT
September, 2024
Content
01 GRAPH REPRESENTATION
03 SIGNED GRAPH
Undirected graph
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
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
03 SIGNED GRAPH
Node / Actor / Entity
● Does not imply that they have volition or the ability to “act”
● 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
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 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
Code: C2_Q3.ipynb
Compute CC(3) and CC(4). Comment on results.
Harmonic centrality
● 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
● Node betweenness counts the number of shortest paths that pass one node
Code: C2_Q3.ipynb
Compute CB(4) and CB(5). Normalizing the results.
Betweenness centrality
● 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.
● 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
● Code: C2_Q4.ipynb
Content
01 GRAPH REPRESENTATION
03 SIGNED GRAPH
What is a signed graph?