Skip to main content
Fix Title spelling while the q is on top
Link
cormullion
  • 24.3k
  • 4
  • 64
  • 136

Seperating Separating disconnected graph objects without losing vertex coordinate assignments

Source Link
LCook
  • 105
  • 5

Seperating disconnected graph objects without losing vertex coordinate assignments

Say I have a graph Gtest, which has multiple disconnected components. I found that I can isolate individual components while retaining vertex coordinate specifications if I use VertexDelete in the manner of:

VertexDelete[Gtest, ConnectedComponents[Gtest][[2]]]

Here assuming that Gtest has only two connected components. However, this seems like a ridiculous way of proceeding. Is there a one-liner that will let me make a list of graphs Glist = {g1, g2, g3, ...} where each $g_i$ corresponds to a particular connected graph in G? How can I do this while respecting my original vertex coordinate assignments for G?