Home > OS >  igraph: Add new nodes in the middle of each edge
igraph: Add new nodes in the middle of each edge

Time:12-17

I have a graph that each nodes and edges have their own attribute (for example, nodes have different elevation, and edges have different diameters and lengths).

Now, I want to add new nodes in the middle of each edge, and assign the mean elevation of the two connected nodes to pipe, to the new node. Add new nodes I prefer to do these on loop in case of a network with a lot of nodes and edges.

Here's enter image description here

  • Related