SlideShare a Scribd company logo
Network
05.
Lecturer: Dr. Reem Essameldin Ebrahim
Introduction to Social Networks
Based on CS224W Analysis of Networks Mining and Learning with Graphs: Stanford University
Copyright © Dr. Reem Essameldin 2023-2024
Properties
In this Lecture
Topics to be covered are:
Quantifying Networks
Key Network Properties
Social Networks Modeling
Copyright © Dr. Reem Essameldin 2023-2024
Quantifying Social Structure
You’ve learned the basic mechanics behind network analysis. Without a firm
understanding of those foundations, you are unable to construct the more
advanced concepts and their associated measures which are used by network
analysts to understand the social world.
Given a graph, we have two questions in hand:
What are the properties of the graph? And once
we will have that we start to ask, how could we
generate artificial graphs to mimic the real
graphs. This is why we generate artificial
graphs to understand and give a real sense of
what processes might be generating networks
that we see in real life (e.g. what is the good
generative model for how to form a friendships).
Q:howtoquantify andmodela network?
1
2
Copyright © Dr. Reem Essameldin 2023-2024
Quantifying Social Structure
There are some fundamental measurements that we can use to quantify the
structure of the networks.
Key Network Properties
Degree distribution: 𝑝(𝑘).
Path length: ℎ.
Clustering coefficient: 𝐶.
Connected components: 𝑠.
Certain of these characteristics are shared among
different types of networks.
Copyright © Dr. Reem Essameldin 2023-2024
Degree Distribution
𝑷(𝒌) is simply a histogram that tells how many nodes have a given degree.
Degree distribution 𝑷(𝒌) : Probability that a
randomly chosen node has degree 𝒌. Since
𝑷(𝒌) is a probability, it must be normalized:
𝑝𝑘
∞
𝑘=1 =1
For a network with 𝑵 nodes, the degree
distribution is the normalized histogram.
Where, 𝑁𝑘 = # nodes with degree 𝒌 .
𝑝 𝑘 =
𝑁𝑘
𝑁
TheMathematical Definition
Key
Network
Properties
Copyright © Dr. Reem Essameldin 2023-2024
Degree Distribution
For the histogram, on the x-axis we plot the degree, on the y-axis we plot the number the
count or the proportional of nodes having that degree. Note that: for the second case, we can
normalize the y-axis so that the height of the bars are summed up to 1 and this is a
distribution so that it’s a portion of nodes with a given degree or we can leave it to express
the count as shown in Figure.
1
1
2
2
For the given graph, to build the histogram we can count how many nodes
have a degree of one (𝒌 = 𝟏), and plot its bar.
Copyright © Dr. Reem Essameldin 2023-2024
One property of real world networks is that they have
what is called skewed degree distribution.
Test Yourself
For the given graphs, find the degree distribution and the corresponding histograms.
Solution:
Copyright © Dr. Reem Essameldin 2023-2024
4
3
2 1
a)
b)
Test Yourself
For the given graphs, find the degree distribution and the corresponding histograms.
Solution:
Copyright © Dr. Reem Essameldin 2023-2024
4
3
2 1
a)
b)
𝑁 = 4, then 𝑃1 = 1/4 , 𝑃2 = 2/4 = 1/2, 𝑃3 = 1/4, 𝑃4 = 0.
E𝑎𝑐ℎ 𝑛𝑜𝑑𝑒 ℎ𝑎𝑠 𝑡ℎ𝑒 𝑠𝑎𝑚𝑒 𝑑𝑒𝑔𝑟𝑒𝑒 𝑘 = 2.
Paths in a Graph
How many edges are between different pairs of nodes.
A path is a sequence of nodes in which each
node is linked to the next one. A path between
nodes 𝑖0 and 𝑖𝑛 is an ordered list of 𝑛 links
𝑃𝑛 = (𝑖0, 𝑖1), (𝑖1, 𝑖2), (𝑖2, 𝑖3) … . , (𝑖𝑛−1, 𝑖𝑛)
Note that:
Path can intersect itself and pass through the
same edge multiple times e.g.: ACBDCDEG
In a directed graph a path can only follow the
direction of the “arrow”
TheMathematical Definition
Key
Network
Properties
Copyright © Dr. Reem Essameldin 2023-2024
The Shortest Path
We are not interested in the general path, but in the shortest path (𝒉)that the least number of
hubs/edges to get from one node to the other. We can quantify the distance between a pair of
nodes as the distance between the shortest path between that pair.
Undirected Directed
We have to
traverse 2 edges to
get from B to D this
is the minimum # of
edge we have to
traverse to go from
B to D. We can go
through A but that
is longer.
If the graph is disconnected then there is no
shortest path between X and A because
there is no connection for us to traverse.
In directed graph the idea is the same but the path must
follow the edge direction. Thus, in undirected graphs
distances are symmetric while in directed graphs
distances are not symmetric. E.g. ℎ𝐵,𝐷=2 but ℎ𝐷,𝐵= ∞
because we cannot traverse in the opposite direction.
Q: what is the distance
of the node to itself?
Copyright © Dr. Reem Essameldin 2023-2024
Network Diameter
The network diameter is the largest distance in the network. This is the longest shortest
path that exists in the graph. This is what we do in graph theory, but for real data the
graph might be disconnected then the diameter would be infinite so what we generally
do is to quantify the network by its average shortest path length.
Copyright © Dr. Reem Essameldin 2023-2024
AverageShortestPath
where basically we will go over all pairs of nodes and asking what is the average
shortest path between all pairs of nodes. Here I how we could compute it:
ℎ =
1
2 𝐸𝑚𝑎𝑥
ℎ𝑖𝑗
𝑖,𝑗≠𝑖
This is the normalization factor. The
reason we put Emax here is basically as
we can ask what is the possible # of
pairs in a network
we go over all pairs 𝑖𝑗 where 𝑖 ≠ 𝑗 , ℎ𝑖𝑗is the length of the
shortest path, the total number of possible edges in the
network (sum of overall pairs of nodes).
Where ℎ𝑖𝑗 is the distance from node 𝑖 to node 𝑗. 𝐸𝑚𝑎𝑥 is
max number of edges (total number of node pairs) =
𝑛(𝑛 − 1)/2
Example
Copyright © Dr. Reem Essameldin 2023-2024
Clustering coefficient: C
This quantity a real application of social networks analysis. The way we define
this quantity is to ask do edges cluster in the network. what do we mean by
clustering is do edges appear more densely in certain part of the network or are
there social communities exist in the network?.
The way we can quantity this mathematically is to say
what proportion of one’s neighbors are connected
among themselves. For a node 𝑖 with degree 𝑘𝑖 the
local clustering coefficient is defined as:
𝐶𝑖 =
2 𝑒𝑖
𝑘𝑖(𝑘𝑖 − 1)
TheMathematicalDefinition
Key
Network
Properties
Copyright © Dr. Reem Essameldin 2023-2024
𝑒𝑖represents the number of links between the 𝑘𝑖 neighbors of
node 𝑖. 𝐶𝑖= 0 if none of the neighbors of node 𝑖 link to each
other. 𝐶𝑖= 1 if the neighbors of node 𝑖 form a complete graph
(i.e., they all link to each other).
𝐶𝑖 ∈ [0, 1]
Clustering coefficient: C
𝐶𝑖 is the probability that two neighbors of a node link to each other. So for every
node we ask what fraction of your friends are also friends with themselves. In
social networks this is known as social triadic closure because it says if two of us
are friends and you have another friend there then we will likely to be friends as
well. Then you are likely to be friend with someone if you have common friends in
between.
What we see in social networks is that social networks
have a high clustering coefficient, people tends to
group to in a connected dense communities where
there is a lot of friendships between this set of people.
Key
Network
Properties
Copyright © Dr. Reem Essameldin 2023-2024
So this is we define clustering coefficient of a node and then how do we
quantify the network is by compuingt the average over all the nodes 𝑖.
Average clustering coefficient:
𝐶 =
1
𝑁
𝐶𝑖
𝑁
𝑖
Examples
What portion of 𝑖’s neighbors are connected? 𝐶𝑖 =
2 𝑒𝑖
𝑘𝑖(𝑘𝑖 − 1)
Q: if a node has a cluster
coeff = 0, is it must be a
bridge? Cycle
Copyright © Dr. Reem Essameldin 2023-2024
Q: what for A, G, F (degree 1 nodes) who
has no possibilities to have clusters? we
define it as zero or ignore it.
a)
b)
Connectivity
Is the size of the largest connected component, where any two vertices can be
joined by a path (Largest component = Giant component).
• Start from random node and perform
Breadth First Search (BFS).
• Label the nodes BFS visited.
• If all nodes are visited, the network is
connected.
• Otherwise find an unvisited node and
repeat BFS.
Key
Network
Properties
Copyright © Dr. Reem Essameldin 2023-2024
Howtofind connected components:
Note that: BFS algorithm is used to search a graph data
structure for a node that meets a set of criteria. It starts at
the root of the graph and visits all nodes at the current
depth level before moving on to the nodes at the next
depth level.
Connectivity
Is the size of the largest connected component, where any two vertices can be
joined by a path (Largest component = Giant component).
• Start from random node and perform
Breadth First Search (BFS).
• Label the nodes BFS visited.
• If all nodes are visited, the network is
connected.
• Otherwise find an unvisited node and
repeat BFS.
Key
Network
Properties
Copyright © Dr. Reem Essameldin 2023-2024
Howtofind connected components:
Note that: BFS algorithm is used to search a graph data
structure for a node that meets a set of criteria. It starts at
the root of the graph and visits all nodes at the current
depth level before moving on to the nodes at the next
depth level.
Social Networks Modeling
Therandomgraphmodel
A network or graph is known as a
scale-free network whose degree
distribution follows a power law, at
least asymptotically. Examples of
scale-free networks are:
• Barabási Albert model (BAM)
• Bianconi–Barabási model (BBM).
Various models of random graphs
have been proposed for the social
network such as:
• Erdos–Renyi model
• Small-world model (SWM)
• Preferential attachment model
• Forest-fire model
Social networks can be represented and measured by
using two basic mathematical models
Thescale-free graphmodel
Copyright © Dr. Reem Essameldin 2023-2024

