Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to get a graph from a given symmetric matrix

using the following sage code, I have obtained the matrix u. I know that u may represent a graph whose adjacency matrix is u itself. Now can we draw the graph in sage so that we can visualise.

G=graphs.EmptyGraph()

G.add_edges([(1,2),(2,3),(3,4),(3,5),(2,5),(5,6)])

G.show()

b=G.adjacency_matrix()

show(b)

u=~b

show(u)