Social Network Analysis

Guide to AI and Data Courses · Part IV: Data
Networks and graphsCentralityCommunity detectionNetwork modelsDiffusionNeighboring courses
Sercan KÜLCÜ · Giresun University · Computer Engineering

Introduction

What Question Does It Ask?

How are networks of people and their relationships analyzed?

Social network analysis studies the graph formed by treating people as nodes and relationships as edges. The question is not the traits of individuals but the structure of their ties: who is central, which groups exist, and how a rumor or a disease spreads through the network.

At a glance

Approach

graph theory and statistics

Input

nodes and links

Output

centrality, communities, diffusion

Success measure

modularity, interpretability

Math load

medium: graphs, matrices

Data needs

network data

Introduction

A Short History

1736

Euler solves the Königsberg bridges problem; graph theory is born.

1934

Moreno draws relationships in diagrams he calls sociograms.

1967

Milgram's letter experiment popularizes the idea of "six degrees".

1973

Granovetter shows "the strength of weak ties": job leads come from distant acquaintances.

1998

Watts and Strogatz publish the small-world network model.

2008

The Louvain method makes fast community detection possible on networks with millions of nodes.

The Course

Core Concepts

Nodes and edges

Directed or undirected, weighted or unweighted.

Degree distribution

A few highly connected nodes, many with few links.

Centrality

Degree, betweenness, closeness and eigenvector measures.

Clustering coefficient

How many of my friends know each other.

Small world

High clustering but short average paths.

Community

Nodes densely linked inside, sparsely to the outside.

Modularity

How good a partition into communities is.

Diffusion models

Spread of information or disease on a network (SIR).

The Course

A Typical Workflow

Buildnetworkwho with whom,what tieDescribedegree,path lengthCentralityimportantnodesFindcommunitiesLouvain,modularityInterpretvisualization,testing
Example: A researcher builds a network from a school's friendship survey, looks at the degree distribution, finds "bridge" students with high betweenness, extracts friend groups that cross classes with Louvain, and discusses the drawn result with the teachers.

The Course

What Does the Course Cover?

  1. Graph basics: nodes, edges, adjacency matrix
  2. Collecting network data: surveys, traces, ego nets
  3. Degree distribution, path length and diameter
  4. Centrality: degree, betweenness, closeness
  5. Eigenvector centrality and PageRank
  6. Clustering, triadic closure and weak ties
  7. Homophily and assortativity
  8. Random graphs and the small-world model
  9. Scale-free networks and preferential attachment
  10. Community detection: modularity and Louvain
  11. Spreading: the SIR model and information cascades
  12. Link prediction and network visualization

Skills you will gain

network analysis with NetworkXnetwork visualization with Gephiinterpreting centrality measuresfinding and testing communitieswriting a spreading simulation

A typical semester; the order and coverage vary between universities.

Try It

Who Should Start the Campaign?

A club will hand its announcement to one person in the friendship network of its 18 members. Click a person to see their centrality, find the communities, then watch the news spread from that person step by step.

Size:
By degree, people with many friends such as Mert stand out, but the bridge between groups is Deniz (betweenness). Starting the news at a bridge carries it into several communities; this is how influencers are chosen.

Context

Prerequisites

Courses worth knowing before this one, and why they are needed.

CourseWhy it is needed
Linear Algebraadjacency matrix, spectral methods
Data Structuresadjacency lists and matrices: storing a graph in memory
AlgorithmsBFS, DFS and shortest paths: the basis of centrality computations
Discrete Mathematicsgraph theory, sets and counting

Context

Are You Ready for This Course?

Ask yourself; for every "no", the right-hand column shows where to start.

Ask yourselfIf not, start with
Can you find the shortest path between two nodes of a graph with BFS?Graph search from an algorithms course
Can you explain what an eigenvector of a matrix means?Linear Algebra
Can you compute the mean and variance of a distribution?Probability and Statistics
Can you read an edge-list file into a Python dictionary?An intro programming course, then a short NetworkX tutorial
If you can say "yes" to most of these, you are ready; one or two gaps can be closed during the semester.

Context

Neighbouring Courses

subfieldbuilds onshares methodsapplication

Overlap

Overlapping Courses

RelationCourseShared ground
builds onThis course builds on Linear Algebraadjacency matrix, spectral methods
shares methodsShares methods with Data Miningcommunity detection
shares methodsShares methods with Information Retrieval and Recommender SystemsPageRank, link analysis

