I believe I could do
Graph[VertexList[g], EdgeList[g], FilterRules[Options[g], Except[VertexCoordinates]]]
but I am not sure that this qualifies as either simple, performant or documented. I do not think I have seen such a use of Options
with Graph
in the documentation. Can I be sure that all options are extracted, and that they are extracted in a format that can be fed back to Graph
? Performance is not very good on large graphs with properties.
This is basically the same problem as removing EdgeWeights to make a graph unweighted, which I asked about in the past.
I am aware of some undocumented means to change graph options with good performance, e.g. the ideas shown here. But I am not really happy with these. Graph
expressions were clearly not meant to be accessed this way, so if I use such hacks, they might break in the next Mathematica version. If they break, I obviously can't complain to Wolfram Support.
Removing edge weights or vertex coordinates is one of the most basic tasks one might want to do with a network.
I would like to know what solution Wolfram recommends for these simple tasks. Then I can use it confidently without worrying about breakage, or incorrect results due to misuse.