Appending graphs and attributes
Posted: 26 Mar 2015 01:44
I know it is possible to append a second graph to a first graph.
1st question: Is it possible to merge the attributes of the nodes and edges to the attributes of the first existing graph?
For example:
graph 1:
"Node A" has attribute X=12, Y=4
"Node B" has attribute X=1, Y=2
"Edge AB" has attribute E=1.02
graph2:
"Node A" has attribute X=4, Y=16
"Node B" has attribute X=1, Y=2
"Edge AB" has attribute E=1
"Edge BA" has attribute E=1
Merged graph has to be: (all nodes and edges, sum of attribute values)
"Node A" has attribute X=16, Y=20
"Node B" has attribute X=2, Y=4
"Edge AB" has attribute E=2.02
"Edge BA" has attribute E=1
2nd question: Is it possible to do this for 100 graphs?
Thanks in advance!
1st question: Is it possible to merge the attributes of the nodes and edges to the attributes of the first existing graph?
For example:
graph 1:
"Node A" has attribute X=12, Y=4
"Node B" has attribute X=1, Y=2
"Edge AB" has attribute E=1.02
graph2:
"Node A" has attribute X=4, Y=16
"Node B" has attribute X=1, Y=2
"Edge AB" has attribute E=1
"Edge BA" has attribute E=1
Merged graph has to be: (all nodes and edges, sum of attribute values)
"Node A" has attribute X=16, Y=20
"Node B" has attribute X=2, Y=4
"Edge AB" has attribute E=2.02
"Edge BA" has attribute E=1
2nd question: Is it possible to do this for 100 graphs?
Thanks in advance!