More Related Content

Similar to Lecture 5 - Qunatifying a Network.pdf

Community detection in social networks[1]
Community detection in social networks[1]Community detection in social networks[1]
Community detection in social networks[1]
sdnumaygmailcom
 
Mathematics Research Paper - Mathematics of Computer Networking - Final Draft
Mathematics Research Paper - Mathematics of Computer Networking - Final DraftMathematics Research Paper - Mathematics of Computer Networking - Final Draft
Mathematics Research Paper - Mathematics of Computer Networking - Final Draft
AlexanderCominsky
 
ICPSR - Complex Systems Models in the Social Sciences - Lecture 3 - Professor...
ICPSR - Complex Systems Models in the Social Sciences - Lecture 3 - Professor...ICPSR - Complex Systems Models in the Social Sciences - Lecture 3 - Professor...
ICPSR - Complex Systems Models in the Social Sciences - Lecture 3 - Professor...
Daniel Katz
 
MODELING SOCIAL GAUSS-MARKOV MOBILITY FOR OPPORTUNISTIC NETWORK
MODELING SOCIAL GAUSS-MARKOV MOBILITY FOR OPPORTUNISTIC NETWORK MODELING SOCIAL GAUSS-MARKOV MOBILITY FOR OPPORTUNISTIC NETWORK
MODELING SOCIAL GAUSS-MARKOV MOBILITY FOR OPPORTUNISTIC NETWORK
csandit
 
