SNA
Analysis of Student Network Graph using Gephi and NetworkX
1. Introduction
A student network graph is analyzed using two different tools: Gephi (a graphical tool for
network visualization and analysis) and NetworkX (a Python library for graph analysis). This
report details the steps taken in both tools and compares the insights gained from each.
2. Graph Construction
Gephi Approach
1. Data Import:
○ Load the student network dataset (CSV/Edge List).
○ Nodes represent students, and edges represent relationships (same hostel,
branch, or subject).
2. Graph Visualization & Styling:
○ Nodes are colored based on hostel affiliation.
○ Edge labels show the type of relationship (branch, hostel, subject).
○ Applied ForceAtlas2 layout for better visualization.
3. Graph Metrics Computation:
○ Computed Degree, Betweenness Centrality, Closeness Centrality.
○ Detected communities using the Modularity algorithm.
Sample Data set Visualization using gephi
Above represents the network for the given dataset below as per the assignment
CSV files
NetworkX Approach
Graph Creation using Python:
import networkx as nx
import [Link] as plt
# Create a graph
G = [Link]()
# Sample student data (Node ID, Branch, Hostel, Subject)
students = [
(1, "IT", "A", "ML"),
(2, "IT-BI", "C", "AI"),
(3, "ECE", "C", "Signals"),
(4, "IT", "A", "ML"),
(5, "IT", "B", "AI"),
(6, "IT-BI", "C", "Robotics"),
(7, "ECE", "A", "ML"),
(8, "IT", "B", "Robotics"),
(9, "IT-BI", "C", "AI"),
(10, "ECE", "A", "AI"),
(11, "CSE", "B", "AI"),
(12, "CSE", "A", "Robotics"),
(13, "IT", "C", "ML"),
(14, "ECE", "B", "Signals"),
(15, "IT", "A", "Robotics"),
]
# Define hostel colors
hostel_colors = {"A": "lightcoral", "B": "lightblue", "C": "lightgreen"}
1. Computing Graph Properties:
○ Degree Distribution: Number of edges per node.
○ Centrality Measures: Betweenness, Closeness, Eigenvector.
○ Connected Components: Identifying clusters of students.
2. Community Detection:
○ Used Louvain Method to detect groups of closely connected students.
3. Graph Properties Analysis
Metric Gephi Result NetworkX Result
Average Degree Computed using sum(dict([Link]()).values())
Statistics Panel / len([Link]())
Clustering Found using Clustering nx.average_clustering(G)
Coefficient Coefficient Panel
Shortest Path Available in Path Length nx.shortest_path_length(G,
Panel source=1, target=2)
Betweenness Computed using Gephi nx.betweenness_centrality(G)
Centrality
Modularity Community detection [Link].louvain_communitie
performed s(G)
4. Visualization & Insights
1. Gephi's Strengths:
○ Provides interactive visualization.
○ Easy to detect clusters using color schemes.
○ Allows real-time filtering.
2. NetworkX's Strengths:
○ Better suited for large-scale analysis and algorithmic computations.
○ Easy integration with Python for statistical analysis.
○ Flexible for dynamic network changes.
3. Observations from the Graph:
○ Students sharing the same hostel tend to form strong clusters.
○ Highly connected students act as bridges between different hostels and
branches.
○ Community detection helped identify key social groups.
5. Conclusion
● Gephi is ideal for visualizing relationships and understanding student clusters.
● NetworkX is better for computational analysis and running algorithms.
● Combining both tools gives the best insights into student networking patterns.