SNA Assignment 11
SNA Assignment 11
Assignment 1
Date of Submission: 06/01/2025
by
Ayush Tripathy
UCSE22011
Submitted To
CD (v) = deg(v)
Steps to Calculate:
1. For each node in the graph, count the number of direct neighbors.
Steps to Calculate:
1. Compute the shortest path from the node to all other nodes using a
pathfinding algorithm (e.g., Dijkstra).
Steps to Calculate:
1
1. For each pair of nodes, calculate all shortest paths.
d. Eigenvector Centrality
Eigenvector centrality assigns relative scores to all nodes based on the prin-
ciple that connections to high-scoring nodes contribute more.
Ax = λx
Steps to Calculate:
e. PageRank Centrality
PageRank centrality evaluates the importance of nodes using the following
formula:
Cp = β(I − αA⊤ D)−1 · 1
Steps to Calculate:
2
1. Count all triangles in the graph.
2 Results
2.1 Comparison of Centrality Measures
The centrality measures were computed for two graphs:
3
Figure 1: Centrality measures for the graph with 1000 nodes.
FORD-FULKERSON(G, s, t)
for each edge (u, v) E[G]
do f[u, v] ← 0
f[v, u] ← 0
while there exists a path p from s to t in the residual network G_f
do c_f(p) ← min{c_f(u, v): (u, v) is in p}
for each edge (u, v) in p
do f[u, v] ← f[u, v] + c_f(p)
Steps to Calculate:
1. Initialize all edge flows to zero.
4
2. Find an augmenting path in the residual network.
Figures 3 and 4 show the graph and the resulting flow network.
5
Figure 4: Flow network after applying Ford-Fulkerson.