library(igraph)
# the neighborhood inclusion preorder of a star graph is complete
g <- make_star(5, "undirected")
P <- neighborhood_inclusion(g)
comparable_pairs(P)
# the same holds for threshold graphs
tg <- threshold_graph(50, 0.1)
P <- neighborhood_inclusion(tg)
comparable_pairs(P)
# standard centrality indices preserve neighborhood-inclusion
data("dbces11")
P <- neighborhood_inclusion(dbces11)
is_preserved(P, degree(dbces11))
is_preserved(P, closeness(dbces11))
is_preserved(P, betweenness(dbces11))
Run the code above in your browser using DataLab