Differences

Where It Differs (1/2)

CriterionSocial Network AnalysisData MiningIR & Recommenders
Core questionHow are networks of people and their relationships analyzed?How are hidden, useful patterns found in large piles of data?How are the most relevant documents or products picked from millions of candidates?
Approachgraph theory and statisticsdiscovery-driven analysismatching and ranking
Inputnodes and linkslarge tables or transaction dataquery, documents, user history
Outputcentrality, communities, diffusionrules, clusters, outliersranked result list
Success measuremodularity, interpretabilityinterestingness, support, confidenceprecision, recall, NDCG
Math loadmedium: graphs, matricesmediummedium: vector spaces
Data needsnetwork datalargelots of interaction data
  • Data Mining: Data mining looks for patterns in tabular records; this course studies the structure of the links between records.
  • IR & Recommenders: Information retrieval uses PageRank as a ranking signal; this course asks what centrality says about the network.

Differences

Where It Differs (2/2)

CriterionSocial Network AnalysisLinear AlgebraMulti-Agent Systems
Core questionHow are networks of people and their relationships analyzed?How do vectors and matrices represent data and transformations?How do several autonomous agents decide together or against each other?
Approachgraph theory and statisticsvector spaces and transformationsinteracting autonomous agents
Inputnodes and linksvectors, matricesagents, goals, protocols
Outputcentrality, communities, diffusionsolution, decomposition, transformationjoint behavior, equilibrium
Success measuremodularity, interpretabilityaccuracy, numerical stabilitysocial welfare, stability
Math loadmedium: graphs, matricesthe theory itselfmedium: game theory
Data needsnetwork datanonelittle; simulation
  • Linear Algebra: Linear algebra computes the eigenvalues of the adjacency matrix; this course reads them as communities and importance.
  • Multi-Agent Systems: Multi-agent systems model how agents make decisions; this course analyzes the observed network of ties.

Practice

Applications

Social media

Influencers and echo chambers.

Epidemiology

Disease spread on contact networks.

Fraud

Rings of linked fake accounts.

Science networks

Citation and co-authorship analysis.

Workplace networks

How knowledge flows in a company.

Friend suggestions

Link prediction from mutual friends.

Practice

Risks and Ethics

Inferring what was never shared

A friendship network can reveal political views or sexual orientation that a person never disclosed.

Removing names is not enough

Even with names removed, the pattern of links can identify a person, as structural re-identification attacks showed.

Consent and scraping

In the Cambridge Analytica case, a personality quiz app also collected data on its users' friends without their consent.

Missing ties, wrong answers

Ties forgotten in a survey or invisible on a platform can badly distort centrality rankings and communities.

In depth: Explainable AI and AI Ethics.

Practice

Tools and Datasets

Tools and libraries

NetworkXigraphGephigraph-toolNeo4jPyTorch Geometric

Well-known datasets

Zachary's karate clubLes Misérables character networkEnron e-mailsSNAP network collectionDBLP co-authorship networkFacebook ego networks (SNAP)

Practice

Common Misconceptions

Common beliefIn fact
The person with the most friends is the most influential.Degree is one measure; a bridge joining two groups (betweenness) can matter more.
Looking at a network drawing is enough to understand it.Large networks draw as a "hairball"; numerical measures and tests are needed.
Community detection has one right answer.Different methods give different partitions; results are read with domain knowledge.
Connected people have influenced each other.Similar people choose each other anyway (homophily); influence is hard to separate from selection.

Next Steps

After This Course

Courses that build on or extend this one

This course is mostly an end point: it builds on the others.

Related careers

Network scientistData scientistSocial media analystFraud analystComputational social scientist
After this course you can move on to learning on networks with graph neural networks, link-based ranking with information retrieval, and diffusion models with epidemiology. Computational social science is an interdisciplinary field that applies these methods to questions about society.

Next Steps

Further Reading

  • Wasserman and Faust, Social Network Analysis: Methods and Applications, Cambridge University Press, 1994.
  • Easley and Kleinberg, Networks, Crowds, and Markets, Cambridge University Press, 2010.
  • Newman, Networks, 2nd ed., Oxford University Press, 2018.
  • Barabási, Network Science, Cambridge University Press, 2016.

The End

Chapter 30: Social Network Analysis
← Previous chapter · Map of the field · Next chapter →
1 / 1 Sercan KÜLCÜ. All rights reserved.