Question: Attributes in graphs and AddVertex

March 26 2011 djordan99 0
Maple 14

0

The AddVertex command (in GraphTheory) does not seem to copy any attributes that were set in the original graph.

with(GraphTheory):
G := CompleteGraph(5):
SetGraphAttribute(G,"graphAtt" = 1);
SetVertexAttribute(G,1,"vertexAtt" = 1);
SetEdgeAttribute(G,{1,2},"edgeAtt" = 1);
H := AddVertex(G,6):
GetGraphAttribute(H,"graphAtt");
                              FAIL
GetVertexAttribute(H,1,"vertexAtt");
                              FAIL
GetEdgeAttribute(H,{1,2},"edgeAtt");
                              FAIL

Of course, this also affects colors, e.g., from HighlightVertex, and vertex positions, from SetVertexPositions, since those are stored as attributes.

Does anyone know why the attributes aren't copied over?  Is this a feature that I don't understand the reasoning behind, or is it a bug?

Also, I read that the attributes are stored in a table as part of the GRAPHLN structure.  Is there a way to get direct access to that table?

Thanks

Please Wait...