I don't know anything about R language(syntax)
How can I delete all edges with weight=0 from the graph? For example all edges with 0 similarity 1
I don't know anything about R language(syntax)
How can I delete all edges with weight=0 from the graph? For example all edges with 0 similarity 1
Here's an example on how to delete edges between vertices with zero jaccard similarity:
library(igraph)
g <- make_ring(5) + edges(4,1,2,2)
par(mfrow = c(1,2))
plot(g)
(s <- similarity(g, method = "jaccard"))
idx <- which(s == 0, arr.ind = T)
g2 <- g - edges(as.vector(t(idx)))
plot(g2)