From a complete graph of undirected weighted edges, here is the set of nearest neighbor connections:
From a complete graph of undirected weighted edges, here is the set of nearest neighbor connections:
In[]:=
nne={12,16,18,213,38,311,314,410,430,518,732,819,820,833,912,927,1228,1523,1524,1618,1632,1722,1726,1729,1921,2223,2531};
As often happens, these compose disconnected subgraphs:
In[]:=
nneg=Graph[nne,VertexLabelsPlaced[All,Above],GraphLayout{"PackingLayout""NestedGrid"}]
Out[]=
Using ConnectedComponents[] and the original graph, I find each of these subgraphs have nearest neighbor (higher order) connections:
In[]:=
sge=Annotation[#[[1]]#[[2]],EdgeStyle{Dashed,Thick}]&/@{{8,17},{26,5},{27,25},{6,10},{22,25}}
Out[]=
{817,265,2725,610,2225}
So here are the subgraphs, connected by dashed edges:
In[]:=
Graph[Join[nne,sge],VertexLabelsPlaced[All,Above],GraphLayout"RadialEmbedding"]
Out[]=
As a further enhancement, I’d like to have each of the subgraphs in a Frame or surrounded by some border -- and with all the edges intact. I don’t really care about the layout within the Frame or border, provided it’s legible. How to do this?