How to know what GraphLayout was used when Method set to Automatic

Using Rasterize to do a "visual" comparison with some suspects

grR = Rasterize@Graph[{1 -> 2, 2 -> 1}];

Select[{#, 
    Rasterize@
     Graph[{1 -> 2, 2 -> 1}, GraphLayout -> #]} & /@
  {"CircularEmbedding", 
   "SpiralEmbedding", "SpringEmbedding", "SpringElectricalEmbedding", 
   "HighDimensionalEmbedding", "LayeredDigraphEmbedding", 
   "LayeredEmbedding"}, #[[2]] === grR &]

enter image description here


I believe that GraphLayout -> Automatic typically resolves to one of the following:

  • For large graphs, the default is "SpringElectricalEmbedding".
  • Small undirected trees up to 49 vertices use "LayeredEmbedding". It looks like this:

    enter image description here

  • Small directed acyclic graphs up to 49 vertices use "LayeredDigraphEmbedding". It looks like this:

    enter image description here

This is based on experience. I have no references. You can compare with the images I included above to determine if any of the Layered... embeddings are being used. You can manually set a "SpringElectricalEmbedding" and see if anything changes to determine if that embedding was used.

If you have a graph which uses neither of these, let me know.