0% found this document useful (0 votes)
11 views

Practical File Iqman Ns

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Practical File Iqman Ns

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 67

Practical File

On

NETWORK SCIENCE : STRUCTURAL ANALYSIS AND


VISUALIZATION ( CS 801)
File Submitted in Partial Fulfilment of
the Requirements for the Award of

Bachelor in Engineering
IN COMPUTER SCIENCE AND ENGINEERING

Submitted by

Iqman Singh Bhatia


(Roll no:CO20323)

Under the supervision of (Prof. Gulshan Goyal)

CHANDIGARH COLLEGE OF ENGINEERING AND TECHNOLOGY


(DEGREE WING)
Government Institute under Chandigarh (UT) Administration, Affiliated to Panjab University,
Chandigarh

Sector-26, Chandigarh. PIN-160019


CHANDIGARH COLLEGE OF ENGINEERING AND TECHNOLOGY (DEGREE WING)
Government Institute under Chandigarh (UT) Administration | Affiliated to Panjab University , Chandigarh
Sector-26, Chandigarh. PIN-160019 | Tel. No. 0172-2750947, 2750943
Website: www.ccet.ac.in | Email: [email protected] | Fax. No. :0172-2750872

Department of Computer Sc. & Engineering

ACKNOWLEDGEMENT

I would like to express a special thanks of gratitude to my mentor, Dr. Gulshan Goyal for your
guidance and support throughout my semester. I made this practical file from my heart with
utmost sincerity. I am very thankful to all those who helped me and guided me through the
project. I would also like to acknowledge my parents who provided all the resources that were
required to complete it.
Network Science Practical (CS-801)

INDEX
Sr. Name of Experiment Start End Page Signature
No. Date Date No.

1. Introduction to Network Science and Visualization Tools. 09-01- 16- 4


2024 01-
2024
2. a) To generate random graph using ER model. 16-01- 23- 9
b) To show
show variation
variation of
of random
random graph
graph with
with respect
respect to
to network
network science
science using
using 2024 01-
Poisson and binomial distribution 2024

3. To implement Scale free networks. 23-01- 30- 16


scale free a 2024 01-
program 2024
4. To implement complex networks. 30-01- 06- 23
2024 02-
2024
5(a). For a given network, calculate and display the following centrality measures. 06-02- 13- 28
Degree 2024 02-
2024

5(b). For a given set of Situation, calculate spearman rho and kendall tau distance. 13-02- 20- 33
equatio Write a implement bottom-up parsing (Operator Precedence 2024 02-
program 2024

6(a). Visualization of Page Rank. 20-02- 27- 36


2024 02-
2024
6(b). To find maximum EigenValue using power method. 27-02- 06- 42
2024 03-
2024
7. To Generate and Interpret Laplace matrix for a network. 06-03- 13- 46
2024 03-
2024
8. To implement SI, SIS, SIR epidemic models. 13-03- 20- 50
2024 03-
2024
9. To implement rumor spreading model. 20-03- 27- 56
2024 03-
2024

10(a). Use of diffusion of innovation theory for determining 27-03- 03- 61


factorsprogram to aimplement
factors affecting particular minimum
dataset. 5 optimizations 2024 04-
2024
10(b). Finding most influential node in a network using centrality and closeness. 03-04- 10- 65
measure 2024 04-
2024
Network Science Practical (CS-801) 4

PRACTICAL NO - 1

1.1. Aim: Introduction to Network Science and Visualization tools.

1.2 INPUT

1. Set of alphabets
2. Prefix to construct corresponding DFA
3. Suffix to construct corresponding DFA
4. Substring to construct corresponding DFA
5. A string to check whether it is recognized by generated DFA or not

1.3. THEORY

Network science is an interdisciplinary field that studies the structure and behavior of
networks, which are systems of interconnected components. This field has applications in
numerous domains, including social networks, biological networks, information networks,
and technological networks. Understanding network science involves analyzing the patterns
of connections (edges) between entities (nodes) and exploring the implications of these
patterns.

Key Concepts in Network Science :

Nodes and Edges :

Nodes: The fundamental units in a network, representing entities such as individuals,


computers, or genes.
Edges: The connections between nodes, representing relationships or interactions.
Types of Networks

Undirected vs. Directed Networks: In undirected networks, edges have no direction,


whereas, in directed networks, edges have a direction indicating the relationship flow.

Weighted vs. Unweighted Networks: In weighted networks, edges have weights


representing the strength of connections, while in unweighted networks, all connections are
equal.

Bipartite Networks: Networks with two distinct types of nodes, with edges only between
nodes of different types.

4
Network Science Practical (CS-801) 5

Network Properties

Degree: The number of connections a node has.


Path Length: The number of edges in the shortest path between two nodes.
Clustering Coefficient: Measures the degree to which nodes in a network tend to cluster
together.
Centrality Measures: Quantify the importance of nodes (e.g., degree centrality,
betweenness centrality, closeness centrality).
Community Structure: The division of a network into clusters or communities with dense
intra-connections and sparse inter-connections.

Network Models :

Random Graphs: Networks where edges are formed randomly.


Scale-Free Networks: Networks characterized by a power-law degree distribution, meaning
a few nodes have many connections while most have few.
Small-World Networks: Networks where most nodes can be reached from every other node
by a small number of steps, combining high clustering with short path lengths.

1.4 VISUALISATION TOOLS :

5
Network Science Practical (CS-801) 6

1.Gephi

• An open-source network analysis and visualization tool.


• Supports large network visualization and offers various layout algorithms.
• Provides features for network statistics, clustering, and filtering.
• Suitable for dynamic network analysis.

2. Cytoscape

• A platform for visualizing complex networks and integrating these with any type of
attribute data.
• Extensively used in biological research for visualizing molecular interaction
networks.
• Supports plugins (apps) for extended functionality.

6
Network Science Practical (CS-801) 7

3. Pajek

• A program for the analysis and visualization of large networks.


• Focuses on efficiency and scalability for handling large datasets.
• Offers various network algorithms and measures

4. NetworkX

• A Python library for the creation, manipulation, and study of complex networks.
• Integrates well with other Python scientific computing libraries like NumPy and
Matplotlib.
• Suitable for network analysis and visualization in Python.

7
Network Science Practical (CS-801) 8

1.5 FREQUENTLY ASKED QUESTIONS (FAQs):

Q1: What is network science?


Ans: Network science is the study of complex networks of interconnected systems, focusing
on their structure, dynamics, and function.

Q2: Why is visualization important in network science?


Ans: Visualization helps in understanding the structure and patterns within complex
networks, making it easier to analyze and interpret data.

Q3: Name a popular tool for network visualization.


Ans: Gephi is a widely used tool for network visualization and analysis.

Q4: What is a node in network science?


Ans: A node, or vertex, represents an individual entity within a network, such as a person in
a social network or a computer in a network system.

Q5: What is the significance of edges in a network?


Ans: Edges, or links, represent the connections or relationships between nodes, determining
the network's structure and flow of information.

8
Network Science Practical (CS-801) 9

PRACTICAL NO – 2

2.1. Aim:
a) To generate random graph using ER model.
b) To show variation of random graph with respect to network science using
Poisson and binomial distribution

2.2. Theory

