Are they equivalent ?

20 views
Skip to first unread message

Henri Girard

unread,
Apr 1, 2018, 1:43:00 AM4/1/18
to sage-s...@googlegroups.com

I am surprise because graph is different it should n't because the adjacency matrix is the same ?


W=graphs.WheelGraph(4);W.show();W.adjacency_matrix ()

0111101111011110

H=Graph(W.adjacency_matrix ());H.show();H.adjacency_matrix ()

Jori Mäntysalo

unread,
Apr 1, 2018, 1:51:22 AM4/1/18
to sage-s...@googlegroups.com
On Sun, 1 Apr 2018, Henri Girard wrote:

> I am surprise because graph is different it should n't because the adjacency
> matrix is the same ?

They are:

sage: W = graphs.WheelGraph(4)
sage: H = Graph(W.adjacency_matrix ())
sage: W == H
True

However, for almost every built-in graph or graph family Sage also knows
some "nice" way to draw it. For other graphs it tries to found a "nice"
drawing by partly randomized algorithm.

You can also try

H.show(layout='planar')

--
Jori Mäntysalo

Henri Girard

unread,
Apr 1, 2018, 3:31:20 AM4/1/18
to sage-s...@googlegroups.com
Thank you... Planar do it
Reply all
Reply to author
Forward
0 new messages