Ask Your Question
1

coefficient of smallest power of $x$ in the adjacency characteristic polynomial of $g$ is $1$

asked 2022-02-06 20:11:57 +0100

anonymous user

Anonymous

updated 2022-02-07 00:36:39 +0100

slelievre gravatar image

This shows connected graphs on 7 vertices with nonsingular adjacency matrix.

for g in graphs.nauty_geng('7 -c'):
    if g.adjacency_matrix().determinant() == 0:
        t = g.adjacency_matrix().charpoly()
        g.show()
        print(t)

Using the above code, how we can obtain only those graphs (if any) satisfying the following property: coefficient of smallest power of $x$ in the adjacency characteristic polynomial of $g$ is $1$.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-02-06 20:38:07 +0100

Max Alekseyev gravatar image

Just add if t[t.ord()] == 1: before g.show()

edit flag offensive delete link more

Comments

Nice..thanks

rewi gravatar imagerewi ( 2022-02-06 20:45:26 +0100 )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: 2022-02-06 20:11:57 +0100

Seen: 171 times

Last updated: Feb 07 '22