# Manipulate graphs in 3D

Is it possible to Manipulate Graphs (e.g. a CompleteGraph[100, GraphLayout -> {"SpringElectricalEmbedding"}] in Mathematica 9 such that I can e.g. rotate it as 3D object and zoom in and out? If not, how else can one inspect large graphs without extra programming?

• Graphs are zoomable in PDFs: mathematica.stackexchange.com/questions/11673/… – C. E. Sep 7 '13 at 21:34
• If one right-clicks on the image, then a pop-up menu comes up. One option is convert to graphics. I am just not able to find what Mathematica command actually is used to do this so that one can program it in. Strange. Any one knows the actual command used by that menu to convert it to Graphics object? (I never used CompleteGraph before) – Nasser Sep 7 '13 at 22:10
• Related in 2D: Generating graphs interactively (GUI) – István Zachar Sep 8 '13 at 6:43

GraphPlot3D does what you want.

For instance, for a 10 node complete graph, you do this

GraphPlot3D@CompleteGraph[10, GraphLayout -> {"SpringElectricalEmbedding"}] which will give a 3D plot of the graph that you can manipulate in the usual way.

• It's good enough for my current purposes, but does not seem to scale to GraphPlot3D@CompleteGraph[100, GraphLayout -> {"SpringElectricalEmbedding"}] in terms of zooming :) ... Or does it? – Drux Sep 8 '13 at 17:40
• I wouldn't expect it to scale, because an $n$-node complete graph has $O(n^2)$ edges. A 100-node complete graph has such a high "density" of edges that any visualisation of the whole graph will be a featureless blob. – Stephen Luttrell Sep 9 '13 at 9:10
• If one had the ability to zoom in (as mentioned in the original question) it would not be a matter of visualizing a whole graph, but only the portion that fits on the screen ... – Drux Sep 9 '13 at 10:37
• But you do have the ability to zoom in - it's Ctrl (or Cmd) / left-click / drag (up/down). You can also pan with Shift / left-click / drag (up/down/left/right). For the 100-node complete graph this works OK, but it's not very informative! – Stephen Luttrell Sep 9 '13 at 13:40
• Now that actually answers my question, for I did not know about this key-combination. In my actual problem, I'm not dealing with a 100-node complete graph, just with graphs that would not fit on-screen entirely. So thx for the answer and clarification. – Drux Sep 10 '13 at 7:27

In Mathematica 10, we can use Graph3D:

Graph3D@RandomGraph[{20, 50}] 