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. I prefer to do these on loop in case of a network with a lot of nodes and edges.