In graph theory, the Erdos–Rényi model is either of two closely related models for generating
random graphs.
There are two closely related variants of the Erdos–Rényi (ER) random graph model.

In the G(n, M) model, a graph is chosen uniformly at random from the collection of all graphs
which have n nodes and M edges. For example, in the G(3, 2) model, each of the three
possible graphs on three vertices and two edges are included with probability 1/3.
In the G(n, p) model, a graph is constructed by connecting nodes randomly. Each edge is
included in the graph with probability p independent from every other edge. Equivalently, all

Fig 2.1 : A graph generated by the binomial model of Erdos and Rényi (p =
0.01)

graphs with n nodes and M edges have equal probability of

9
Network Science Practical (CS-801) 10

A graph generated by the binomial model of Erdos and Rényi (p = 0.01)


The parameter p in this model can be thought of as a weighting function; as p increases from
0 to 1, the model becomes more and more likely to include graphs with more edges and less
and less likely to include graphs with fewer edges. In particular, the case p = 0.5 corresponds
to the case where all graphs on n vertices are chosen with equal probability.

The article will basically deal with the G (n,p) model where n is the no of nodes to be created
and p defines the probability of joining of each node to the other.

2.3. Properties of G(n, p)

With the notation above, a graph in G(n, p) has on average edges. The distribution of the
degree of any particular vertex is binomial:

Where n is the total number of vertices in the graph.


Since as and np= constant This distribution is Poisson for large n and np = const. In a 1960
paper, Erdos and Rényi described the behaviour of G(n, p) very precisely for various values
of p. Their results included that:

If np < 1, then a graph in G(n, p) will almost surely have no connected components of size
larger than O(log(n)).
If np = 1, then a graph in G(n, p) will almost surely have a largest component whose size is
of order .

If np
c > 1, where c is a constant, then a graph in G(n, p) will almost surely have a unique giant
component containing a positive fraction of the vertices. No other component will contain
more than O(log(n)) vertices.
If
, then a graph in G(n, p) will almost surely contain isolated vertices, and thus be disconnected.
If
, then a graph in G(n, p) will almost surely be connected.
Thus is a sharp threshold for the connectedness of G(n, p). Further properties of the graph
can be described almost precisely as n tends to infinity. For example, there is a k(n)
(approximately equal to 2log2(n)) such that the largest clique in G(n, 0.5) has almost surely
either size k(n) or k(n) + 1. Thus, even though finding the size of the largest clique in a graph
is NP-complete, the size of the largest clique in a “typical” graph (according to this model) is
very well understood.

Next I’ll describe the code to be used for making the ER graph. For implementation of the
code below, you’ll need to install the netwrokx library as well you’ll need to install the
matplotlib library.

10
Network Science Practical (CS-801) 11

Erdos_renyi_graph(n, p, seed=None, directed=False)


Returns a G(n,p) random graph, also known as an Erdos-Rényi graph or a binomial graph.
The G(n,p) model chooses each of the possible edges with probability p. The functions
binomial_graph() and erdos_renyi_graph() are aliases of this function.

Parameters: n (int) – The number of nodes.


p (float) – Probability for edge creation.
seed (int, optional) – Seed for random number generator (default=None).
directed (bool, optional (default=False)) – If True, this function returns a directed graph.

Code :

Output :

The above example is for 50 nodes and is thus a bit unclear.


When considering the case for lesser no of nodes (for example 10), you can clearly see the
difference.
Using the codes for various probabilities, we can see the difference easily:

11
Network Science Practical (CS-801) 12

Code :

Output :

12
Network Science Practical (CS-801) 13

B) To show variation of random graph with respect to network science


using Poisson and binomial distribution.

2.4 Theory :

To demonstrate the variation of a random graph with respect to network science, we can
use the Poisson and Binomial distributions to model the degree distribution of nodes. In the
context of random graphs, especially the Erdős–Rényi model G(n,p), where ,
n is the number of nodes and
p is the probability of an edge between any two nodes, the degree distribution of nodes
can be approximated using these distributions.

Binomial Distribution:

• In an Erdős–Rényi random graph 𝐺(𝑛,𝑝), the degree 𝑘


of a node follows a Binomial distribution Bin(n−1,p), since each node has
n−1 possible edges, each existing with probability 𝑝.
• The probability of a node having k edges (degree k) is given by:

Poisson Distribution:

• When 𝑛 is large and 𝑝 is small such that the expected degree


λ=(n−1)p is constant, the Binomial distribution Bin(n−1,p) can be
approximated by a Poisson distribution Poisson(λ).
• The probability of a node having k edges is:

2.5 Practical Example and Visualization :

To visualize the variation of random graphs with respect to these distributions, we can:
Generate random graphs using the Erdős–Rényi model for different values of 𝑛 and
p.
Compare the observed degree distributions with the theoretical Binomial and Poisson
distributions.

13
Network Science Practical (CS-801) 14

Code :

Output :

14
Network Science Practical (CS-801) 15

2.5 FREQUENTLY ASKED QUESTIONS (FAQS) -:

Q1: What is the ER model in network science?


Ans: The ER model, or Erdős-Rényi model, is a method for generating random graphs by
connecting nodes randomly with a given probability.

Q2: How does the ER model generate a random graph?


Ans: The ER model generates a random graph by starting with a set of nodes and then adding
edges between each pair of nodes with a fixed probability.

Q3: What is a Poisson distribution in the context of network science?


Ans: In network science, a Poisson distribution describes the probability of a given number
of edges in a random graph, particularly in the limit of large networks with small
connection probabilities.

Q4: How does the binomial distribution relate to the ER model?


Ans: The binomial distribution describes the probability of a specific number of edges
between nodes in a random graph generated by the ER model, given a fixed number of
nodes and edge probability.

Q5: What can the variation of random graphs using Poisson and binomial distributions
reveal?
Ans: Analyzing the variation using Poisson and binomial distributions can reveal insights
into the connectivity patterns, robustness, and phase transitions of networks in different
random graph scenarios.

15
Network Science Practical (CS-801) 16

PRACTICAL NO – 3

3.1. Aim: To implement scale free networks.

3.2 . Theory :
A common feature of real world networks is the presence of hubs, or a few nodes that are
highly connected to other nodes in the network. The presence of hubs will give the degree
distribution a long tail, indicating the presence of nodes with a much higher degree than most
other nodes.

Fig 3.1 : The red node is an example of a


hub.

Scale-free networks are characterized by a power-law degree distribution, where a few nodes
(hubs) have a very high degree while most nodes have a relatively low degree. One of the
most popular models for generating scale-free networks is the Barabási–Albert (BA) model,
which uses a preferential attachment mechanism.

EQUATION :

Scale-free networks are a type of network characterized by the presence of large hubs. A
scale-free network is one with a power-law degree distribution. For an undirected network,
we can just write the degree distribution as :

16
Network Science Practical (CS-801) 17

where γ is some exponent. This form of Pdeg(k) decays slowly as the degree k increases,
increasing the likelihood of finding a node with a very large degree.

Fig 3.2. : Degress based graphs for scale free networks

CODE :

17
Network Science Practical (CS-801) 18

3.3. Explanation

Network Generation: The Barabási–Albert model is used to generate a scale-free network.

Degree Distribution: The degree sequence and count are calculated and plotted on a log-log
scale to show the power-law distribution.

Network Visualization: The network is visualized using the spring layout to depict the
structure clearly.

