# Graph network plot

I recently installed Mathematica 12.2. I'm now getting this output when I want to generate a directed graph that has 2817 nodes and 30,670 edges. I used to generate the graph of these nodes without a problem but now I'm getting the output below and not a picture of the network.

g = Graph[edges, VertexLabels -> "Name", VertexLabels -> Automatic]


This is my output

• Some experimentation suggests that a plot will not be generated automatically by Graph if you have 10,000 or more vertices or edges. You could use GraphPlot@Graph[...] to force plotting. – MarcoB Jan 24 at 19:37
• Play with larger values for the sub-options "EdgeCountThreshold"  and "VertexCountThreshold" of the system option "GraphOptions" using SetSystemOptions? (See the defaults using SystemOptions["GraphOptions"]) – kglr Jan 24 at 21:15
• SystemOptions["GraphOptions"] Out[4]= {GraphOptions->{CacheResults->True,EdgeCountThreshold->10000,RenderingOrder->VertexFirst,VertexCountThreshold->1000}} – PRG Jan 24 at 21:24
• Looks like 10,000 edges and 1,000 vertexes are the threshold defaults. MacroB's forced plotting works well. – PRG Jan 24 at 21:25

Default values for the edge count and vertex count thresholds are 10000 and 1000, respectively:

SystemOptions["GraphOptions"]

 {"GraphOptions" -> {"CacheResults" -> True,
"EdgeCountThreshold" -> 10000, "RenderingOrder" -> "VertexFirst",
"VertexCountThreshold" -> 1000}}


With default settings a graph with, say, 1100 vertices and 11000 edges is not rendered:

RandomGraph[{1100, 11000}]


Increasing these thresholds gives the desired result:

SetSystemOptions["GraphOptions" -> {"EdgeCountThreshold" -> 20000,
"VertexCountThreshold" -> 2000}];

RandomGraph[{1100, 11000}]


• If getting a Graphics object (as opposed to a Graph object) as output is acceptable, you can also use the workaround suggested by MarcoB in comments (wrap Graph with GraphPlot) without having to change system option settings. – kglr Jan 24 at 21:41
• Many thanks to you both MarcoB and kglr for sharing your wisdom ... much appreciated and very helpful!! ... prg – PRG Jan 24 at 21:46