Ask Your Question
3

Why can't I find the spectral radius of a tree?

asked 6 years ago

Gordon gravatar image

If I create some connected graphs, and ask SageMath for their spectral radius, the command never returns (well, I have only let it run for a few minutes) if the target is a tree.

Here is a simple example:

 g = graphs.CompleteBipartiteGraph(1,3)
 print g.spectrum()
 print g.spectral_radius()

The only advertised requirement for the target is that it be strongly connected, but as it is a connected graph, this should automatically be satisfied.

Yes, I can work around by computing the spectrum and taking the biggest, but I'd still like to know why this does not work.

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
3

answered 6 years ago

There is a bug in this method for trees. Thank you for reporting the issue. This is now ticket #26148.

Preview: (hide)
link

Comments

@david Awesome, thanks.

Gordon gravatar imageGordon ( 6 years ago )
1

answered 6 years ago

vdelecroix gravatar image

Note that this function was completely broken for any bipartite graph... not only trees. We have fixed it in the development version and should work fine with next Sage version (will be 8.4).

Preview: (hide)
link

Comments

In fact it's already available in SageMath 8.4.beta4. One can try it on CoCalc.

slelievre gravatar imageslelievre ( 6 years ago )

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 6 years ago

Seen: 590 times

Last updated: Aug 28 '18