Examples in Multiparadigm Data Science:
GlobalClusteringCoefficient
A simulation of information diffusion in a social network using density heat maps
to analyze connectivity and nearness in a small-world network.
GlobalClusteringCoefficient
efficiently calculates the connectivity of undirected graphs, directed graphs
and multigraphs from
SocialMediaData
, using
ColorData
and
Grid
for easy visual interpretation of the results.
Define a function to compute the
GlobalClusteringCoefficient
of a set of random graphs:
I
n
[
1
]
:
=
{
g
r
a
p
h
s
,
c
o
e
f
f
s
}
=
T
r
a
n
s
p
o
s
e
[
S
o
r
t
B
y
[
{
#
,
G
l
o
b
a
l
C
l
u
s
t
e
r
i
n
g
C
o
e
f
f
i
c
i
e
n
t
[
#
]
}
&
/
@
R
a
n
d
o
m
G
r
a
p
h
[
W
a
t
t
s
S
t
r
o
g
a
t
z
G
r
a
p
h
D
i
s
t
r
i
b
u
t
i
o
n
[
2
0
0
,
0
.
1
,
3
]
,
{
1
0
0
0
0
}
]
,
L
a
s
t
]
]
;
Create a heat map of selected graphs with respect to the coefficient values using
ColorData
and
Grid
:
I
n
[
2
]
:
=
m
i
n
=
M
i
n
[
c
o
e
f
f
s
]
;
m
a
x
=
M
a
x
[
c
o
e
f
f
s
]
;
n
f
=
N
e
a
r
e
s
t
[
c
o
e
f
f
s
g
r
a
p
h
s
]
;
v
a
l
u
e
s
=
R
a
n
g
e
[
m
i
n
,
m
a
x
,
(
m
a
x
-
m
i
n
)
/
(
4
^
2
-
1
)
]
;
G
r
i
d
[
P
a
r
t
i
t
i
o
n
[
M
a
p
[
S
e
t
P
r
o
p
e
r
t
y
[
F
i
r
s
t
[
n
f
[
#
]
]
1
,
{
V
e
r
t
e
x
S
t
y
l
e
D
i
r
e
c
t
i
v
e
[
W
h
i
t
e
,
E
d
g
e
F
o
r
m
[
W
h
i
t
e
]
]
,
E
d
g
e
S
t
y
l
e
W
h
i
t
e
,
B
a
c
k
g
r
o
u
n
d
C
o
l
o
r
D
a
t
a
[
{
"
S
o
l
a
r
C
o
l
o
r
s
"
,
"
R
e
v
e
r
s
e
d
"
}
,
R
e
s
c
a
l
e
[
#
,
{
m
i
n
,
m
a
x
}
]
]
,
I
m
a
g
e
S
i
z
e
{
1
0
0
,
1
0
0
}
}
]
&
,
v
a
l
u
e
s
]
,
4
]
]
O
u
t
[
2
]
=
Go Further:
Social Network Analysis »
Cluster Analysis »
Graphs & Networks »