OUTPUT PLOTS :

Figure 3.3. : Degree distribution in a scale free network plot

18
Network Science Practical (CS-801) 19

Figure 3.4. : Plot 2 for scale free network degree distribution

Figure 3.5. : Plot 3 for scale free network degree distribution

19
Network Science Practical (CS-801) 20

3.4. EXPLANATION :

Graph Generation:

• nx.barabasi_albert_graph(n, m) generates a scale-free network with n nodes


and m edges for each new node.

Degree Distribution:

• The degree sequence is calculated from the graph.


• A histogram of the degrees is created and plotted on a log-log scale to
highlight the power-law distribution.

Network Visualization:

• nx.spring_layout(G) positions nodes using the Fruchterman-Reingold force-


directed algorithm.
• The network is plotted using NetworkX's draw_networkx function with
customization for node size, color, and edge color for better visualization.

3.5. Characteristics of Scale-Free Networks :

Hubs: The presence of highly connected nodes (hubs) that dominate the network structure.
Robustness and Vulnerability: Scale-free networks are robust against random failures but
vulnerable to targeted attacks on hubs.
Degree Distribution: The degree distribution follows a power-law, indicating that a few nodes
have many connections while most have few.

3.6. Practical Applications :

Social Networks: Many social networks, such as LinkedIn or Facebook, exhibit scale-free
properties where some individuals (nodes) have a very large number of connections (friends,
followers).
Internet: The structure of the Internet is scale-free, with a few highly connected routers
forming the network's backbone.
Biological Networks: Protein-protein interaction networks and metabolic networks in biology
often show scale-free characteristics.

20
Network Science Practical (CS-801) 21

3.7. CONCLUSION :

Scale-free networks are a fundamental concept in network science, reflecting the structure of
many real-world networks. By implementing the Barabási–Albert model, you can generate
and analyze these networks, exploring their unique properties and implications in various
fields. The provided code helps in visualizing and understanding the degree distribution and
overall network structure, laying the groundwork for further exploration and research in
network science.

21
Network Science Practical (CS-801) 22

3.8. FREQUENTLY ASKED QUESTIONS (FAQS) -:

Q1: What is a scale-free network?


Ans: A scale-free network is a type of network characterized by a power-law degree
distribution, where a few nodes (hubs) have many connections, while most nodes have
few connections.

Q2: How can a scale-free network be generated?


Ans: A scale-free network can be generated using the Barabási-Albert (BA) model, which
builds the network incrementally by adding new nodes that preferentially attach to
existing nodes with higher degrees.

Q3: What is the significance of hubs in scale-free networks?


Ans: Hubs are highly connected nodes that play a crucial role in the connectivity and
robustness of scale-free networks, facilitating efficient communication and resilience
against random failures.

Q4: What distinguishes a scale-free network from a random network?


Ans: Unlike random networks, which have a Poisson degree distribution, scale-free
networks have a power-law degree distribution, leading to the presence of hubs and a
more hierarchical structure.

Q5: Why are scale-free networks important in network science?


Ans: Scale-free networks are important because they accurately represent many real-world
systems, such as the internet, social networks, and biological networks, helping to
understand their structure and dynamics.

22
Network Science Practical (CS-801) 23

PRACTICAL NO – 4

4.1. Aim: To implement Complex networks.

4.2. Theory :

Complex networks are structures that consist of nodes (also called vertices) and edges (links)
connecting pairs of nodes. They are termed "complex" due to their intricate topology, which
often displays non-trivial characteristics like clustering, small-world properties, and scale-
free distributions. Understanding complex networks is essential in many fields, including
sociology, biology, computer science, and physics.

Models of Complex Networks-:

1. Erdős–Rényi Model (Random Networks)

In this model, each pair of nodes is connected with a fixed probability p. This leads to a
binomial degree distribution, which can be approximated by a Poisson distribution for large
networks.

Characteristics: Low clustering coefficient, small average path length.

2. Watts-Strogatz Model (Small-World Networks)

Begins with a regular ring lattice where each node is connected to k nearest neighbors. Each
edge is then randomly rewired with a probability p, introducing randomness while
maintaining high clustering.

Characteristics: High clustering coefficient, small average path length,


capturing the small-world phenomenon.

3. Barabási-Albert Model (Scale-Free Networks)

Builds the network using a preferential attachment mechanism. Nodes are added one at a
time, and each new node forms m edges to existing nodes with a probability proportional to
their current degree.

Characteristics: Power-law degree distribution, presence of hubs, robustness


against random failures but vulnerability to targeted attacks.

23
Network Science Practical (CS-801) 24

4.3. Applications of Complex Networks

Social Networks: Understanding the structure of social interactions, information spread, and
influence within communities.
Biological Networks: Analyzing protein-protein interactions, gene regulatory networks, and
metabolic pathways.
Technological Networks: Studying the internet's structure, power grids, and communication
networks.
Information Networks: Exploring citation networks, hyperlink structures on the web, and data
dissemination.

4.4. PRACTICAL IMPLEMENTATION :

Watts-Strogatz Small-World Model :

Begins with a regular ring lattice where each node is connected to k nearest neighbors. Each
edge is then randomly rewired with a probability p, introducing randomness while
maintaining high clustering.

Code :

24
Network Science Practical (CS-801) 25

OUTPUT PLOTS :

25
Network Science Practical (CS-801) 26

4.5. CONCLUSION :

Complex networks provide a rich framework for analyzing and understanding the structure
and dynamics of interconnected systems. By studying models like random graphs, small-
world networks, and scale-free networks, we can gain insights into various real-world
networks' resilience, efficiency, and vulnerability. Practical implementations using tools like
NetworkX and Matplotlib allow for detailed exploration and visualization of these complex
structures.

26
Network Science Practical (CS-801) 27

4.8 FREQUENTLY ASKED QUESTIONS (FAQS) -:

Q1: What are complex networks?


Ans: Complex networks are networks with non-trivial topological features that are neither
purely regular nor purely random, often found in natural, social, and technological
systems.

Q2: How can one implement a complex network?


Ans: A complex network can be implemented using models such as the Watts-Strogatz
model for small-world networks or the Barabási-Albert model for scale-free networks,
which capture different aspects of complexity.

Q3: What are the key characteristics of complex networks?


Ans: Key characteristics of complex networks include heterogeneity in node degree,
clustering, and short average path lengths, which contribute to their robustness and
efficient information flow.

Q4: What is the Watts-Strogatz model used for in complex networks?


Ans: The Watts-Strogatz model is used to generate small-world networks, which exhibit
high clustering and short path lengths, mimicking social networks and other real-world
systems.

Q5: Why is studying complex networks important?


Ans: Studying complex networks is important because they help us understand the behavior
and resilience of various systems, from the spread of diseases in social networks to the
stability of power grids and communication networks.

27
Network Science Practical (CS-801) 28

PRACTICAL NO – 5 (A)

5.1. Aim: For a given network, calculate and display the following centrality
measures: Degree, closeness. betweenness, Eigen.

5.2. Theory :

IDEA : To calculate and display the centrality measures (degree, closeness, betweenness,
and eigenvector centrality) for a given network, you can use the NetworkX library in Python.
Below is a step-by-step guide along with a complete code example for these calculations and
visualizations.

