truss_edge: Cluster by k-truss

Description Usage Arguments Value References Examples

Description

Compute maximal k-truss each edge belongs to.

Usage

1

Arguments

graph

An undirected graph (must be igraph).

Value

Vector indicating the maximal k-truss that each edge belongs to (NA if none).

References

J. Cohen. Trusses: Cohesive subgraphs for social network analysis, 2008.

Examples

 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

alexperrone/truss documentation built on May 12, 2019, 2:31 a.m.