SMA Exp 6
SMA Exp 6
&
DATA SCIENCE
Experiment No. 6
Aim: Develop Structure based social media analytics model for any business. (e.g. Structure Based Models -
community detection, influence analysis)
Theory:
Centrality is a key concept in graph theory that refers to measures of the relative importance or "centrality" of a
node in a graph. Nodes that are more "central" in a network are typically more influential or have more
connections to other important nodes.
Types of Centrality:
1. Degree Centrality: Measures the number of direct connections a node has. Nodes with high degree
centrality are well-connected.
2. Betweenness Centrality: Measures how often a node lies on the shortest path between other nodes,
indicating its role as a bridge in the network.
3. Closeness Centrality: Measures how quickly a node can access all other nodes in the network,
indicating its ability to reach others with fewer steps.
4. Eigenvector Centrality: Measures the influence of a node based on the number and quality
(importance) of its neighbors.
The NetworkX library in Python is designed for the creation, manipulation, and study of the structure,
dynamics, and functions of complex networks. It provides tools for the analysis of graphs and networks, which
can represent a wide range of real-world systems, from social networks to transportation systems, biological
networks, and more.
● Graph: A graph is a collection of nodes (also called vertices) connected by edges (also called links).
import networkx as nx
import matplotlib.pyplot as plt
# Define nodes
nodes = ['x', 'a', 'b', 'c', 'd', 'e']
# Create graph
G = nx.Graph()
G.add_nodes_from(nodes)
Conclusion: Thus, we developed Structure based social media analytics model for business.
R1 R2 R3
DOP DOS Conduction File Record Viva -Voce Total Signature
5 Marks 5 Marks 5 Marks 15 Marks