DISTRIBUTION OF MAXIMAL CLIQUE SIZE UNDER THE WATTS-STROGATZ MODEL OF EVOLUTI...
DISTRIBUTION OF MAXIMAL CLIQUE SIZE UNDER THE WATTS-STROGATZ MODEL OF EVOLUTI...DISTRIBUTION OF MAXIMAL CLIQUE SIZE UNDER THE WATTS-STROGATZ MODEL OF EVOLUTI...
DISTRIBUTION OF MAXIMAL CLIQUE SIZE UNDER THE WATTS-STROGATZ MODEL OF EVOLUTI...
ijfcstjournal
 
Distribution of maximal clique size under
Distribution of maximal clique size underDistribution of maximal clique size under
Distribution of maximal clique size under
ijfcstjournal
 
Higher-order clustering coefficients at Purdue CSoI
Higher-order clustering coefficients at Purdue CSoIHigher-order clustering coefficients at Purdue CSoI
Higher-order clustering coefficients at Purdue CSoI
Austin Benson
 
A NEW GENERALIZATION OF EDGE OVERLAP TO WEIGHTED NETWORKS
A NEW GENERALIZATION OF EDGE OVERLAP TO WEIGHTED NETWORKSA NEW GENERALIZATION OF EDGE OVERLAP TO WEIGHTED NETWORKS
A NEW GENERALIZATION OF EDGE OVERLAP TO WEIGHTED NETWORKS
gerogepatton
 
