当前位置:网站首页>Social network analysis -social network analysis
Social network analysis -social network analysis
2022-07-03 23:46:00 【Dark blue blue blue】
- K-cores and core decomposition
The purpose is to find the current graph(G) A maximal subset of (G’), And this subset (G’) Each of the node There are k Of the above numbers neighbour. ψ ( v ) = k \psi(v)=k ψ(v)=k Representative as G’ Of k As we grow older ,v The biggest one that can exist G’ Of k value .
Pseudo code :
Simply put, it means increasing step by step k, And in accordance with the k The value decreases step by step node( Delete node Give the corresponding node Add his own k value ), Until some k You can take all node All removed , It's over .
# Bottom-up core decomposition
G'=G
current=0
while G' There is also node when :
while true:
Delete all G' in neighbour The number is less than current Of node
if No delete node:
break
for G' Every existing node:
to update G Medium psi(v)=current
current++
- Forecast each node Of core ceiling -Estimating an upper bound of the core number
The goal is to find each node Of k(core number) Upper limit , And then use top-down Method . At the beginning, it was assumed that every node Of core number The upper limit is node Of neighbour Count , And then according to neighbour Order from small to large , Check each one one one by one node Satisfied neighbour The number of , Thus, the real upper limit is calculated through the formula .
Pseudo code :
Initial psiest=degree=neighbour Number
for(v in node and node.psiest in range(ki,ke)):
# there Z(v) In fact, it's those with v adjacent , But it doesn't count core number Of node, Because it has already been deleted
Z(v)= and v The adjacent node u, And psiest(u)<psiest(v)
# Confirm current psiest Is higher than the actual value
if |N(v)|-|Z(v)|<psiest(v), be :
for Z(v) Each of the Node(u), according to psiest Sort , From small to large , Serial number i from 0 Start :
f=max(|N(v)|-(i+1),psiest(u))
if f<psiest(v):
psiest(v)=f
- Top-down core decomposition
Top down decomposition
The overall idea is to put all node According to them degree Of upper bound Between partitions , Then update their degree, Then match the corresponding node, And use 1 To find the exact value .
Pseudo code :
for G All in node(v):
p(v)=0 //deposit
psiest(v)=v Of neighbour Count
k_e=degree_max (degree Refers to the number of neighbors )
k_i=max(k_min,k_e-step)
while true:
First use 2 Calculate all node Of psiest
V'=G Medium psiest stay k_i To k_e Between node( Include ki ke)
if |V'|>=k_i:
E'=V' stay G All of the corresponding edge
G'=(V',E'), And copy p(v) Value
Use 1 Calculated by the modified method in G' Each of them node Of psi, Use ki As the lower limit
for V' All in node(v):
if This node(v) Of psi I've calculated :
for v All of the neighbour(u):
p(u)=p(u)+1
else:
# If not assign It can only prove these node Of psi Smaller than the current range ( Because the first step was deleted node Will not assign psi Of )
psiest(v)=k_i-1
# to update ke and ki
k_e=k_i-1
k_i=max(k_min,k_E-step)
if ke-ki<0:
break
modified bottom up
G'=G
current=ki
while G' There is also node when :
while true:
Delete all G' in (neighbour Count +p(v)) Less than current Of node
if No delete node:
break
for G' Every existing node:
to update G Medium psi(v)=current
current++
- use core number To find outliers -core number to detect anomalies
In general core number and degree It's positively related , So it can be used node Of degree rank and core rank To calculate their r value ,r_c=core rank,r_d=degree rank.score=|log(r_c)-log(r_d)|
5. use core To detect the best communicators -Core numbers to detect top spreaders
First we need to simplify G, Simplified as G_C, be called degeneracy core, It's a simplified version G, All that is node Of core number All are G The largest of . And our best communicator is degeneracy core And eigenvector centrality(x(v)) Is used to calculate node How central is it .
eigenvector centrality
for G_c All of the node(v):
v Of centrality, That is to say x(v)=1/G_c in node The number of
Normalize(G_c)
for i in rang(1,max):
for G_c All in node:
Record the current x(v), Deposit in xlast(v) in
for G_c All in node(v):
for v All of the neighbour(v'):
# to update x(v') Value
x(v')+=xlast(v)
Normalize(G_c)
e=0
for G_c All in node(v):
e=e+|x(v)-xlast(v)|
if e<V_c The number of *error tolerance:
break
Normalize( In fact, that is L2 norm, Give Way x(v) Of l2 The sum of distances equals 1)
s=0
for G All in node(v):
s=s+x(v)^2
for G All in node(v):
x(v)=x(v)/sqrt(s)
Except calculation centrality, We can still use it SIR Model to calculate node How big is the impact on the surrounding . stay SIR In the model , Every node All belong to one of the following states S(susceptible- Can be infected ),I(infected- Infected ),R(recovered- Restored ),I node According to the infection rate beta infection S node, Then I will recover to R node.
Pseudo code :
The basic idea is to set a node yes I, Everything else is S, And then let I To infect others , Until there was no node yes I Stop when you're ready , Calculate the average number of infections per round
f(v)=0
for i in range(1,r+1):
for G In addition to v All of the node(v'):
s(v') Set to S # Can be infected
s(v) Set to I # Infected
f'=0
step=0
while G There is also a status of I Of node when :
cnt=0
for V All in node(v')
if v' yes I node:
Just put v' Change to R node
for v' All of the neighbour v''( repeatable ):
if v'' Status is S, And the random number is less than beta:
v'' Turn into I
cnt++
f'=f'+cnt
step=step+1
f(v)+=(f'/step)
f(v)=f(v)/r
there beta Generally speaking, it uses 1/ maximal eigen value.
边栏推荐
- Version rollback revert don't reset better reset must be forced
- Interpretation of corolla sub low configuration, three cylinder power configuration, CVT fuel saving and smooth, safety configuration is in place
- No qualifying bean of type ‘com. netflix. discovery. AbstractDiscoveryClientOptionalArgs<?>‘ available
- Is the controller a single instance or multiple instances? How to ensure the safety of concurrency
- How to make recv have a little temper?
- The upload experience version of uniapp wechat applet enters the blank page for the first time, and the page data can be seen only after it is refreshed again
- Yyds dry goods inventory [practical] simply encapsulate JS cycle with FP idea~
- Correlation analysis summary
- Docking Alipay process [pay in person, QR code Payment]
- Make small tip
猜你喜欢

Apple released a supplementary update to MacOS Catalina 10.15.5, which mainly fixes security vulnerabilities
![[MySQL] classification of multi table queries](/img/96/2e51ae8d52ea8184945e0540ce18f5.jpg)
[MySQL] classification of multi table queries

X Opencv feature point detection and matching

Bufferpool caching mechanism for executing SQL in MySQL

Tencent interview: can you pour water?

2022 chemical automation control instrument examination content and chemical automation control instrument simulation examination

Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?

Common mode interference of EMC
![[network security] what is emergency response? What indicators should you pay attention to in emergency response?](/img/ff/c733ffbb922760910ab09af3ae2886.jpg)
[network security] what is emergency response? What indicators should you pay attention to in emergency response?

2/14 (regular expression, sed streaming editor)
随机推荐
How can I get the Commission discount of stock trading account opening? Is it safe to open an account online
Selenium library 4.5.0 keyword explanation (I)
How to make recv have a little temper?
Maxwell equation and Euler formula - link
Current detection circuit - including op amp current scheme
2022 system integration project management engineer examination knowledge points: software development model
Correlation analysis summary
2022 free examination questions for hoisting machinery command and hoisting machinery command theory examination
Deep learning ----- using NN, CNN, RNN neural network to realize MNIST data set processing
China standard gas market prospect investment and development feasibility study report 2022-2028
[MySQL] sql99 syntax to realize multi table query
Gossip about redis source code 80
How to understand the gain bandwidth product operational amplifier gain
C # basic knowledge (1)
JDBC Technology
D26: the nearest number (translation + solution)
Iclr2022: how does AI recognize "things I haven't seen"?
Distributed transaction -- middleware of TCC -- selection / comparison
Op amp related - link
Yyds dry goods inventory [practical] simply encapsulate JS cycle with FP idea~