0

This is a sample of my big graph:

enter image description here

And i want to remove the node "B" without affecting the interaction of other nodes:

enter image description here

I worked it with "R", "PgRouting","gephi" and "networkx". And I dont found an efficient way to do it. Any suggestion?

Community
  • 1
  • 1
derive111
  • 143
  • 2
  • 10

1 Answers1

1

Using R and the igraph package:

library(igraph)
g <- make_graph(~ B -- A:C:D, A-E, C-F, D-G)
plot(g)

enter image description here

node <- "B"
g_2 <- 
  g %>% 
  union(connect(make_ego_graph(g, 1, node)[[1]], 2)) %>% 
  delete_vertices(node)
plot(g_2)

enter image description here

Aurèle
  • 12,545
  • 1
  • 31
  • 49