A NEW GENERALIZATION OF EDGE OVERLAP TO WEIGHTED NETWORKS
A NEW GENERALIZATION OF EDGE OVERLAP TO WEIGHTED NETWORKSA NEW GENERALIZATION OF EDGE OVERLAP TO WEIGHTED NETWORKS
A NEW GENERALIZATION OF EDGE OVERLAP TO WEIGHTED NETWORKS
ijaia
 
Socialnetworkanalysis (Tin180 Com)
Socialnetworkanalysis (Tin180 Com)Socialnetworkanalysis (Tin180 Com)
Socialnetworkanalysis (Tin180 Com)
Tin180 VietNam
 
Exploratory social network analysis with pajek
Exploratory social network analysis with pajekExploratory social network analysis with pajek
Exploratory social network analysis with pajek
THomas Plotkowiak
 
Description Of A Graph
Description Of A GraphDescription Of A Graph
Description Of A Graph
Winstina Kennedy
 
08 Exponential Random Graph Models (ERGM)
08 Exponential Random Graph Models (ERGM)08 Exponential Random Graph Models (ERGM)
08 Exponential Random Graph Models (ERGM)
dnac
 
08 Exponential Random Graph Models (2016)
08 Exponential Random Graph Models (2016)08 Exponential Random Graph Models (2016)
08 Exponential Random Graph Models (2016)
Duke Network Analysis Center
 
Medicinal Applications of Quantum Computing
Medicinal Applications of Quantum ComputingMedicinal Applications of Quantum Computing
Medicinal Applications of Quantum Computing
bGeniusLLC
 
EVOLUTIONARY CENTRALITY AND MAXIMAL CLIQUES IN MOBILE SOCIAL NETWORKS
EVOLUTIONARY CENTRALITY AND MAXIMAL CLIQUES IN MOBILE SOCIAL NETWORKSEVOLUTIONARY CENTRALITY AND MAXIMAL CLIQUES IN MOBILE SOCIAL NETWORKS
EVOLUTIONARY CENTRALITY AND MAXIMAL CLIQUES IN MOBILE SOCIAL NETWORKS
ijcsit
 
Higher-order clustering coefficients
Higher-order clustering coefficientsHigher-order clustering coefficients
Higher-order clustering coefficients
Austin Benson
 
A gentle introduction to random and strategic networks
A gentle introduction to random and strategic networksA gentle introduction to random and strategic networks
A gentle introduction to random and strategic networks
GraphRM
 
Social Network Based Information Systems (Tin180 Com)
Social Network Based Information Systems (Tin180 Com)Social Network Based Information Systems (Tin180 Com)
Social Network Based Information Systems (Tin180 Com)
Tin180 VietNam
 
Deepwalk vs Node2vec
Deepwalk vs Node2vecDeepwalk vs Node2vec
Deepwalk vs Node2vec
SiddhantVerma49
 

Similar to Lecture 5 - Qunatifying a Network.pdf (20)

Community detection in social networks[1]
Community detection in social networks[1]Community detection in social networks[1]
Community detection in social networks[1]
 
