Bug in graphs.WheelGraph(3).show().

25 views
Skip to first unread message

unread,
Jan 10, 2018, 10:37:46 PM1/10/18
to sage-support
sage: graphs.WheelGraph(3).is_isomorphic(graphs.CompleteGraph(3))
True
But  graphs.WheelGraph(3).show() 

show(Graph(graphs.WheelGraph(3).edges())) is OK.
So I do not know why.

Dima Pasechnik

unread,
Jan 11, 2018, 4:40:18 AM1/11/18
to sage-support
It is easy to see why the plot is off for n<4, by looking at the implementation:
sage: graphs.WheelGraph??

the plotting layout is computed in the 1st 6 lines of the implementation:

    pos_dict = {}
    pos_dict[0] = (0,0)
    for i in range(1,n):
        x = float(cos((pi/2) + ((2*pi)/(n-1))*(i-1)))
        y = float(sin((pi/2) + ((2*pi)/(n-1))*(i-1)))
        pos_dict[i] = (x,y)

and it's all good for n>3, but for n<4 it's certainly not.

I've opened https://trac.sagemath.org/ticket/24512 to fix this.
Reply all
Reply to author
Forward
0 new messages