I'm trying to make a network plot in igraph that highlights certain important edges by coloring them differently than the others. For large graphs, they often get buried under the others. For example:
test <- barabasi.game(200,m=2)
E(test)$color <- "gray"
E(test)$color <- "red"
E(test) <- E(test)[order(E(test)$color)]
igraph plots the edges in the order they appear in the graph's edge list, so you are right, edges with higher IDs will be drawn on top of the edges with lower IDs. Unfortunately igraph does not provide an easy way to reorder the edges of the graph (although it has a function named
permute.vertices, which will allow you to permute the vertices), so the only way I can think of right now is that you need to construct another graph in which the edges are in the "right order".
make_graph ensures that the edges are stored in the graph exactly in the order you specify them, and I think so does
Another option (if you don't want to reconstruct the entire graph) is to plot the graph twice: first you plot the "not-so-important" edges and set the width of the important ones to zero, then you plot the important edges on top.
If you would like edge permutations to be supported in an upcoming version of igraph, please file a feature request on Github.