Computer Engineering is coming soon

We're still writing and reviewing the notes for every subject, and we'll open it when every subject is ready. Meanwhile you can practise aptitude, ask Aria about any subject, or see the branches that are ready.

Social network analysis: definition and development

Definition, core concepts and historical development of social network analysis (SNA), with precise definitions, basic theorems (e.g. handshaking lemma), formulas and exam-style worked answers for engineering students.

Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Social network analysis (SNA) helps an engineer model and analyse relationships between people, devices or software components as a graph. Engineers use SNA when designing recommendation systems, studying information spread in social media, analysing collaboration or communication networks, and for mining logs to build networks (see 'Networks from log files and log mining').

Key ideas

Start from a simple idea: a set of entities connected by relationships can be represented as a graph. We build SNA from graph theory plus concepts about social behaviour.

  • Social network (defined): a collection of actors (also called nodes or vertices) together with ties (also called edges or links) that represent relationships among actors. Use this term for any network where nodes represent people or social entities.

  • Actor / Node / Vertex (defined): an individual element in a network; label nodes with unique identifiers (1,2,... or names).

  • Tie / Edge / Link (defined): a relation between two nodes. A tie may be directed (has an origin and destination) or undirected (no direction). A tie may also be weighted (has a strength/weight) or binary (present or absent). Define these before use.

  • Graph representation (defined): represent a social network as G = (V, E) where V is the set of nodes and E is the set of edges. If edges have directions, use directed graph; if not, undirected.

  • Adjacency matrix (defined): for a graph with n nodes labelled 1..n, the adjacency matrix A is an n×n matrix with A[i,j] = 1 if there is an edge from i to j (or the weight if weighted), else 0. For undirected graphs A is symmetric.

  • Degree (defined): for an undirected node i, degree k_i = number of edges incident on i. For directed graphs define in-degree k_i^in = number of incoming edges, and out-degree k_i^out = number of outgoing edges.

  • Handshaking lemma (theorem, exact statement): In any finite undirected graph G = (V,E), the sum of degrees of all vertices equals twice the number of edges. Formally: sum_{v in V} k_v = 2|E|. Assumption: simple undirected graph with no self-loops or multi-edges; if self-loops are present, count each loop as contributing 2 to the degree so sum_{v in V} k_v = 2|E| still holds.

    Proof (step-by-step): each edge in an undirected graph touches exactly two endpoints; counting endpoints edge-by-edge yields 2|E|. Counting by vertices sums all incident edge counts = sum of degrees, so sum degrees = 2|E|.

  • Path (defined): a sequence of distinct nodes where consecutive nodes are connected by edges. A walk may repeat nodes. A geodesic (shortest path) between nodes u and v is a path with minimum number of edges.

  • Distance d(u,v) (defined): length (number of edges) of a shortest path (geodesic) between u and v. If no path exists, distance is infinite (or undefined).

  • Diameter (defined): the maximum finite distance among all pairs of nodes in the same connected component.

  • Connected component (defined): a maximal set of nodes where every pair has a path connecting them (for undirected graphs). For directed graphs use 'strongly connected' and 'weakly connected' components.

  • Density (defined): fraction of possible ties that are actually present. For an undirected simple graph with n nodes, maximum possible edges is n(n-1)/2. Density D = |E| / [n(n-1)/2]. For directed simple graphs maximum is n(n-1). Density ranges from 0 to 1.

  • Clustering coefficient (defined): measures tendency of neighbors of a node to be connected. Local clustering coefficient C_i for node i with degree k_i ≥ 2: C_i = (number of closed triplets / number of possible triplets) = (2 × number of edges among neighbors of i) / [k_i(k_i-1)]. Global clustering coefficient is average of local C_i or the ratio of closed triplets to all triplets, depending on definition; state which you use in an answer.

History and development (short timeline, precise claims):

  • Jacob L. Moreno introduced sociometry and early network diagrams (sociograms) in the 1930s (define sociogram: a graph drawing showing relations).
  • In social science, Granovetter introduced the concept of weak ties (1973) asserting that weak ties connect different groups and help spread information; state the hypothesis rather than absolute truth.
  • Linton C. Freeman (1979) formalised centrality measures (degree, closeness, betweenness) and clarified their interpretation in SNA.
  • Stanley Milgram's small-world experiment (1967) provided empirical evidence for short path lengths in social networks (the 'six degrees' idea as an approximate observation).
  • In networks theory, Watts and Strogatz (1998) formalised the small-world model, showing networks can have high clustering and small diameter; mention this model as development (reference to 'Random and small-world network models').

Diagrams to draw for exams:

  • To explain degree, draw a small undirected graph with 5 nodes labelled A,B,C,D,E and edges: A-B, A-C, B-C, C-D, D-E. Label each node and write its degree next to it. Draw adjacency matrix as a 5×5 table with rows and columns labelled A..E showing 1s and 0s.
  • To show clustering, highlight node C and the edges among C's neighbors; annotate k_C and number of neighbor-neighbor edges.

Note: I defined every bold term on first use. Where I reference other topics (e.g. 'Networks from log files and log mining', 'Random and small-world network models') I do not re-teach them.

Formulas

|E| = 1/2 * sum_{v in V} k_v — |E| is number of edges (count), k_v is degree of vertex v (count). Applies to undirected simple graphs; unit: count.