Step-by-Step Guide :

1. Generate or Load a Network: You can create a random graph or load an existing network.

2. Calculate Centrality Measures:

Degree Centrality: Measures the number of connections a node has.

Closeness Centrality: Measures how close a node is to all other nodes in the network.
Betweenness Centrality: Measures the extent to which a node lies on paths between other
nodes.

Eigenvector Centrality: Measures the influence of a node based on the connections it has
to other high-influence nodes.

3. Visualize the Network with Centrality Measures: Use color and size to represent
centrality measures.

28
Network Science Practical (CS-801) 29

CODE :

29
Network Science Practical (CS-801) 30

OUTPUT :

Fig 5(A).1 : Degree Centrality

Fig 5(A).2 : Closeness Centrality

30
Network Science Practical (CS-801) 31

Fig 5(A).3 : Betweenness Centrality

Fig 5(A).4. : Eigenvector Centrality

31
Network Science Practical (CS-801) 32

5.3. FREQUENTLY ASKED QUESTIONS (FAQS) -:

Q1: What is degree centrality in a network?


Ans: Degree centrality measures the number of direct connections a node has in a network,
indicating its immediate influence or activity.

Q2: How is closeness centrality calculated in a network?


Ans: Closeness centrality is calculated by taking the reciprocal of the sum of the shortest
path distances from a node to all other nodes, reflecting how quickly information can
spread from that node.

Q3: What does betweenness centrality measure?


Ans: Betweenness centrality measures the extent to which a node lies on the shortest paths
between other nodes, indicating its role as a bridge or bottleneck in the network.

Q4: What is Eigenvector centrality, and how does it differ from degree centrality?
Ans: Eigenvector centrality measures a node's influence based on the centrality of its
neighbors, considering not just the number of connections but the quality of those
connections, unlike degree centrality which only counts direct links.

Q5: Why are centrality measures important in network analysis?


Ans: Centrality measures are important because they help identify the most influential or
critical nodes within a network, aiding in tasks such as optimizing network structure,
targeting key nodes for interventions, and understanding network dynamics.

32
Network Science Practical (CS-801) 33

PRACTICAL NO – 5 (B)

5(b).1. Aim: For a given set of situation, Calculate Spearman rho and
Kendall-Tau ranking distance.

5(b).2. Theory :

Spearman's rho: Measures the rank correlation between two sets of rankings. It assesses
how well the relationship between two variables can be described using a monotonic function.

Kendall's tau: Measures the ordinal association between two sets of rankings. It assesses the
similarity of the orderings of the data when ranked by each of the quantities.

CODE AND IMPLEMENTATION :

To calculate the Spearman's rho and Kendall's tau ranking distance for a given set of
situations, you can use Python libraries like ‘scipy’ which provides functions for these
calculations. Below, I provide an example that demonstrates how to calculate these rank
correlation coefficients for two given sets of rankings.

33
Network Science Practical (CS-801) 34

OUTPUT :

5(b).3. EXPLANATION
Data Preparation:

rankings1 and rankings2 are the two sets of rankings for which we want to calculate the rank
correlation coefficients.

Spearman's rho Calculation:

spearmanr(rankings1, rankings2) calculates Spearman's rho and the associated p-value.


Spearman's rho is a measure of rank correlation; it assesses how well the relationship between
two variables can be described by a monotonic function.

Kendall's tau Calculation:

kendalltau(rankings1, rankings2) calculates Kendall's tau and the associated p-value.


Kendall's tau is a measure of rank correlation; it assesses the similarity of the orderings of the
data when ranked by each of the quantities.

34
Network Science Practical (CS-801) 35

5(b).4. FREQUENTLY ASKED QUESTIONS (FAQS) -:

Q1: What is Spearman's rho?


Ans: Spearman's rho is a non-parametric measure of rank correlation that assesses the
strength and direction of the association between two ranked variables.

Q2: How is Spearman's rho calculated?


Ans: Spearman's rho is calculated by ranking the data points of two variables, computing the
difference between each pair of ranks, squaring these differences, summing them, and
applying a specific formula to convert this sum into the correlation coefficient.

Q3: What is Kendall-Tau ranking distance?


Ans: Kendall-Tau ranking distance is a measure of the correspondence between two
rankings by counting the number of pairwise disagreements between them.

Q4: How is Kendall-Tau calculated?


Ans: Kendall-Tau is calculated by comparing each pair of items in the two rankings to
determine if the order is the same or different, then computing the ratio of the number
of concordant pairs to discordant pairs, adjusting for tied ranks.

Q5: Why are Spearman's rho and Kendall-Tau important in rank correlation
analysis?
Ans: Spearman's rho and Kendall-Tau are important because they provide insights into the
relationship between ranked variables, helping to understand and quantify the
consistency and strength of the rankings in various situations.

35
Network Science Practical (CS-801) 36

PRACTICAL NO – 6 (A)

6.1. Aim: Visualization of Page Rank.

6.2. Theory :

PageRank is an algorithm used by search engines to rank web pages in their search results. It
was developed by Larry Page and Sergey Brin, the co-founders of Google, while they were
students at Stanford University. PageRank forms the foundation of Google's search algorithm
and plays a crucial role in determining the relevance and importance of web pages on the
internet.

PageRank operates on the principle of "voting" or "recommendation" among web pages. The
underlying idea is that a page is important if it is linked to by other important pages. However,
not all links are equal. PageRank considers both the quantity and quality of links to a page.

Link Analysis:

PageRank is based on the notion of "voting" or "endorsement" by other pages. When one
page links to another, it is essentially casting a vote for the linked page's importance.
A page with many incoming links is considered more important than a page with fewer links.

Importance Distribution:

PageRank distributes importance or "voting power" among pages in a network. It iteratively


assigns each page a score based on the importance of the pages linking to it.
The more important the pages linking to a page, the more influence they have on its PageRank
score.

Iterative Calculation:

PageRank is calculated iteratively. Initially, all pages are assigned an equal score. In each
iteration, the PageRank of each page is updated based on the PageRank scores of the pages
linking to it.
This process continues until the PageRank scores converge to stable values.

Damping Factor:

To address the issue of dangling nodes (pages with no outgoing links) and dead ends, a
damping factor (typically set to around 0.85) is introduced.
The damping factor represents the probability that a user will continue clicking on links rather
than jumping to a random page.

36
Network Science Practical (CS-801) 37

Random Surfer Model:

PageRank can be understood using the "random surfer" model. In this model, a surfer starts
on a random page and follows links, occasionally jumping to a random page.
The PageRank score of a page represents the likelihood that a random surfer will be on that
page at any given time.

Application in Search Engines:

In search engines, pages with higher PageRank scores are considered more relevant and are
displayed higher in search results.
PageRank is one of many factors used by search engines to determine the relevance and
ranking of web pages.

6.3. CODE AND IMPLEMENTATION :

To visualize PageRank for a given network, you can use the NetworkX library to calculate
the PageRank values and Matplotlib to visualize the results. Below is an example
demonstrating how to compute and visualize PageRank for a network.

Step-by-Step Guide :

Create or Load a Network: Generate a random network or load an existing network.


Compute PageRank: Use NetworkX's pagerank function to calculate PageRank values.
Visualize the Network: Visualize the network where node sizes are proportional to their
PageRank values.

