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

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.

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

@david Awesome, thanks.

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

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