max_edges_undirected = n*(n-1)/2 — n is number of nodes, unit: count. Applies to simple undirected graphs (no loops, no multiple edges).

max_edges_directed = n*(n-1) — applies to simple directed graphs (no self-loops).

Density = |E| / (n*(n-1)/2) — for undirected simple graph. Unit: dimensionless (fraction). Applies when graph is simple and undirected. Density_directed = |E| / (n*(n-1)) — for directed simple graphs without self-loops. Unit: dimensionless (fraction).

k_i = sum_{j=1..n} A[i,j] — degree of node i in undirected/unweighted representation. A[i,j] elements of adjacency matrix. Unit: count.

k_i^in = sum_j A[j,i] ; k_i^out = sum_j A[i,j] — in/out degree for directed graphs. Unit: count.

C_i = (2 * t_i) / (k_i * (k_i - 1)) — local clustering coefficient for node i, where t_i is number of edges between neighbors of i, k_i is degree. Unit: dimensionless; applies if k_i ≥ 2.

d(u,v) = length of shortest path between u and v — distance; unit: number of edges.

Diameter = max_{u,v in component} d(u,v) — unit: edges.

State units: counts or dimensionless fractions; social network measures are unitless counts.

Worked examples

Example 1 — compute adjacency matrix, degrees, density and local clustering for a small undirected graph.

Question (model exam): Given an undirected simple graph with nodes {1,2,3,4,5} and edges E = {1-2, 1-3, 2-3, 3-4, 4-5}, compute the adjacency matrix, degree of each node, density, and clustering coefficient of node 3.

Answer (step-by-step):

  1. Adjacency matrix A (5×5) with rows/columns 1..5. Fill A[i,j]=1 if edge present, else 0. Since undirected, A symmetric. Write matrix rows: Row1: 0 1 1 0 0 Row2: 1 0 1 0 0 Row3: 1 1 0 1 0 Row4: 0 0 1 0 1 Row5: 0 0 0 1 0
  2. Degrees: k1 = 2, k2 = 2, k3 = 3, k4 = 2, k5 = 1. Check Handshaking lemma: sum degrees = 2+2+3+2+1 = 10 = 2|E| so |E| = 5 good.
  3. Density: n=5, max edges = 5*4/2 = 10. |E| = 5. Density = 5/10 = 0.5 (i.e. 50%).
  4. Clustering of node 3: neighbors of 3 are {1,2,4}. Number of edges among neighbors t_3: edge 1-2 exists, 1-4 no, 2-4 no => t_3 = 1. Apply formula: C_3 = (2 * t_3)/(k_3*(k_3-1)) = (21)/(32) = 2/6 = 1/3 ≈ 0.333. Final answers: adjacency matrix shown above; degrees [2,2,3,2,1]; density 0.5; C_3 = 1/3.

Example 2 — short essay model answer: define SNA and summarise historical development.

Question (model exam): Define Social Network Analysis and summarise its historical development and main milestones.

Answer (model): Social Network Analysis (SNA) is the study of social structures through graphs where actors (nodes) and their ties (edges) are analysed to reveal patterns of interaction, influence and information flow. Early formal work began with Jacob L. Moreno's sociometry and sociograms (1930s), which introduced diagrams of social relations. Milgram's small-world experiment (1967) gave empirical evidence that average shortest path lengths in social networks are small. Mark Granovetter (1973) introduced the weak ties hypothesis, highlighting the role of sparse ties for information diffusion between groups. In the late 20th century, network science formalised models: Erdos-Renyi random graphs provide a null model; Watts and Strogatz (1998) introduced the small-world model showing how networks can have both high clustering and low diameter; Barabási and Albert (1999) proposed preferential attachment explaining scale-free degree distributions. Modern SNA combines these models with data mining, log-based network construction and social media analysis (see related topics like 'Networks from log files and log mining' and 'Mining Twitter and Facebook').

Note: In an exam include dates and the qualitative contribution of each milestone, and mention assumptions (e.g. random graph assumes independent edge formation).

Common mistakes

  • Incorrectly counting self-loops (a self-loop contributes 2 to degree in many graph definitions) but many student answers forget or ignore loops; always state assumption.
  • Confusing clustering coefficient definitions (global vs average of local C_i). State which definition you use.
  • Violating handshaking lemma: usually from arithmetic error or wrong degree counts.
  • When drawing diagrams, forgetting to label nodes or edges; examiners expect labels.

For your exam

Types of questions you will see: precise definitions (define social network, node, tie, adjacency matrix), short notes (history and milestones), derivations/proofs (handshaking lemma, density formula), numericals (compute adjacency matrix, degrees, density, clustering), diagrams (draw network and label degrees), and essay-style summaries (development and applications). A full-marks answer:

  • Starts by defining terms clearly (bold or underlined terms conceptually),
  • States assumptions (directed/undirected, simple/multigraph, treatment of loops),
  • Shows derivation or stepwise computation with numbers and units (counts),
  • For history/definition questions, names key contributors and precisely state their contribution.

Quick check

  1. Define 'degree' for an undirected graph.
  2. What is the density of a simple undirected graph with n=6 and |E|=9?
  3. State the Handshaking lemma.

Answers: 1) Degree of a node is the number of edges incident on it. 2) max edges = 6*5/2 =15 so density = 9/15 = 0.6. 3) Sum of degrees over all vertices equals twice the number of edges: sum k_v = 2|E|.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?