37
Network Science Practical (CS-801) 38

CODE :

38
Network Science Practical (CS-801) 39

OUTPUT :

Fig 6(A).1. : Network Visualization with PageRank

6.4 EXPLANATION

Network Generation:

G = nx.erdos_renyi_graph(25, 0.1, directed=True): Creates a random directed graph with 25


nodes and a 0.1 probability of edge creation between any two nodes.

PageRank Calculation:

pagerank_values = nx.pagerank(G): Computes the PageRank values for all nodes in the
graph.

Normalization for Visualization:

pagerank_values_normalized = [v * 1000 for v in pagerank_values.values()]: Normalizes the


PageRank values to use them as node sizes in the visualization.

39
Network Science Practical (CS-801) 40

Network Visualization:

pos = nx.spring_layout(G): Positions the nodes using the spring layout.


nx.draw_networkx_nodes(...): Draws the nodes with sizes based on normalized PageRank
values and colors based on actual PageRank values.
nx.draw_networkx_edges(...): Draws the edges of the network.
nx.draw_networkx_labels(...): Draws the labels for the nodes.
plt.colorbar(...): Adds a color bar indicating the PageRank values.

Advanced Visualization :

For larger and more complex networks, additional visual adjustments and enhancements can
be made:
Adjust Node Size and Color: Better differentiation between high and low PageRank nodes.
Interactive Visualization: Using libraries such as plotly or Bokeh for interactive network
visualization.
Community Detection: Highlighting communities or clusters within the network.

6.5 IMPORTANCE AND APPLICATIONS

PageRank revolutionized web search by providing a scalable and effective method for
ranking web pages. Its importance extends beyond search engines and is used in various
fields, including:

Web Search: Determining the relevance and ranking of search results.


Network Analysis: Analyzing the structure and importance of networks beyond the web,
such as social networks and citation networks.
Recommendation Systems: Ranking items or content based on their popularity or
importance.
Graph Algorithms: Serving as a fundamental algorithm in graph theory and network
science.

40
Network Science Practical (CS-801) 41

6(A).6. FREQUENTLY ASKED QUESTIONS (FAQS) -:

Q1: What is PageRank?


Ans: PageRank is an algorithm originally used by Google to rank web pages in search results
based on their importance, determined by the number and quality of links pointing to
them.

Q2: How is PageRank calculated?


Ans: PageRank is calculated iteratively by distributing a page's rank value to its outbound
links and summing the contributions from inbound links, usually incorporating a
damping factor to account for random surfing behavior.

Q3: Why is visualizing PageRank useful?


Ans: Visualizing PageRank is useful for understanding the relative importance of nodes in
a network, identifying influential nodes, and analyzing the link structure of web pages
or other interconnected systems.

Q4: What tools can be used to visualize PageRank?


Ans Tools like Gephi, Cytoscape, and NetworkX can be used to visualize PageRank by
creating graphical representations where node size or color indicates their PageRank
values.

Q5: What can a PageRank visualization reveal about a network?


Ans: A PageRank visualization can reveal the hierarchical structure of a network, highlight
key hubs and authorities, and provide insights into the flow of information or influence
within the network.

41
Network Science Practical (CS-801) 42

PRACTICAL NO – 6 (B)

6(b).1. Aim: To find maximum Eigenvalue using power method.

6(b).2. Theory :

The power method is an iterative algorithm used to find the dominant (largest magnitude)
eigenvalue and its corresponding eigenvector of a square matrix. It relies on the concept of
eigenvalues and eigenvectors, which are fundamental properties of square matrices.

Eigenvalues and Eigenvectors:

For a square matrix A, an eigenvector x and its corresponding eigenvalue 𝜆 satisfy the
equation 𝐴𝑥=𝜆𝑥.
Eigenvectors represent directions within the matrix that are only scaled by the matrix, while
eigenvalues represent the scaling factor.

Dominant Eigenvalue:

In many cases, matrices have one dominant eigenvalue (largest magnitude) that determines
their behavior. The power method focuses on finding this dominant eigenvalue.

Power Iteration:

The power method iteratively applies the matrix A to an initial vector 𝑥0 and normalizes the
resulting vector. The iteration continues until convergence, where the vector xk
approaches the dominant eigenvector of 𝐴

Convergence:

Under certain conditions, such as the matrix having a single dominant eigenvalue or being
irreducible and aperiodic (for Markov matrices), the power method converges to the dominant
eigenvalue and its associated eigenvector.
Convergence is typically assessed by monitoring the change in the vector between iterations
or by setting a tolerance threshold.

Eigenvalue Estimation:

After convergence, the dominant eigenvalue can be estimated as the ratio of the
corresponding components of the iterates.
The corresponding eigenvector is the normalized final iterate.

42
Network Science Practical (CS-801) 43

Limitations:
The power method may converge slowly or fail to converge for matrices with multiple
eigenvalues of similar magnitudes or for matrices with a dominant eigenvalue that is negative.
It also requires the matrix 𝐴 to be diagonalizable, meaning it must have a complete set of
linearly independent eigenvectors.

6(b).3. PHYTON IMPLEMENTATION

43
Network Science Practical (CS-801) 44

OUTPUT :

6(b).4. EXPLANATION :

• The power_method function takes the matrix A as input along with optional
parameters for tolerance and maximum iterations.

• It initializes a random vector x and iterates until convergence, updating x at each step.

• The dominant eigenvalue is estimated as the dot product of the final y and x.

• The corresponding eigenvector is the normalized final x.

Importance and Applications-:

The power method is widely used in various fields, including:


Numerical Analysis: Efficiently finding dominant eigenvalues and eigenvectors of large
matrices.
Linear Algebra: Understanding the properties and behavior of matrices.
Graph Theory: Analyzing networks and determining influential nodes in networks (e.g.,
PageRank algorithm).
Physics and Engineering: Solving eigenvalue problems in physics, engineering, and other
scientific disciplines.

44
Network Science Practical (CS-801) 45

6(B).5. FREQUENTLY ASKED QUESTIONS (FAQS) -:

Q1: What is the power method used for in numerical analysis?


Ans: The power method is an iterative technique used to find the largest eigenvalue (in
magnitude) and its corresponding eigenvector of a matrix.

Q2: How does the power method work to find the maximum eigenvalue?
Ans: The power method works by repeatedly multiplying a non-zero vector by the matrix,
normalizing the result, and converging to the dominant eigenvector, from which the
largest eigenvalue can be derived.

Q3: What are the initial steps to start the power method?
Ans: To start the power method, choose an initial non-zero vector, multiply it by the matrix,
normalize the resulting vector, and repeat the process until convergence.

Q4: Why is normalization important in the power method?


Ans Normalization is important to prevent the vector from growing too large or shrinking
too small, ensuring numerical stability and convergence to the correct eigenvector.

Q5: What does the power method reveal about a matrix?


Ans: The power method reveals the largest eigenvalue and its corresponding eigenvector,
which are crucial in understanding the matrix's spectral properties and applications like
stability analysis and principal component analysis.

45
Network Science Practical (CS-801) 46

PRACTICAL NO – 7

7.1. Aim: To generate and interpret Laplace matrix for a network.

7.2. Theory :
The Laplacian matrix, also known as the Kirchhoff matrix or admittance matrix, is a square
matrix used to represent the topology and properties of a network. It is commonly used in
various fields, including graph theory, network analysis, and physics. Here's how you can
generate and interpret the Laplacian matrix for a network:

