Ask Your Question
1

Bug in Graph.girth in 4.7.2 ?

asked 2012-01-20 06:50:42 +0100

joro gravatar image

updated 2023-01-10 00:01:09 +0100

tmonteil gravatar image

sage 4.7.2 incorrectly gives girth of 4 on this graph:

sage: H=Graph([(0, 1), (0, 3), (0, 4), (0, 5), (1, 2), (1, 3), (1, 4), (1, 6), (2, 5), (3, 4), (5, 6)])
sage: H.girth()
4

There is a cycle (0,1,3) and sage 4.3 and magma correctly return 3.

edit retag flag offensive close merge delete

Comments

I copied your code and Sage 4.6 returns 3.

G-Sage gravatar imageG-Sage ( 2012-01-21 22:04:14 +0100 )edit

3 Answers

Sort by ยป oldest newest most voted
2

answered 2012-01-25 06:30:09 +0100

Nathann gravatar image

This bug is now patch http://trac.sagemath.org/sage_trac/ti... !

It was a funny one. I wish there was a GOTO statement in Python ;-)

Nathann

edit flag offensive delete link more
1

answered 2012-01-25 06:05:06 +0100

Nathann gravatar image

Ahahaah. Ok, I see... Funny bug. I will post a patch soon :-)

Nathann

edit flag offensive delete link more
1

answered 2012-01-25 05:45:59 +0100

Nathann gravatar image

Well, here's what sage-5.0-beta1 has to say on the instance :-p

sage: H=Graph([(0, 1), (0, 3), (0, 4), (0, 5), (1, 2), (1, 3), (1, 4), (1, 6), (2, 5), (3, 4), (5, 6)])
sage: H.girth()
4
sage: H.is_triangle_free()
False

It should notice it is saying something stupid, only it does not. Sage is not a very bright student :-p

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-01-20 06:50:42 +0100

Seen: 577 times

Last updated: Jan 25 '12