Mathematics Research Paper - Mathematics of Computer Networking - Final Draft
Mathematics Research Paper - Mathematics of Computer Networking - Final DraftMathematics Research Paper - Mathematics of Computer Networking - Final Draft
Mathematics Research Paper - Mathematics of Computer Networking - Final Draft
 
ICPSR - Complex Systems Models in the Social Sciences - Lecture 3 - Professor...
ICPSR - Complex Systems Models in the Social Sciences - Lecture 3 - Professor...ICPSR - Complex Systems Models in the Social Sciences - Lecture 3 - Professor...
ICPSR - Complex Systems Models in the Social Sciences - Lecture 3 - Professor...
 
MODELING SOCIAL GAUSS-MARKOV MOBILITY FOR OPPORTUNISTIC NETWORK
MODELING SOCIAL GAUSS-MARKOV MOBILITY FOR OPPORTUNISTIC NETWORK MODELING SOCIAL GAUSS-MARKOV MOBILITY FOR OPPORTUNISTIC NETWORK
MODELING SOCIAL GAUSS-MARKOV MOBILITY FOR OPPORTUNISTIC NETWORK
 
DISTRIBUTION OF MAXIMAL CLIQUE SIZE UNDER THE WATTS-STROGATZ MODEL OF EVOLUTI...
DISTRIBUTION OF MAXIMAL CLIQUE SIZE UNDER THE WATTS-STROGATZ MODEL OF EVOLUTI...DISTRIBUTION OF MAXIMAL CLIQUE SIZE UNDER THE WATTS-STROGATZ MODEL OF EVOLUTI...
DISTRIBUTION OF MAXIMAL CLIQUE SIZE UNDER THE WATTS-STROGATZ MODEL OF EVOLUTI...
 
Distribution of maximal clique size under
Distribution of maximal clique size underDistribution of maximal clique size under
Distribution of maximal clique size under
 
Higher-order clustering coefficients at Purdue CSoI
Higher-order clustering coefficients at Purdue CSoIHigher-order clustering coefficients at Purdue CSoI
Higher-order clustering coefficients at Purdue CSoI
 
A NEW GENERALIZATION OF EDGE OVERLAP TO WEIGHTED NETWORKS
A NEW GENERALIZATION OF EDGE OVERLAP TO WEIGHTED NETWORKSA NEW GENERALIZATION OF EDGE OVERLAP TO WEIGHTED NETWORKS
A NEW GENERALIZATION OF EDGE OVERLAP TO WEIGHTED NETWORKS
 
A NEW GENERALIZATION OF EDGE OVERLAP TO WEIGHTED NETWORKS
A NEW GENERALIZATION OF EDGE OVERLAP TO WEIGHTED NETWORKSA NEW GENERALIZATION OF EDGE OVERLAP TO WEIGHTED NETWORKS
A NEW GENERALIZATION OF EDGE OVERLAP TO WEIGHTED NETWORKS
 
Socialnetworkanalysis (Tin180 Com)
Socialnetworkanalysis (Tin180 Com)Socialnetworkanalysis (Tin180 Com)
Socialnetworkanalysis (Tin180 Com)
 
Exploratory social network analysis with pajek
Exploratory social network analysis with pajekExploratory social network analysis with pajek
Exploratory social network analysis with pajek
 
Description Of A Graph
Description Of A GraphDescription Of A Graph
Description Of A Graph
 
08 Exponential Random Graph Models (ERGM)
08 Exponential Random Graph Models (ERGM)08 Exponential Random Graph Models (ERGM)
08 Exponential Random Graph Models (ERGM)
 
08 Exponential Random Graph Models (2016)
08 Exponential Random Graph Models (2016)08 Exponential Random Graph Models (2016)
08 Exponential Random Graph Models (2016)
 
Medicinal Applications of Quantum Computing
Medicinal Applications of Quantum ComputingMedicinal Applications of Quantum Computing
Medicinal Applications of Quantum Computing
 
