Ask Your Question
2

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

asked 2018-08-27 22:23:37 -0500

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.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
3

answered 2018-08-28 04:51:34 -0500

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

edit flag offensive delete link more

Comments

@david Awesome, thanks.

Gordon gravatar imageGordon ( 2018-08-28 05:39:45 -0500 )edit
1

answered 2018-08-29 20:08:21 -0500

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).

edit flag offensive delete link more

Comments

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

slelievre gravatar imageslelievre ( 2018-09-12 06:16:21 -0500 )edit

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: 2018-08-27 22:23:37 -0500

Seen: 70 times

Last updated: Aug 27 '18