GENERATING THE LAPLACIAN MATRIX :

Given a network represented by an adjacency matrix A, the Laplacian matrix


L is defined as:

L=D−A

Where:
D is the diagonal degree matrix, where Dii represents the degree of node 𝑖.,
A is the adjacency matrix of the network.

INTERPRETATION OF THE LAPLACIAN MATRIX :

Connection Strength:

The Laplacian matrix captures the strength of connections between nodes in the network.
Off-diagonal L represent the negative of the weights or conductances of the edges between
nodes.

Node Degrees:

The diagonal entries of the Laplacian matrix correspond to the degrees of the nodes in the
network.

Larger diagonal entries indicate higher degrees, while smaller entries represent nodes with
fewer connections.

Graph Connectivity:

The Laplacian matrix characterizes the connectivity and topology of the network.

46
Network Science Practical (CS-801) 47

The number of zero eigenvalues of L corresponds to the number of connected components in


the network.

Spectral Properties:

The Laplacian matrix has interesting spectral properties.

The eigenvalues of L provide information about the network's structure and dynamics, such
as its robustness and synchronization properties.

7.3. PYTHON IMPLEMENTATION :

47
Network Science Practical (CS-801) 48

OUTPUT:

INTERPRETATION :

Adjacency Matrix: Represents the connections between nodes in the network.


Degree Matrix: Diagonal matrix representing the degrees of nodes.
Laplacian Matrix: Captures the connectivity and properties of the network.
Eigenvalues: Provide insights into the network's structure and dynamics.

7.4. CONCLUSION :
By generating and interpreting the Laplacian matrix, you can gain valuable insights into the
connectivity, structure, and dynamics of the network. It serves as a fundamental tool for
analyzing networks in various domains, including social networks, transportation networks,
and biological networks.

48
Network Science Practical (CS-801) 49

7.5. FREQUENTLY ASKED QUESTIONS (FAQS) -:

Q1: What is a Laplace matrix in the context of a network?


Ans: The Laplace matrix (or Laplacian) of a network is a matrix representation that describes
the connectivity of the graph, defined as

L=D-A

Q2: What properties does the Laplace matrix reveal about a network?
Ans: The Laplace matrix reveals important properties such as connectivity, the number of
connected components (given by the multiplicity of the zero eigenvalue), and can be
used to study graph partitioning and clustering.

Q3: Why is the Laplace matrix important in network analysis?


Ans: The Laplace matrix is important because it helps in analyzing the structural properties
of the network, solving optimization problems, and understanding dynamic processes
such as diffusion and synchronization.

Q4: What can the eigenvalues of the Laplace matrix tell us about the network?
Ans The eigenvalues of the Laplace matrix provide insights into the network's
connectivity and robustness, with the smallest non-zero eigenvalue (algebraic
connectivity) indicating how well connected the network is.

Q5: How does the Laplace matrix relate to graph theory concepts such as cuts and
flows in a network?
Ans: In graph theory, the Laplace matrix is closely related to concepts of cuts and flows. It
helps identify minimum cuts, which separate the network into distinct components, and
is used in optimizing network flows by solving related linear algebra problems, such as
finding the maximum flow or analyzing the network's resistance to cuts and disruptions.

49
Network Science Practical (CS-801) 50

PRACTICAL NO – 8

8.1. Aim: To implement SI, SIS, SIR epidemic models.

8.2. Theory :

The SI, SIS, and SIR models are compartmental models used to describe the dynamics of
infectious diseases within a population. These models divide the population into different
compartments based on their disease status and track the flow of individuals between these
compartments over time. Here's a brief overview of the theory behind each model:

SI Model (Susceptible-Infectious) -:

Compartments:

S (Susceptible): Individuals who are susceptible to the disease and can become infected.

I (Infectious): Individuals who are infected and capable of transmitting the disease.

Assumptions:
Once individuals become infected, they remain infectious for the duration of the simulation.
There is no recovery or immunity from the disease.

Dynamics:
Susceptible individuals become infected at a rate proportional to the product of the
susceptible and infectious populations.
The rate of change in the susceptible population is negative, indicating that susceptible
individuals are being infected.
The rate of change in the infectious population is positive, indicating that individuals are
becoming infected.

SIS Model (Susceptible-Infectious-Susceptible) -:

Compartments:

S (Susceptible): Individuals who are susceptible to the disease and can become infected.

I (Infectious): Individuals who are infected and capable of transmitting the disease.

Assumptions:

Infected individuals can recover from the disease and become susceptible again.
There is no immunity acquired from previous infections.

50
Network Science Practical (CS-801) 51

Dynamics:

Susceptible individuals become infected at a rate proportional to the product of the


susceptible and infectious populations.

Infected individuals recover from the disease at a constant rate and become susceptible again.

The rate of change in the susceptible population is influenced by both infection and recovery.

The rate of change in the infectious population is influenced by infection and recovery.

SIR Model (Susceptible-Infectious-Recovered) -:

Compartments:

S (Susceptible): Individuals who are susceptible to the disease and can become infected.

I (Infectious): Individuals who are infected and capable of transmitting the disease.

R (Recovered): Individuals who have recovered from the disease and are immune.

Assumptions:

Infected individuals can recover from the disease and acquire immunity, becoming immune
to reinfection.

There is no loss of immunity over time.

Dynamics:

Susceptible individuals become infected at a rate proportional to the product of the


susceptible and infectious populations.

Infected individuals recover from the disease at a constant rate and become immune.

The rate of change in the susceptible population is influenced by infection.

The rate of change in the infectious population is influenced by infection and recovery.

The rate of change in the recovered population is influenced by recovery.

51
Network Science Practical (CS-801) 52

SI MODEL :

In the SI model, individuals remain infectious once infected and do not recover. The basic
dynamics of the model are described by the following set of ordinary differential equations
(ODEs):

SIS Model:

In the SIS model, individuals can recover from the infection and become susceptible again.
The dynamics are governed by the following ODEs:

SIR Model:

In the SIR model, individuals recover from the infection and become immune. The dynamics
are given by:

52
Network Science Practical (CS-801) 53

8.3. PYTHON IMPLEMENTATION

53
Network Science Practical (CS-801) 54

OUTPUT :

8.4. INTERPRETATION :
The plots show the dynamics of the susceptible, infectious, and recovered populations over
time for each epidemic model.
In the SI model, the infectious population grows continuously without recovery.
In the SIS model, the infectious population fluctuates as individuals recover and become
susceptible again.
In the SIR model, the infectious population initially grows but eventually decreases as
individuals recover and become immune.

8.5. CONCLUSION :
These compartmental models provide a framework for understanding the spread of infectious
diseases within a population and can be used to explore various scenarios, interventions, and
control strategies. By tracking the flow of individuals between compartments over time, these
models can help inform public health policies and interventions to mitigate the impact of
infectious diseases.

54
Network Science Practical (CS-801) 55

8.6. FREQUENTLY ASKED QUESTIONS (FAQS) -:

Q1: What is the SI epidemic model?


Ans: The SI (Susceptible-Infected) model is a simple epidemic model where individuals can
transition from being susceptible (S) to infected (I), with no recovery or removal,
modeling diseases where infection leads to permanent status change.