EVOLUTIONARY CENTRALITY AND MAXIMAL CLIQUES IN MOBILE SOCIAL NETWORKS
EVOLUTIONARY CENTRALITY AND MAXIMAL CLIQUES IN MOBILE SOCIAL NETWORKSEVOLUTIONARY CENTRALITY AND MAXIMAL CLIQUES IN MOBILE SOCIAL NETWORKS
EVOLUTIONARY CENTRALITY AND MAXIMAL CLIQUES IN MOBILE SOCIAL NETWORKS
 
Higher-order clustering coefficients
Higher-order clustering coefficientsHigher-order clustering coefficients
Higher-order clustering coefficients
 
A gentle introduction to random and strategic networks
A gentle introduction to random and strategic networksA gentle introduction to random and strategic networks
A gentle introduction to random and strategic networks
 
Social Network Based Information Systems (Tin180 Com)
Social Network Based Information Systems (Tin180 Com)Social Network Based Information Systems (Tin180 Com)
Social Network Based Information Systems (Tin180 Com)
 
Deepwalk vs Node2vec
Deepwalk vs Node2vecDeepwalk vs Node2vec
Deepwalk vs Node2vec
 

Recently uploaded

Mechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineeringMechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineering
sachin chaurasia
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
aryanpankaj78
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
nedcocy
 
Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
Dwarkadas J Sanghvi College of Engineering
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
Kamal Acharya
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
harshapolam10
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
sydezfe
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
Anant Corporation
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Transcat
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
Height and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdfHeight and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdf
q30122000
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
MadhavJungKarki
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...
um7474492
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
PreethaV16
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
Gino153088
 
P5 Working Drawings.pdf floor plan, civil
P5 Working Drawings.pdf floor plan, civilP5 Working Drawings.pdf floor plan, civil
P5 Working Drawings.pdf floor plan, civil
AnasAhmadNoor
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
upoux
 

Recently uploaded (20)

Mechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineeringMechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineering
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
 
Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
Height and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdfHeight and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdf
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
 
P5 Working Drawings.pdf floor plan, civil
P5 Working Drawings.pdf floor plan, civilP5 Working Drawings.pdf floor plan, civil
P5 Working Drawings.pdf floor plan, civil
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
 

