ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 06 Feb 2022 20:45:26 +0100coefficient of smallest power of $x$ in the adjacency characteristic polynomial of $g$ is $1$https://ask.sagemath.org/question/60970/coefficient-of-smallest-power-of-x-in-the-adjacency-characteristic-polynomial-of-g-is-1/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$.Sun, 06 Feb 2022 20:11:57 +0100https://ask.sagemath.org/question/60970/coefficient-of-smallest-power-of-x-in-the-adjacency-characteristic-polynomial-of-g-is-1/Answer by Max Alekseyev for <p>This shows connected graphs on 7 vertices
with nonsingular adjacency matrix.</p>
<pre><code>for g in graphs.nauty_geng('7 -c'):
if g.adjacency_matrix().determinant() == 0:
t = g.adjacency_matrix().charpoly()
g.show()
print(t)
</code></pre>
<p>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$.</p>
https://ask.sagemath.org/question/60970/coefficient-of-smallest-power-of-x-in-the-adjacency-characteristic-polynomial-of-g-is-1/?answer=60971#post-id-60971Just add `if t[t.ord()] == 1:` before `g.show()`Sun, 06 Feb 2022 20:38:07 +0100https://ask.sagemath.org/question/60970/coefficient-of-smallest-power-of-x-in-the-adjacency-characteristic-polynomial-of-g-is-1/?answer=60971#post-id-60971Comment by rewi for <p>Just add <code>if t[t.ord()] == 1:</code> before <code>g.show()</code></p>
https://ask.sagemath.org/question/60970/coefficient-of-smallest-power-of-x-in-the-adjacency-characteristic-polynomial-of-g-is-1/?comment=60973#post-id-60973Nice..thanksSun, 06 Feb 2022 20:45:26 +0100https://ask.sagemath.org/question/60970/coefficient-of-smallest-power-of-x-in-the-adjacency-characteristic-polynomial-of-g-is-1/?comment=60973#post-id-60973