Q2: How does the SIS epidemic model differ from the SI model?
Ans: The SIS (Susceptible-Infected-Susceptible) model allows individuals to transition from
susceptible to infected and back to susceptible, representing diseases where recovery
does not confer immunity, and individuals can be reinfected.

Q3: What additional state is included in the SIR epidemic model compared to the SI
and SIS models?
Ans: The SIR (Susceptible-Infected-Recovered) model includes a recovered (R) state, where
individuals who recover from the infection gain immunity and do not return to the
susceptible state, modeling diseases where recovery leads to immunity.

Q4: How are the transitions between states typically modeled in these epidemic
models?
Ans:Transitions between states in epidemic models are typically modeled using
differential equations that describe the rate of change of the population in each state
based on parameters such as infection rate and recovery rate.

Q5: Why are SI, SIS, and SIR models important in epidemiology?
Ans: SI, SIS, and SIR models are important in epidemiology because they provide a
framework for understanding the spread of infectious diseases, predicting outbreak
dynamics, and evaluating the impact of interventions such as vaccination and social
distancing.

55
Network Science Practical (CS-801) 56

PRACTICAL NO – 9

9.1. Aim: To implement rumor spreading model.

9.2. Theory

Assumptions:

• Each individual in the network can be in one of two states: "Ignorant" (unaware of the
rumor) or "Spreader" (aware of the rumor and actively spreading it).

• Individuals interact with each other randomly or based on a specified network


structure.

• Spreaders transmit the rumor to ignorant individuals with a certain probability per
interaction.

Dynamics:

• Initially, a small subset of individuals (seed nodes) is selected as spreaders, while the
rest are ignorant.

• In each time step, spreaders interact with other individuals, transmitting the rumor to
ignorant individuals with a certain probability.

• Ignorant individuals become spreaders upon hearing the rumor for the first time.

• The process continues until no more individuals become spreaders, indicating that the
rumor has saturated the network or died out.

Parameters:

• Probability of Transmission: The likelihood that a spreader transmits the rumor to an


ignorant individual during an interaction.

• Network Structure: The pattern of interactions between individuals, such as random,


regular, or scale-free networks.

• Initial Conditions: The number and identity of seed nodes selected as spreaders at the
beginning of the simulation.

56
Network Science Practical (CS-801) 57

9.3. IMPLEMENTATION :

Here's a simple Python implementation of the rumor spreading model using a random
network structure:

9.4. Code Description:


Importing Libraries:

import networkx as nx: Imports the NetworkX library, which is used for generating and
analyzing complex networks.

import numpy as np: Imports NumPy, which is used for numerical computations.

import matplotlib.pyplot as plt: Imports Matplotlib for plotting.

57
Network Science Practical (CS-801) 58

Defining the Rumor Spreading Model Function (rumor_spreading_model):

• This function takes as input a network G, probability of transmission p_transmission, seed


nodes seed_nodes, and maximum number of steps max_steps.
• It initializes the states of nodes in the network as either 'Ignorant' or 'Spreader'.
• It simulates the spreading of the rumor through the network for a maximum number of
steps.
• It returns the final state of each node in the network.

Generating a Random Network (G):

nx.erdos_renyi_graph(100, 0.1):
Generates a random Erdős-Rényi graph with 100 nodes and edge probability 0.1. This creates
a random network where each pair of nodes has a 0.1 probability of being connected by an
edge.

Setting Parameters:
p_transmission = 0.1: Probability of transmission, representing the likelihood that a spreader
transmits the rumor to an ignorant individual during an interaction.
seed_nodes = [0, 1]: Initial spreaders, representing the nodes initially selected to spread the
rumor.
max_steps = 100: Maximum number of steps for the simulation.

Running the Rumor Spreading Model:


final_node_states = rumor_spreading_model(G, p_transmission, seed_nodes, max_steps):
Runs the rumor spreading model on the generated network with the specified parameters.

Plotting the Final State of the Network:


It visualizes the final state of the network after the rumor spreading simulation, with spreaders
shown in red and ignorant individuals shown in blue.

9.5. PARAMETERS :

1. Probability of Transmission (p_transmission):

Represents the likelihood that a spreader transmits the rumor to an ignorant individual during
an interaction. In this example, it's set to 0.1, meaning each spreader has a 10% chance of
transmitting the rumor during an interaction.

2. Seed Nodes (seed_nodes):

Initial spreaders selected to start spreading the rumor in the network. In this example, nodes
0 and 1 are chosen as seed nodes.

58
Network Science Practical (CS-801) 59

3. Maximum Steps (max_steps):

Defines the maximum number of steps for the simulation. Once this limit is reached or no
more individuals become spreaders, the simulation stops. In this example, it's set to 100.

OUTPUT :

1. WHEN :

number of nodes = 100


p_transmission = 0.1
seed_nodes = [0, 1]
max_steps = 100

Fig 9.1. : Final state of rumor spreading

2. WHEN :

number of nodes = 50
p_transmission = 0.1
seed_nodes = [0, 1]
max_steps = 100

Fig 9.2. : Final state of rumor spreading

59
Network Science Practical (CS-801) 60

9.6. FREQUENTLY ASKED QUESTIONS (FAQS) -:

Q1: What is a rumor spreading model in network science?


Ans: A rumor spreading model is a type of dynamic process that simulates how rumors or
information propagate through a network of interconnected nodes over time.

Q2: How does a basic rumor spreading model work?


Ans: In a basic rumor spreading model, nodes in the network can be in one of two states:
"ignorant" (I) or "spreaders" (S). Spreaders transmit the rumor to ignorant nodes with a
certain probability per time step.

Q3: What are some variations of rumor spreading models?


Ans: Variations of rumor spreading models include models with multiple states (such as
"ignorant," "spreaders," and "stiflers" who no longer spread the rumor), models with
different transmission probabilities based on node characteristics, and models
incorporating network dynamics.

Q4: How can rumor spreading models be implemented computationally?


Ans: Rumor spreading models can be implemented computationally using agent-based
modeling techniques, where each node in the network is represented as an agent with
defined behaviors and rules for spreading the rumor.

Q5: What insights can be gained from studying rumor spreading models?
Ans: Studying rumor spreading models can provide insights into the dynamics of
information dissemination, the impact of network structure on rumor propagation,
strategies to control or mitigate the spread of rumors, and the role of influential nodes
in accelerating or inhibiting spreading.

60
Network Science Practical (CS-801) 61

PRACTICAL NO – 10 (A)

10.1. Aim: Use of diffusion of innovation theory for determining factors


affecting a particular dataset.

10.2. Theory :

The diffusion of innovation theory, proposed by Everett Rogers, provides a framework for
understanding how new ideas, products, or technologies spread and are adopted within a
population over time. This theory can be applied to determine factors affecting a particular
dataset by examining how various characteristics of the innovation and the social system
influence its adoption. Here's how you can use the diffusion of innovation theory to analyze
factors affecting a dataset:

UNDERSTANDING DIFFUSION OF INNOVATION THEORY :

Innovation Attributes:

• Relative Advantage: The degree to which an innovation is perceived as better than


the idea it supersedes.

• Compatibility: The extent to which an innovation is consistent with existing values,


experiences, and needs of potential adopters.

• Complexity: The degree to which an innovation is perceived as difficult to understand