Lecture 5 - Qunatifying a Network.pdf

  • 1. Network 05. Lecturer: Dr. Reem Essameldin Ebrahim Introduction to Social Networks Based on CS224W Analysis of Networks Mining and Learning with Graphs: Stanford University Copyright © Dr. Reem Essameldin 2023-2024 Properties
  • 2. In this Lecture Topics to be covered are: Quantifying Networks Key Network Properties Social Networks Modeling Copyright © Dr. Reem Essameldin 2023-2024
  • 3. Quantifying Social Structure You’ve learned the basic mechanics behind network analysis. Without a firm understanding of those foundations, you are unable to construct the more advanced concepts and their associated measures which are used by network analysts to understand the social world. Given a graph, we have two questions in hand: What are the properties of the graph? And once we will have that we start to ask, how could we generate artificial graphs to mimic the real graphs. This is why we generate artificial graphs to understand and give a real sense of what processes might be generating networks that we see in real life (e.g. what is the good generative model for how to form a friendships). Q:howtoquantify andmodela network? 1 2 Copyright © Dr. Reem Essameldin 2023-2024
  • 4. Quantifying Social Structure There are some fundamental measurements that we can use to quantify the structure of the networks. Key Network Properties Degree distribution: 𝑝(𝑘). Path length: ℎ. Clustering coefficient: 𝐶. Connected components: 𝑠. Certain of these characteristics are shared among different types of networks. Copyright © Dr. Reem Essameldin 2023-2024
  • 5. Degree Distribution 𝑷(𝒌) is simply a histogram that tells how many nodes have a given degree. Degree distribution 𝑷(𝒌) : Probability that a randomly chosen node has degree 𝒌. Since 𝑷(𝒌) is a probability, it must be normalized: 𝑝𝑘 ∞ 𝑘=1 =1 For a network with 𝑵 nodes, the degree distribution is the normalized histogram. Where, 𝑁𝑘 = # nodes with degree 𝒌 . 𝑝 𝑘 = 𝑁𝑘 𝑁 TheMathematical Definition Key Network Properties Copyright © Dr. Reem Essameldin 2023-2024
  • 6. Degree Distribution For the histogram, on the x-axis we plot the degree, on the y-axis we plot the number the count or the proportional of nodes having that degree. Note that: for the second case, we can normalize the y-axis so that the height of the bars are summed up to 1 and this is a distribution so that it’s a portion of nodes with a given degree or we can leave it to express the count as shown in Figure. 1 1 2 2 For the given graph, to build the histogram we can count how many nodes have a degree of one (𝒌 = 𝟏), and plot its bar. Copyright © Dr. Reem Essameldin 2023-2024 One property of real world networks is that they have what is called skewed degree distribution.
  • 7. Test Yourself For the given graphs, find the degree distribution and the corresponding histograms. Solution: Copyright © Dr. Reem Essameldin 2023-2024 4 3 2 1 a) b)
  • 8. Test Yourself For the given graphs, find the degree distribution and the corresponding histograms. Solution: Copyright © Dr. Reem Essameldin 2023-2024 4 3 2 1 a) b) 𝑁 = 4, then 𝑃1 = 1/4 , 𝑃2 = 2/4 = 1/2, 𝑃3 = 1/4, 𝑃4 = 0. E𝑎𝑐ℎ 𝑛𝑜𝑑𝑒 ℎ𝑎𝑠 𝑡ℎ𝑒 𝑠𝑎𝑚𝑒 𝑑𝑒𝑔𝑟𝑒𝑒 𝑘 = 2.
  • 9. Paths in a Graph How many edges are between different pairs of nodes. A path is a sequence of nodes in which each node is linked to the next one. A path between nodes 𝑖0 and 𝑖𝑛 is an ordered list of 𝑛 links 𝑃𝑛 = (𝑖0, 𝑖1), (𝑖1, 𝑖2), (𝑖2, 𝑖3) … . , (𝑖𝑛−1, 𝑖𝑛) Note that: Path can intersect itself and pass through the same edge multiple times e.g.: ACBDCDEG In a directed graph a path can only follow the direction of the “arrow” TheMathematical Definition Key Network Properties Copyright © Dr. Reem Essameldin 2023-2024
  • 10. The Shortest Path We are not interested in the general path, but in the shortest path (𝒉)that the least number of hubs/edges to get from one node to the other. We can quantify the distance between a pair of nodes as the distance between the shortest path between that pair. Undirected Directed We have to traverse 2 edges to get from B to D this is the minimum # of edge we have to traverse to go from B to D. We can go through A but that is longer. If the graph is disconnected then there is no shortest path between X and A because there is no connection for us to traverse. In directed graph the idea is the same but the path must follow the edge direction. Thus, in undirected graphs distances are symmetric while in directed graphs distances are not symmetric. E.g. ℎ𝐵,𝐷=2 but ℎ𝐷,𝐵= ∞ because we cannot traverse in the opposite direction. Q: what is the distance of the node to itself? Copyright © Dr. Reem Essameldin 2023-2024
  • 11. Network Diameter The network diameter is the largest distance in the network. This is the longest shortest path that exists in the graph. This is what we do in graph theory, but for real data the graph might be disconnected then the diameter would be infinite so what we generally do is to quantify the network by its average shortest path length. Copyright © Dr. Reem Essameldin 2023-2024 AverageShortestPath where basically we will go over all pairs of nodes and asking what is the average shortest path between all pairs of nodes. Here I how we could compute it: ℎ = 1 2 𝐸𝑚𝑎𝑥 ℎ𝑖𝑗 𝑖,𝑗≠𝑖 This is the normalization factor. The reason we put Emax here is basically as we can ask what is the possible # of pairs in a network we go over all pairs 𝑖𝑗 where 𝑖 ≠ 𝑗 , ℎ𝑖𝑗is the length of the shortest path, the total number of possible edges in the network (sum of overall pairs of nodes). Where ℎ𝑖𝑗 is the distance from node 𝑖 to node 𝑗. 𝐸𝑚𝑎𝑥 is max number of edges (total number of node pairs) = 𝑛(𝑛 − 1)/2
  • 12. Example Copyright © Dr. Reem Essameldin 2023-2024
  • 13. Clustering coefficient: C This quantity a real application of social networks analysis. The way we define this quantity is to ask do edges cluster in the network. what do we mean by clustering is do edges appear more densely in certain part of the network or are there social communities exist in the network?. The way we can quantity this mathematically is to say what proportion of one’s neighbors are connected among themselves. For a node 𝑖 with degree 𝑘𝑖 the local clustering coefficient is defined as: 𝐶𝑖 = 2 𝑒𝑖 𝑘𝑖(𝑘𝑖 − 1) TheMathematicalDefinition Key Network Properties Copyright © Dr. Reem Essameldin 2023-2024 𝑒𝑖represents the number of links between the 𝑘𝑖 neighbors of node 𝑖. 𝐶𝑖= 0 if none of the neighbors of node 𝑖 link to each other. 𝐶𝑖= 1 if the neighbors of node 𝑖 form a complete graph (i.e., they all link to each other). 𝐶𝑖 ∈ [0, 1]
  • 14. Clustering coefficient: C 𝐶𝑖 is the probability that two neighbors of a node link to each other. So for every node we ask what fraction of your friends are also friends with themselves. In social networks this is known as social triadic closure because it says if two of us are friends and you have another friend there then we will likely to be friends as well. Then you are likely to be friend with someone if you have common friends in between. What we see in social networks is that social networks have a high clustering coefficient, people tends to group to in a connected dense communities where there is a lot of friendships between this set of people. Key Network Properties Copyright © Dr. Reem Essameldin 2023-2024 So this is we define clustering coefficient of a node and then how do we quantify the network is by compuingt the average over all the nodes 𝑖. Average clustering coefficient: 𝐶 = 1 𝑁 𝐶𝑖 𝑁 𝑖
  • 15. Examples What portion of 𝑖’s neighbors are connected? 𝐶𝑖 = 2 𝑒𝑖 𝑘𝑖(𝑘𝑖 − 1) Q: if a node has a cluster coeff = 0, is it must be a bridge? Cycle Copyright © Dr. Reem Essameldin 2023-2024 Q: what for A, G, F (degree 1 nodes) who has no possibilities to have clusters? we define it as zero or ignore it. a) b)
  • 16. Connectivity Is the size of the largest connected component, where any two vertices can be joined by a path (Largest component = Giant component). • Start from random node and perform Breadth First Search (BFS). • Label the nodes BFS visited. • If all nodes are visited, the network is connected. • Otherwise find an unvisited node and repeat BFS. Key Network Properties Copyright © Dr. Reem Essameldin 2023-2024 Howtofind connected components: Note that: BFS algorithm is used to search a graph data structure for a node that meets a set of criteria. It starts at the root of the graph and visits all nodes at the current depth level before moving on to the nodes at the next depth level.
  • 17. Connectivity Is the size of the largest connected component, where any two vertices can be joined by a path (Largest component = Giant component). • Start from random node and perform Breadth First Search (BFS). • Label the nodes BFS visited. • If all nodes are visited, the network is connected. • Otherwise find an unvisited node and repeat BFS. Key Network Properties Copyright © Dr. Reem Essameldin 2023-2024 Howtofind connected components: Note that: BFS algorithm is used to search a graph data structure for a node that meets a set of criteria. It starts at the root of the graph and visits all nodes at the current depth level before moving on to the nodes at the next depth level.
  • 18. Social Networks Modeling Therandomgraphmodel A network or graph is known as a scale-free network whose degree distribution follows a power law, at least asymptotically. Examples of scale-free networks are: • Barabási Albert model (BAM) • Bianconi–Barabási model (BBM). Various models of random graphs have been proposed for the social network such as: • Erdos–Renyi model • Small-world model (SWM) • Preferential attachment model • Forest-fire model Social networks can be represented and measured by using two basic mathematical models Thescale-free graphmodel Copyright © Dr. Reem Essameldin 2023-2024