Description Usage Arguments Value References Examples
Compute maximal k
-truss each edge belongs to.
1 | truss_edge(g)
|
graph |
An undirected graph (must be igraph). |
Vector indicating the maximal k
-truss that each edge belongs to (NA if none).
J. Cohen. Trusses: Cohesive subgraphs for social network analysis, 2008.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | require(igraph)
set.seed(1)
g <- sample_gnm(6, 9)
E(g)$truss <- truss_edge(g)
# Plot original graph.
fixed_layout <- layout_with_lgl(g)
plot(g, layout = fixed_layout) # original
# Plot graph with truss clustering.
E(g)$weight <- 1
E(g)$color <- "gray"
E(g)[which(E(g)$truss <= 3)]$color <- "blue"
E(g)[which(E(g)$truss <= 3)]$weight <- 3
plot(g, layout = fixed_layout, edge.width = E(g)$weight) # with truss
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.