or use.

• Trialability: The ability to experiment with the innovation on a limited basis before
making a full commitment.

• Observability: The extent to which the results of an innovation are visible to others.

Adoption Process:

• Knowledge: Individuals become aware of an innovation and gain information about


its features and benefits.

• Persuasion: Individuals form attitudes toward the innovation and weigh its advantages
and disadvantages.

• Decision: Individuals engage in activities that lead to adoption or rejection of the


innovation.

61
Network Science Practical (CS-801) 62

• Implementation: Individuals put the innovation into use, potentially modifying it to


fit their needs.

• Confirmation: Individuals evaluate the outcomes of their adoption decision and may
reinforce or reverse it.

10.3. APPLYING DIFFUSION OF INNOVATION THEORY TO


DATASET ANALYSIS :

Identify the Innovation:

Define the innovation or change represented by the dataset. This could be a new technology,
product, policy, or idea.

Analyze Innovation Attributes:

Examine the dataset's attributes in relation to the five innovation characteristics (relative
advantage, compatibility, complexity, trialability, observability).
Determine how these attributes influence the adoption and usage patterns observed in the
dataset.

Map Adoption Process:

Study the adoption process within the dataset.


Identify stages of awareness, persuasion, decision, implementation, and confirmation.
Look for patterns in the timing and sequence of adoption among different segments or groups
within the dataset.

Identify Influential Factors:

Analyze demographic, social, economic, and contextual factors that affect adoption within
the dataset.
Consider factors such as individual characteristics, social networks, organizational
influences, and external environment.

Model Adoption Dynamics:

Use mathematical models or computational simulations to analyze and predict adoption


patterns based on diffusion theory.
Fit diffusion models to the dataset to estimate parameters such as the rate of adoption, market
saturation, and adopter categories (innovators, early adopters, early majority, late majority,
laggards).

Validate and Interpret Findings:

Validate findings through empirical analysis, surveys, interviews, or experiments.


Interpret findings to identify key factors driving or inhibiting adoption within the dataset.

62
Network Science Practical (CS-801) 63

10.4. Example Application:


For example, suppose you have a dataset tracking the adoption of renewable energy
technologies in different regions. You could apply diffusion of innovation theory to analyze
how the relative advantage, compatibility with existing infrastructure, complexity of
installation, trialability through pilot projects, and observability of benefits influence
adoption rates across various demographic, economic, and regulatory contexts.
By systematically applying diffusion of innovation theory to dataset analysis, you can gain
insights into the factors shaping adoption patterns and inform strategies for promoting
innovation and change within the studied population or domain.

63
Network Science Practical (CS-801) 64

10.5. FREQUENTLY ASKED QUESTIONS (FAQS) -:

Q1: What is the diffusion of innovation theory?


Ans: The diffusion of innovation theory is a framework that explains how new ideas,
products, or technologies spread and are adopted within a population over time,
characterized by the adoption curve comprising innovators, early adopters, early
majority, late majority, and laggards.

Q2: How can the diffusion of innovation theory be applied to determine factors
affecting a particular dataset?
Ans: The diffusion of innovation theory can be applied by analyzing the adoption patterns
within the dataset, identifying which factors influence the rate and extent of adoption,
and categorizing adopters based on their characteristics and behavior.

Q3: What are the key factors considered in the diffusion of innovation theory?
Ans: Key factors in the diffusion of innovation theory include the perceived relative
advantage of the innovation, compatibility with existing norms and values, complexity
or ease of understanding, trialability or observability, and the presence of opinion
leaders or influencers.

Q4: How can the adoption curve from the diffusion of innovation theory help analyze
the dataset?
Ans: The adoption curve helps in segmenting the dataset based on the timing and rate of
adoption, allowing for the identification of early adopters who may exhibit different
behaviors or preferences compared to late adopters.

Q5: What insights can be gained from applying the diffusion of innovation theory to
a dataset?
Ans: Applying the diffusion of innovation theory can provide insights into the factors driving
adoption or resistance to change within the dataset, inform targeted strategies for
promoting adoption, and aid in predicting future trends or patterns of adoption.

64
Network Science Practical (CS-801) 65

PRACTICAL NO – 10 (B)

10(b).1. Aim: Finding most influencing node in a network using centrality


and closeness measure.

10.2. Theory :

Degree Centrality:
Nodes with high degree centrality are well-connected to other nodes in the network.
They play a central role in the network and have the potential to reach many other nodes
quickly.

Betweenness Centrality:
Nodes with high betweenness centrality act as bridges or intermediaries in the network.
They control the flow of information between different parts of the network and are crucial
for maintaining connectivity.

Closeness Centrality:
Nodes with high closeness centrality are close to all other nodes in the network in terms of
shortest path distance.
They can quickly access information from and spread information to other nodes in the
network.

10(b).3. CODE AND IMPLEMENTATION

65
Network Science Practical (CS-801) 66

In this code:

We first create or load the network graph G.

Then, we calculate three centrality measures: degree centrality, betweenness centrality, and
closeness centrality.

Next, we find the node with the highest centrality score for each measure using the max()
function and key parameter.

Finally, we print the most influencing node and its centrality score for each measure.

OUTPUT :

10(b).4. ATTRIBUTES USED :


Graph Attributes:
• G: The network graph representing the connections between nodes.

Centrality Measures:
• degree_centrality: Degree centrality values for each node in the network.
• betweenness_centrality: Betweenness centrality values for each node in the network.
• closeness_centrality: Closeness centrality values for each node in the network.

Most Influential Node:


• most_influential_node_degree: The node with the highest degree centrality score.
• most_influential_node_betweenness: The node with the highest betweenness
centrality score.
• most_influential_node_closeness: The node with the highest closeness centrality
score.

10(b).5. CONCLUSION :
By calculating and analyzing these centrality measures, we can identify the most
influential node in a network, which plays a critical role in information dissemination,
network connectivity, and overall network dynamics. These measures help us understand
the structure and function of the network and identify key nodes that may be targeted for
interventions.

66
Network Science Practical (CS-801) 67

10(b).6. FREQUENTLY ASKED QUESTIONS (FAQS) -:

Q1: What is centrality in the context of network analysis?


Ans: Centrality in network analysis refers to the measure of a node's importance or influence
within a network based on its structural position and connections to other nodes.

Q2: How does centrality help identify the most influencing node in a network?
Ans: Centrality measures such as degree centrality, betweenness centrality, and Eigenvector
centrality quantify different aspects of node importance, helping to identify nodes that
act as key connectors, intermediaries, or highly connected hubs.

Q3: What is closeness centrality, and how does it contribute to identifying influential
nodes?
Ans: Closeness centrality measures how close a node is to all other nodes in the network,
indicating its accessibility and potential influence on spreading information or influence
efficiently.

Q4: How are centrality and closeness measures calculated in network analysis?

Ans: Centrality measures like degree, betweenness, and Eigenvector centrality are
calculated based on the node's connections and their positions in the network, while
closeness centrality is calculated based on the average shortest path distance from a
node to all other nodes.

Q5: What can be inferred by identifying the most influencing node in a network?
Ans: Identifying the most influencing node can provide insights into key players, opinion
leaders, or critical points of control within the network, guiding strategies for
communication, resource allocation, or targeted interventions.

67

You might also like