I want to know how to merge overlapping edges when drawing an undirected graph with igraph.
Specifically, I want to display the two edges coming out from the nodes "2" and "3" together for the following figure that is displayed when the following code is executed.
At that time, I would like to make the thickness as many as the number of edges (in this case, 2) instead of just putting them together.
library ("igraph") g<-matrix (c ( 1,1,1,0, 1,2,2,1, 1,2,2,1, 0,1,1,1), nrow = 4, ncol = 4, byrow = TRUE) g<-graph.adjacency (g, mode = "undirected", diag = FALSE) plot (g)
When the following code was executed, it was possible to combine them into one, but it was not possible to make them as thick as the number of edges.
g<-simplify (g, remove.multiple = T)
We know that the edge thickness can be adjusted with edge.width when executing plot ().
plot (g, edge.width = value)
Thanks for your understanding.
Answer # 1
I was able to solve it by the following method. I apologize to you for a fuss over.
library (igraph) g<-graph_from_adjacency_matrix ( matrix (c ( 1,1,1,0, 1,2,2,1, 1,2,2,1, 0,1,1,1), nrow = 4, ncol = 4, byrow = TRUE), mode = "undirected", weighted = TRUE, diag = FALSE) ew<-abs (E (g) $weight) * 2 plot (g, edge.width = ew)
The points are as follows.
Use graph_from_adjacency_matrix () function.
Prepare "ew<-abs (E (g) $weight) * 2" to make the edge thickness the number of multiple sides.
Also, when outputting with plot (), describe with edge.width = ew.
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- python - you may need to restart the kernel to use updated packages error
- python 3x - typeerror: 'method' object is not subscriptable
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- xcode - pod install [!] no `podfile 'found in the project directory
- vuejs - [vuetify] unable to locate target [data-app] i want to unit test to avoid warning
- android studio - unresolved reference comes out in kotlin