Ask Your Question

Revision history [back]

How to plot a sparse graph with small cycles ?

Hello,

I have a sparse graph which have few cycles which moreover are small compared to the size of the graph. In other words, my graph looks like a tree. Is there a better way than the default to plot it ?

My graph is precisely the giant component of an random Erdös-Renyi graph with parameter just above 1 as in:

sage: G = graphs.RandomGNP(1000, 1.3 / 1000)
sage: cc = G.connected_components_subgraphs()
sage: giant_comp = cc[0]

On my computer, the default picture has a lot of overlaps:

sage: giant_comp.plot(vertex_labels=False, vertex_size=10)

Vincent