Ask Your Question
1

How to find the graphs from the following collection whose adjacency spectral radius is maximum?

asked 2025-06-25 21:26:38 +0200

rewi gravatar image

updated 2025-06-26 01:37:34 +0200

Max Alekseyev gravatar image

.

for g in graphs.nauty_geng("8 -c"):
    if g.size()==10:
        A=g.adjacency_matrix().eigenvalues()
        A.sort()
        g.show()
        show(A)

I am trying to find those connected graph(s) having $8$ vertex and $10$ edges, having the highest eigenvalue among all the eigenvalues of the corresponding adjacency matrix of the graph. Bsically I am trying to find the graphs on $8$ vertices and having $10$ edges whose adjacency spectral radius is maximum among all the connected graphs on $8$ vertices and having $10$ edges.

edit retag flag offensive close merge delete

Comments

You don't need testing if g.size()==10 as you can provide the required number of edges directly to graphs.nauty_geng() - like

for g in graphs.nauty_geng("-c 8 10"): ...
Max Alekseyev gravatar imageMax Alekseyev ( 2025-06-26 01:40:25 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2025-06-26 01:56:03 +0200

Max Alekseyev gravatar image

You can do something like:

# compute maximum radius
max_radius = max( g.spectral_radius() for g in graphs.nauty_geng("-c 8 10") )

# get all graphs of interest as a list
my_graphs = [g for g in graphs.nauty_geng("-c 8 10") if g.spectral_radius() == max_radius]
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

1 follower

Stats

Asked: 2025-06-25 21:26:38 +0200

Seen: 31 times

Last updated: Jun 26