Title: | Graph/Network Analysis Based on L1 Centrality |
---|---|
Description: | Analyze graph/network data using L1 centrality and prestige. Functions for deriving global, local, and group L1 centrality/prestige are provided. Routines for visual inspection of a graph/network are also provided. Details are in Kang and Oh (2024a) <doi:10.48550/arXiv.2404.13233> and Kang and Oh (2024b) <doi:10.48550/arXiv.2408.12078>. |
Authors: | Seungwoo Kang [aut, cre] |
Maintainer: | Seungwoo Kang <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.3.1 |
Built: | 2025-02-07 02:40:26 UTC |
Source: | https://github.com/seungwoo-stat/l1centrality |
Computes the vertex multiplicities (weights) and the distance matrix of the group reduced graph. The group reduced graph is constructed by replacing a group of vertices in the original graph by a single ‘pseudo-vertex’.
group_reduce(g, nodes, eta, method) ## S3 method for class 'igraph' group_reduce(g, nodes, eta = NULL, method = c("minimum", "maximum", "average")) ## S3 method for class 'matrix' group_reduce(g, nodes, eta = NULL, method = "minimum")
group_reduce(g, nodes, eta, method) ## S3 method for class 'igraph' group_reduce(g, nodes, eta = NULL, method = c("minimum", "maximum", "average")) ## S3 method for class 'matrix' group_reduce(g, nodes, eta = NULL, method = "minimum")
g |
An |
nodes |
A vector of integers. Each integer indicates the index of the vertex. |
eta |
An optional nonnegative multiplicity (weight) vector for (vertex)
weighted networks. The sum of its components must be positive. If set to
|
method |
A character string. It specifies the method of setting the edge
weight between the pseudo-vertex and the other vertices. Note that the S3
method for the
|
The group reduced graph is constructed by replacing the vertices indicated in
the argument nodes
with a single ‘pseudo-vertex’. The
multiplicity (weight) of this new vertex is set to the sum of the
multiplicities of the vertices within nodes
. An edge from the
pseudo-vertex to any vertex that is not in nodes
, say
v, is created in the group reduced graph if
there is at least one edge from the vertices in nodes
to
v in the original graph. The weight of
this newly added edge is determined using one of the following methods:
Minimum method: The edge weight from the pseudo-vertex to
v is set to the minimum of the edge
weights of the edges between the vertices in nodes
to
v in the original graph.
Maximum method: The edge weight from the pseudo-vertex to
v is set to the maximum of the edge
weights of the edges between the vertices in nodes
to
v in the original graph.
Average method: The edge weight from the pseudo-vertex to
v is set to the average of the edge
weights of the edges between the vertices in nodes
to
v in the original graph.
An edge from v to the pseudo-vertex is set in a similar manner. For details, refer to Kang (2025).
A list consisting of three objects:
‘distmat’: A matrix representing the group reduced graph's distance matrix, where the first row and column correspond to the pseudo-vertex.
‘eta’: A vector of the group reduced graph's vertex multiplicity. The first element corresponds to the pseudo-vertex.
‘label’: A vector of the vertex names specified by nodes
.
Multiple edges (edges with the same head and tail vertices) are not allowed, because they make the edge weight setting procedure confusing.
S. Kang. Topics in Non-Euclidean Dimension Reduction. PhD thesis, Seoul National University, 2025.
L1cent()
for
L1 centrality/prestige.
L1centGROUP()
internally uses group_reduce()
.
# Group reduced graph of the 'Iron Man' series using the minimum method vertex_weight <- igraph::V(MCUmovie)$worldwidegross ironman_series <- c(1,3,7) reduced_graph <- group_reduce(MCUmovie, nodes = ironman_series, eta = vertex_weight) reduced_graph$distmat[1:3,1:3] reduced_graph$label # Multiplicity of the pseudo-vertex equals the sums of the replaced vertices' multiplicities reduced_graph$eta[1] == sum(vertex_weight[ironman_series])
# Group reduced graph of the 'Iron Man' series using the minimum method vertex_weight <- igraph::V(MCUmovie)$worldwidegross ironman_series <- c(1,3,7) reduced_graph <- group_reduce(MCUmovie, nodes = ironman_series, eta = vertex_weight) reduced_graph$distmat[1:3,1:3] reduced_graph$label # Multiplicity of the pseudo-vertex equals the sums of the replaced vertices' multiplicities reduced_graph$eta[1] == sum(vertex_weight[ironman_series])
Draws a Lorenz curve (the group heterogeneity plot) and computes the Gini coefficient (the group heterogeneity index).
Lorenz_plot(x, add = FALSE, ...) Gini(x)
Lorenz_plot(x, add = FALSE, ...) Gini(x)
x |
A numeric vector. |
add |
A logical value.
|
... |
Further graphical parameters supplied to the internal
|
Lorenz_plot()
draws a Lorenz curve (the group heterogeneity plot) and returns an
invisible copy of a Gini coefficient (the group heterogeneity index).
Gini()
returns a Gini coefficient.
S. Kang and H.-S. Oh. On a notion of graph centrality based on L1 data depth. arXiv preprint arXiv:2404.13233, 2024.
M. O. Lorenz. Methods of measuring the concentration of wealth. Publications of the American Statistical Association, 9(70):209–219, 1905.
Use the function with L1cent()
or L1centLOC()
, and compare
distributions of the centrality measurements across several groups and
graphs. Summary methods in this package come with the Gini coefficient.
vertex_weight <- igraph::V(MCUmovie)$worldwidegross cent <- L1cent(MCUmovie, eta=vertex_weight) gini <- Lorenz_plot(cent, asp=1) graphics::abline(0,1,lty=2) # group heterogeneity index gini gini == Gini(cent)
vertex_weight <- igraph::V(MCUmovie)$worldwidegross cent <- L1cent(MCUmovie, eta=vertex_weight) gini <- Lorenz_plot(cent, asp=1) graphics::abline(0,1,lty=2) # group heterogeneity index gini gini == Gini(cent)
Computes L1 centrality or
L1 prestige for each
vertex. The L1
centrality/prestige is a graph centrality/prestige measure defined for the
vertices of a graph. It is (roughly) defined by (1 minimum
multiplicity required for a selected vertex to become the median of the
graph). For directed graphs,
L1 centrality quantifies
the prominence of a vertex in making a choice and
L1 prestige quantifies
the prominence of a vertex in receiving a choice. For undirected graphs,
the two measures are identical.
L1cent(g, eta, mode) ## S3 method for class 'igraph' L1cent(g, eta = NULL, mode = c("centrality", "prestige")) ## S3 method for class 'matrix' L1cent(g, eta = NULL, mode = c("centrality", "prestige")) ## S3 method for class 'L1cent' print(x, ...)
L1cent(g, eta, mode) ## S3 method for class 'igraph' L1cent(g, eta = NULL, mode = c("centrality", "prestige")) ## S3 method for class 'matrix' L1cent(g, eta = NULL, mode = c("centrality", "prestige")) ## S3 method for class 'L1cent' print(x, ...)
g |
An |
eta |
An optional nonnegative multiplicity (weight) vector for (vertex)
weighted networks. The sum of its components must be positive. If set to
|
mode |
A character string. For an undirected graph, either choice gives the same result.
|
x |
An |
... |
Further arguments passed to or from other methods. This argument is ignored here. |
Suppose that g
is a (strongly) connected graph consisting of
n vertices
v1, ...,
vn
whose multiplicities (weights) are , respectively,
and
.
The centrality median vertex of this graph is the node minimizing the weighted sum of distances. That is, vi is the centrality median vertex if
is minimized, where denotes the geodesic (shortest path)
distance from
to
. See
igraph::distances()
for
algorithms for computing geodesic distances between vertices. When the
indices are swapped to in the display above, we call the
node minimizing the weighted sum as the prestige median vertex. When the
graph is undirected, the prestige median vertex and the centrality median
vertex coincide, and we call it the graph median, following Hakimi (1964).
The L1 centrality for an arbitrary node vi is defined as ‘one minus the minimum weight that is required to make it a centrality median vertex.’ This concept of centrality is closely related to the data depth for ranking multivariate data, as defined in Vardi and Zhang (2000). It turns out that the following formula computes the L1 centrality for the vertex vi:
where and
. The
L1 centrality of a vertex
is in
by the triangle inequality, and the centrality median
vertex has centrality 1. The
L1 prestige is defined
analogously, with the indices inside the distance function swapped.
For an undirected graph, since the distance
function is symmetric. Moreover,
L1 centrality and
L1 prestige measures concide.
For details, refer to Kang and Oh (2024a) for undirected graphs, and Kang and Oh (2024b) for directed graphs.
L1cent()
returns an object of class L1cent
. It is a
numeric vector whose length is equivalent to the number of vertices in the
graph g
. Each component of the vector is the
L1 centrality (if
mode = "centrality"
) or the
L1 prestige (if
mode = "prestige"
) of each vertex in the given graph.
print.L1cent()
prints
L1 centrality or
L1 prestige values and
returns them invisibly.
The function is valid only for connected graphs. If the graph is directed, it must be strongly connected.
S. L. Hakimi. Optimum locations of switching centers and the absolute centers and medians of a graph. Operations Research, 12(3):450–459, 1964.
S. Kang and H.-S. Oh. On a notion of graph centrality based on L1 data depth. arXiv preprint arXiv:2404.13233, 2024a.
S. Kang and H.-S. Oh. L1 prominence measures for directed graphs. arXiv preprint arXiv:2408.12078, 2024b.
Y. Vardi and C.-H. Zhang. The multivariate L1-median and associated data depth. Proceedings of the National Academy of Sciences, 97(4):1423–1426, 2000.
L1centLOC()
, L1centNB()
, L1centMDS()
, L1centEDGE()
,
L1centGROUP()
for
L1 centrality- or
prestige-based analysis. See L1centrality-package for each function's
support range.
igraph::betweenness()
, igraph::closeness()
,
igraph::degree()
, igraph::eigen_centrality()
for centrality measures.
Summary for a relevant summary method and Heterogeneity for drawing the Lorenz curve and computing the Gini coefficient.
# igraph object and distance matrix as an input lead to the same result vertex_weight <- igraph::V(MCUmovie)$worldwidegross cent_igraph <- L1cent(MCUmovie, eta=vertex_weight) cent_matrix <- L1cent(igraph::distances(MCUmovie), eta=vertex_weight) all(cent_igraph == cent_matrix) # Top 6 vertices with the highest L1 centrality utils::head(sort(cent_igraph, decreasing = TRUE))
# igraph object and distance matrix as an input lead to the same result vertex_weight <- igraph::V(MCUmovie)$worldwidegross cent_igraph <- L1cent(MCUmovie, eta=vertex_weight) cent_matrix <- L1cent(igraph::distances(MCUmovie), eta=vertex_weight) all(cent_igraph == cent_matrix) # Top 6 vertices with the highest L1 centrality utils::head(sort(cent_igraph, decreasing = TRUE))
Derives a multiscale edge representation. Each vertex is connected to its local median, which is found in its L1 centrality-based neighborhood.
L1centEDGE(g, eta, alpha) ## S3 method for class 'igraph' L1centEDGE(g, eta = NULL, alpha) ## S3 method for class 'matrix' L1centEDGE(g, eta = NULL, alpha) ## S3 method for class 'L1centEDGE' print(x, ...)
L1centEDGE(g, eta, alpha) ## S3 method for class 'igraph' L1centEDGE(g, eta = NULL, alpha) ## S3 method for class 'matrix' L1centEDGE(g, eta = NULL, alpha) ## S3 method for class 'L1centEDGE' print(x, ...)
g |
An |
eta |
An optional nonnegative multiplicity (weight) vector for (vertex)
weighted networks. The sum of its components must be positive. If set to
|
alpha |
A number or a numeric vector of locality levels. Values must be between 0 and 1. |
x |
An |
... |
Further arguments passed to or from other methods. This argument is ignored here. |
In a global perspective, any given undirected graph can be represented as a
star-shaped directed graph, with each vertex making a connection to the
median vertex. Based on this idea, an undirected graph can be represented as
a directed graph, with each vertex making a connection to the local
median vertex. The local median vertex of, say, , is defined as a
median vertex among the
L1 centrality-based
neighborhood of
. By varying the level of locality, the given graph
can be visually inspected at multiple scales. Refer to Kang and Oh (2024) for
details.
L1centEDGE()
returns an object of class L1centEDGE
. It
is a list of ‘edge lists’. The length of the list is equivalent to
the length of alpha
, and the names of the list are the values of
alpha
. The i
th component of the list is a 2-column matrix,
and each row defines one directed edge, i.e., it is an edge list. The
second column is the local (level alpha[i]
) median of the vertex at
the first column. There may be more than one edge from each vertex, since
there may be more than one local median.
print.L1centEDGE()
prints the edge lists and returns them invisibly.
The function is valid only for undirected and connected graphs.
S. Kang and H.-S. Oh. On a notion of graph centrality based on L1 data depth. arXiv preprint arXiv:2404.13233, 2024.
L1cent()
, L1centNB()
, L1centLOC()
. Using the output, one can
use igraph::graph_from_edgelist()
for creating an igraph
object.
See the example code below.
Summary for a relevant summary method.
library(igraph) MCU_edge <- L1centEDGE(MCUmovie, eta = V(MCUmovie)$worldwidegross, alpha = 5/32) graph <- graph_from_edgelist(MCU_edge[[1]], directed = TRUE) plot(graph)
library(igraph) MCU_edge <- L1centEDGE(MCUmovie, eta = V(MCUmovie)$worldwidegross, alpha = 5/32) graph <- graph_from_edgelist(MCU_edge[[1]], directed = TRUE) plot(graph)
Computes group L1 centrality or group L1 prestige for the specified group of vertices. For undirected graphs, the two measures are identical.
L1centGROUP(g, nodes, eta, mode, method) ## S3 method for class 'igraph' L1centGROUP( g, nodes, eta = NULL, mode = c("centrality", "prestige"), method = c("minimum", "maximum", "average") ) ## S3 method for class 'matrix' L1centGROUP( g, nodes, eta = NULL, mode = c("centrality", "prestige"), method = "minimum" ) ## S3 method for class 'L1centGROUP' print(x, ...)
L1centGROUP(g, nodes, eta, mode, method) ## S3 method for class 'igraph' L1centGROUP( g, nodes, eta = NULL, mode = c("centrality", "prestige"), method = c("minimum", "maximum", "average") ) ## S3 method for class 'matrix' L1centGROUP( g, nodes, eta = NULL, mode = c("centrality", "prestige"), method = "minimum" ) ## S3 method for class 'L1centGROUP' print(x, ...)
g |
An |
nodes |
A vector of integers. Each integer indicates the index of the vertex. |
eta |
An optional nonnegative multiplicity (weight) vector for (vertex)
weighted networks. The sum of its components must be positive. If set to
|
mode |
A character string. For an undirected graph, either choice gives the same result.
|
method |
A character string. It specifies the method of setting the edge
weight between the pseudo-vertex and the other vertices. Note that the S3
method for the
|
x |
An |
... |
Further arguments passed to or from other methods. This argument is ignored here. |
Given a group of vertices on a graph, we first construct a group reduced
graph by replacing the group of vertices by a single ‘pseudo-vertex’
(see group_reduce()
for the method of setting vertex multiplicities and
edge weights in the group reduced graph). The group
L1 centrality (prestige)
of this group is defined as the
L1 centrality (prestige)
of the pseudo-vertex in the group reduced graph.
L1centGROUP()
returns an object of class L1centGROUP
. It is a
numeric value of the group
L1 centrality (if
mode = "centrality"
) or the group
L1 prestige (if
mode = "prestige"
) of the specified group of vertices.
print.L1centGROUP()
prints group
L1 centrality or group
L1 prestige value and
returns it invisibly.
The function is valid only for connected graphs. If the graph is directed, it must be strongly connected. Multiple edges (edges with the same head and tail vertices) are not allowed, because they make the edge weight setting procedure confusing.
S. Kang. Topics in Non-Euclidean Dimension Reduction. PhD thesis, Seoul National University, 2025.
L1cent()
for L1
centrality/prestige, group_reduce()
for details on the minimum, maximum, and average methods.
# Group L1 centrality of the 'Spider-Man' series vertex_weight <- igraph::V(MCUmovie)$worldwidegross L1centGROUP(MCUmovie, nodes = c(16,23,27), eta = vertex_weight)
# Group L1 centrality of the 'Spider-Man' series vertex_weight <- igraph::V(MCUmovie)$worldwidegross L1centGROUP(MCUmovie, nodes = c(16,23,27), eta = vertex_weight)
Computes local L1
centrality or local L1
prestige at each alpha
level for every vertex. For undirected graphs,
the two measures are identical.
L1centLOC(g, eta, alpha, mode) ## S3 method for class 'igraph' L1centLOC(g, eta = NULL, alpha, mode = c("centrality", "prestige")) ## S3 method for class 'matrix' L1centLOC(g, eta = NULL, alpha, mode = c("centrality", "prestige")) ## S3 method for class 'L1centLOC' print(x, ...)
L1centLOC(g, eta, alpha, mode) ## S3 method for class 'igraph' L1centLOC(g, eta = NULL, alpha, mode = c("centrality", "prestige")) ## S3 method for class 'matrix' L1centLOC(g, eta = NULL, alpha, mode = c("centrality", "prestige")) ## S3 method for class 'L1centLOC' print(x, ...)
g |
An |
eta |
An optional nonnegative multiplicity (weight) vector for (vertex)
weighted networks. The sum of its components must be positive. If set to
|
alpha |
A number or a numeric vector of locality levels. Values must be between 0 and 1. |
mode |
A character string. For an undirected graph, either choice gives the same result.
|
x |
An |
... |
Further arguments passed to or from other methods. This argument is ignored here. |
Suppose that the given graph has n
vertices. We choose about vertices
(L1 centrality- or
L1 prestige-based
neighborhood) for each vertex (see
L1centNB()
), and compute the
L1 centrality or
L1 prestige of the vertex
conditioned on these vertices, i.e., derive the
L1 centrality or
L1 prestige locally. For
details, refer to Kang and Oh (2024a) for undirected graphs, and Kang and Oh
(2024b) for directed graphs.
L1centLOC()
returns an object of class L1centLOC
. It is
a list of numeric vectors. The length of the list is equivalent to the
length of alpha
, and the names of the list are the values of
alpha
. Each component of the list is a numeric vector whose length
is equivalent to the number of vertices in the graph g
.
Specifically, the i
th component of the list is a vector of local
L1 centrality at level
alpha[i]
for each vertex (if mode = "centrality"
) or local
L1 prestige at level
alpha[i]
for each vertex (if mode = "prestige"
).
print.L1centLOC()
prints local
L1 centrality or local
L1 prestige values at
each locality level alpha
and returns them invisibly.
The function is valid only for connected graphs. If the graph is directed, it must be strongly connected.
S. Kang and H.-S. Oh. On a notion of graph centrality based on L1 data depth. arXiv preprint arXiv:2404.13233, 2024a.
S. Kang and H.-S. Oh. L1 prominence measures for directed graphs. arXiv preprint arXiv:2408.12078, 2024b.
L1cent()
for
L1 centrality/prestige,
L1centNB()
for L1
centrality/prestige-based neighborhood.
Summary for a relevant summary method.
weight <- igraph::V(MCUmovie)$worldwidegross MCUmovie_cent <- L1cent(MCUmovie, eta = weight) MCUmovie_loc_cent <- L1centLOC(MCUmovie, eta = weight, alpha = 5/32) plot(MCUmovie_cent, MCUmovie_loc_cent[[1]], xlab="Global L1 centrality", ylab="Local L1 centrality (alpha = 5/32)", main="MCU movie network: global vs. local centrality") graphics::text(MCUmovie_cent, MCUmovie_loc_cent[[1]], igraph::V(MCUmovie)$name)
weight <- igraph::V(MCUmovie)$worldwidegross MCUmovie_cent <- L1cent(MCUmovie, eta = weight) MCUmovie_loc_cent <- L1centLOC(MCUmovie, eta = weight, alpha = 5/32) plot(MCUmovie_cent, MCUmovie_loc_cent[[1]], xlab="Global L1 centrality", ylab="Local L1 centrality (alpha = 5/32)", main="MCU movie network: global vs. local centrality") graphics::text(MCUmovie_cent, MCUmovie_loc_cent[[1]], igraph::V(MCUmovie)$name)
L1centMDS()
and plot.L1centMDS()
are used together to draw a
target plot, which is a target-shaped 2D plot that aids in the visual
inspection of an undirected graph using the
L1 centrality. See Kang
and Oh (2024) for a formal definition of a target plot.
L1centMDS(g, tol, maxiter, verbose) ## S3 method for class 'igraph' L1centMDS(g, tol = 1e-05, maxiter = 1000, verbose = TRUE) ## S3 method for class 'matrix' L1centMDS(g, tol = 1e-05, maxiter = 1000, verbose = TRUE) ## S3 method for class 'L1centMDS' plot(x, zoom = 1, main = NULL, ...) ## S3 method for class 'L1centMDS' print(x, ...)
L1centMDS(g, tol, maxiter, verbose) ## S3 method for class 'igraph' L1centMDS(g, tol = 1e-05, maxiter = 1000, verbose = TRUE) ## S3 method for class 'matrix' L1centMDS(g, tol = 1e-05, maxiter = 1000, verbose = TRUE) ## S3 method for class 'L1centMDS' plot(x, zoom = 1, main = NULL, ...) ## S3 method for class 'L1centMDS' print(x, ...)
g |
An |
tol |
A numerical tolerance. The gradient descent method terminates if
the relative magnitude of the gradient falls below |
maxiter |
A number of maximum iteration allowances for the gradient descent algorithm. By default set to 1000. |
verbose |
A boolean.
|
x |
An |
zoom |
A numerical value on how much to zoom-in the plot. By default set to 1 (no zoom). |
main |
Title of the plot. If set to |
... |
Further arguments passed to or from other methods.
|
Denoting the L1
centrality of vertex as
, a point representing that vertex is placed
on a concentric circle with radius
. Representing each vertex as
(in circular
coordinates), the values of
are derived using nonmetric
multidimensional scaling proposed in Kruskal (1964a,b). The initial
configuration is derived using classical multidimensional scaling
(
stats::cmdscale()
). A gradient descent algorithm is employed in deriving
optimal s.
L1centMDS()
returns an object of class L1centMDS
. It is a list
consisting of three vectors:
‘radius’: Radius of a point representing each vertex in the
target plot's circular coordinate system, i.e., for each vertex.
‘theta’: Angle (in radians) of a point representing each vertex in the target plot's circular coordinate system.
‘stress’: Stress measure defined in Kruskal (1964a).
plot.L1centMDS()
draws a target plot. Four concentric circles denote
the 1st to 4th quartiles of the radius, and the values of the
L1 centrality quartiles
are shown in red text. Note that red texts denote the
L1 centrality quartiles,
not radius quartiles.
print.L1centMDS()
prints number of iterations it took to fit a target plot.
The function L1centMDS()
is valid only for undirected and connected
graphs. Also, L1centMDS()
only considers graphs with equal vertex
multiplicities.
S. Kang and H.-S. Oh. On a notion of graph centrality based on L1 data depth. arXiv preprint arXiv:2404.13233, 2024.
J. B. Kruskal. Multidimensional scaling by optimizing goodness of fit to a nonmetric hypothesis. Psychometrika, 29(1):1–27, 1964a.
J. B. Kruskal. Nonmetric multidimensional scaling: a numerical method. Psychometrika, 29(2): 115–129, 1964b.
L1cent()
for
L1 centrality/prestige,
MASS::isoMDS()
and stats::cmdscale()
for multidimensional scaling
methods.
parameters <- L1centMDS(MCUmovie, verbose = FALSE) plot(parameters)
parameters <- L1centMDS(MCUmovie, verbose = FALSE) plot(parameters)
Derives L1 centrality- or L1 prestige-based neighborhood of each vertex. For undirected graphs, the two neighborhood are identical.
L1centNB(g, eta, mode) ## S3 method for class 'igraph' L1centNB(g, eta = NULL, mode = c("centrality", "prestige")) ## S3 method for class 'matrix' L1centNB(g, eta = NULL, mode = c("centrality", "prestige")) ## S3 method for class 'L1centNB' print(x, ...)
L1centNB(g, eta, mode) ## S3 method for class 'igraph' L1centNB(g, eta = NULL, mode = c("centrality", "prestige")) ## S3 method for class 'matrix' L1centNB(g, eta = NULL, mode = c("centrality", "prestige")) ## S3 method for class 'L1centNB' print(x, ...)
g |
An |
eta |
An optional nonnegative multiplicity (weight) vector for (vertex)
weighted networks. The sum of its components must be positive. If set to
|
mode |
A character string. For an undirected graph, either choice gives the same result.
|
x |
An |
... |
Further arguments passed to or from other methods. This argument is ignored here. |
For an undirected graph, if the graph is symmetrized (in a way defined in Kang and Oh (2024a)) w.r.t. a vertex v, vertex v becomes the graph median (Kang and Oh 2024a), i.e., v has L1 centrality 1. Based on this property, we define the L1 centrality-based neighborhood of vertex v as vertices that have large L1 centrality on the symmetrized graph w.r.t. vertex v.
For a directed graph, a vertex of interest, say v, is made to a centrality and prestige median vertex by the procedure described in Kang and Oh (2024b). We call the resulting graph as the modified graph w.r.t. v. L1 centrality (prestige) -based neighborhood of vertex v is a set of vertices that have large L1 centrality (prestige) on the modified graph w.r.t. vertex v.
L1centNB()
returns an object of class L1centNB
. It
is a list of numeric vectors. The length of the list is
equivalent to the number of vertices in the graph g
, and the names of the
list are vertex names. Each component of the list is a numeric vector whose
length is equivalent to the number of vertices in the graph g
.
Specifically, the i
th component of the list is a vector of the
L1 centrality of each
vertex, for the modified graph g
w.r.t. the i
th vertex (if mode = "centrality"
) or the
L1 prestige of each
vertex, for the modified graph g
w.r.t. the i
th vertex (if mode = "prestige"
).
print.L1centNB()
prints
L1 centrality or
L1 prestige values at
the modified graph w.r.t. each vertex and returns them invisibly.
The function is valid only for connected graphs. If the graph is directed, it must be strongly connected.
S. Kang and H.-S. Oh. On a notion of graph centrality based on L1 data depth. arXiv preprint arXiv:2404.13233, 2024a.
S. Kang and H.-S. Oh. L1 prominence measures for directed graphs. arXiv preprint arXiv:2408.12078, 2024b.
L1cent()
for
L1 centrality/prestige,
L1centLOC()
and L1centEDGE()
internally uses L1centNB()
.
Summary for a relevant summary method.
NB <- L1centNB(MCUmovie, eta = igraph::V(MCUmovie)$worldwidegross) # Top 6 L1 centrality-based neighbors of "Iron Man" utils::head(sort(NB$"Iron Man", decreasing = TRUE))
NB <- L1centNB(MCUmovie, eta = igraph::V(MCUmovie)$worldwidegross) # Top 6 L1 centrality-based neighbors of "Iron Man" utils::head(sort(NB$"Iron Man", decreasing = TRUE))
Network between 32 movies from the Marvel Cinematic Universe (MCU) that were released between 2008 and 2023. Each movie represents one vertex.
An edge between movies
i and
j is formed if there is at least one
cast in common. Denoting the set of casts of movie i as
Ai,
the weight of this edge is given as
(|AiAj|/|Ai
Aj|)-1,
where
denotes the cardinality of a set.
data(MCUmovie)
data(MCUmovie)
An undirected, connected, and (edge) weighted igraph
graph object with 32
vertices and 278 edges.
Vertex attributes:
‘name’: name of the movie. e.g., Guardians of the Galaxy Vol. 3.
‘worldwidegross’: worldwide gross in USD. Archived from IMDb on Nov. 3rd, 2023.
‘year’: release year of the movie.
Edge attribute: ‘weight’. Given as a dissimilarity between two vertices. See the description above.
IMDb: https://www.imdb.com
G. Choi and H.-S. Oh. Heavy-snow transform: A new method for graph signals. Manuscript, 2021.
S. Kang and H.-S. Oh. On a notion of graph centrality based on L1 data depth. arXiv preprint arXiv:2404.13233, 2024.
Network between 317 members of the Republic of Korea's 21st National Assembly (May 30th, 2020–May 29th, 2024). Each member of the assembly represents one vertex.
An edge between two members is formed if there is at least one cosponsored bill. The weight of this edge is given as 1/(number of cosponsored bills between two members) during the first 40 months of the 21st assembly (Jun. 2020–Sep. 2023).
data(rokassembly21)
data(rokassembly21)
An undirected, connected, and (edge) weighted igraph
graph
object with 317 vertices and 47,657 edges.
Vertex attributes:
‘name’: Pseudonyms of each member. They are in the format of the party's initial character, followed by a random number (e.g., D4). Each party's initial character is:
‘D’: Democratic Party of Korea.
‘P’: People Power Party.
‘J’: Justice Party.
‘O’: Others (Basic Income Party, Hope of Korea, The Progressive Party, Transition Korea).
‘party’: Factor with 7 levels. Denotes the political party of each member as of Sep. 2023. Note that independent members are assigned to their original party.
‘gender’: Factor with 2 levels. ‘M’ (male) or ‘F’ (female).
‘nelect’: Number of legislative terms in the assembly for each member. Ranges from 1 to 6.
‘district’: Indicates if each member is a district
representative (TRUE
) or a proportional representative
(FALSE
).
‘full’: Indicates if each member was in the assembly for the
first 40 months. TRUE
for the members in the office for all 40
months. Members who started their term via by-election, resigned, or lost
their seat for any reason during the 40 months are coded as FALSE
.
‘nbill’: Number of bills cosponsored by each member.
Edge attribute: ‘weight’. Given as a dissimilarity between two vertices. See the description above.
The National Assembly of the Republic of Korea
Bill information: https://likms.assembly.go.kr/bill/main.do
Member information: https://open.assembly.go.kr/portal/assm/search/memberSchPage.do
S. Kang and H.-S. Oh. On a notion of graph centrality based on L1 data depth. arXiv preprint arXiv:2404.13233, 2024.
summary()
methods for the classes in the L1centrality
package.
## S3 method for class 'L1cent' summary(object, ...) ## S3 method for class 'L1centLOC' summary(object, ...) ## S3 method for class 'L1centNB' summary(object, ...) ## S3 method for class 'L1centEDGE' summary(object, ...) ## S3 method for class 'summaryL1centrality' print(x, digits = max(3L, getOption("digits") - 3L), ...)
## S3 method for class 'L1cent' summary(object, ...) ## S3 method for class 'L1centLOC' summary(object, ...) ## S3 method for class 'L1centNB' summary(object, ...) ## S3 method for class 'L1centEDGE' summary(object, ...) ## S3 method for class 'summaryL1centrality' print(x, digits = max(3L, getOption("digits") - 3L), ...)
object |
An object used to select a method. |
... |
Further arguments passed to or from other methods. This argument is ignored here. |
x |
A |
digits |
Minimal number of significant digits, see |
For the methods for the class L1cent
, L1centLOC
, and L1centNB
,
object of class summaryL1centrality
is returned. It is a summary of the
prominence values with the five-number summary, mean, and the Gini
coefficient.
For the method for the class L1centEDGE
, number of local medians at each
locality level alpha
is returned.
S. Kang and H.-S. Oh. On a notion of graph centrality based on L1 data depth. arXiv preprint arXiv:2404.13233, 2024.
L1cent()
, L1centLOC()
, L1centNB()
, L1centEDGE()
, Heterogeneity.
summary(L1cent(MCUmovie)) summary(L1centLOC(MCUmovie, alpha = c(5/32, 10/32))) head(summary(L1centNB(MCUmovie))) summary(L1centEDGE(MCUmovie, alpha = c(5/32, 10/32)))
summary(L1cent(MCUmovie)) summary(L1centLOC(MCUmovie, alpha = c(5/32, 10/32))) head(summary(L1centNB(MCUmovie))) summary(L1centEDGE(MCUmovie, alpha = c(5/32, 10/32)))