For example, if there is a graph
g = CompleteGraph[5, VertexLabels -> {1 -> "v1", 2 -> "v2", 3 -> "v3", 4 -> "v4", 5 -> "v5"}]
How can I later get the vertex labels of this graph? Something like:
RetrieveVertexLabels[g]
{{1,"v1"}, {2,"v2"}, {3,"v3"}, {4,"v4"}, {5,"v5"}}
I know similar functions exist for VertexList
/ EdgeList
.
Thanks!
VertexLabels /. AbsoluteOptions[g, VertexLabels]
might work. $\endgroup$