Cross posted on StackExchange.
Hello everyone,
How can I retrieve the complete list of vertex (or edge) property names for a graph? I am looking for a way that is first robust (must work on any graph), then efficient (even for large graphs), and hopefully relatively simple. It should return even those property names which are assigned only to some of the vertices (or edges).
Any suggestions?
Unfortunately, the naïve method is very slow:
In[27]:= g = ExampleData[{"NetworkGraph", "CondensedMatterCollaborations2005"}];
In[28]:= Union @@ (PropertyList[{g, #}] & /@ VertexList[g]) // AbsoluteTiming
Out[28]= {0.39492, {"Name", VertexCoordinates, VertexShape, VertexShapeFunction, VertexSize, VertexStyle}}
In[29]:= Union @@ (PropertyList[{g, #}] & /@ EdgeList[g]) // AbsoluteTiming
Out[29]= {1.11729, {EdgeShapeFunction, EdgeStyle, EdgeWeight}}