I have a number of nodes, each with a numeric label and arbitrary connections between these nodes. When I plot the graph I would like nodes similar in value to be colocated as far as possible within the constraints of the arbitrary connections above. My first thought is to create extra connections between nodes sharing similar values, but if I then plot such a graph those connections will obscure the graph of arbitrary connections.
My question then becomes how can I make the edges in the latter set invisible, so the connections influence the layout of the former without obscuring the plot?
HighlightGraph[CompleteGraph[5], {Style[UndirectedEdge[3, 4], Opacity[0]]}]
$\endgroup$ – ktm Feb 27 '20 at 15:08edgestohide
is the the list of edges to be hidden in graphg
, you can useGraph[g, EdgeStyle->{Alternatives@@edgestohide ->Opacity[0]}]
; or, to remove those edges,Graph[EdgeDelete[g, edgestohide], VertexCoordinates->GraphEmbedding[g]]
$\endgroup$ – kglr Feb 28 '20 at 10:45