So I used the following code on sagemath (https://sagecell.sagemath.org/). However, it gives me a "False" answer which doesn't make any sense to me because the Hoffman Singleton graph clearly contains a C5. Does anybody know why this is the case?
HS = graphs.HoffmanSingletonGraph()
X = graphs.CycleGraph(5)
X.is_subgraph(HS)
The difference is between "$C_5$ is a subgraph of $HS$" and "$HS$ contains a copy of $C_5$".
The command
X.is_subgraph(HS)checks the first of these: it checks whether $V(C_5) \subseteq V(HS)$ and $E(C_5) \subseteq E(HS)$. The answer to whether $V(C_5) \subseteq V(HS)$ is implementation-dependent, and I don't know the answer offhand in Sage; it's reasonably likely, however, that $V(C_5)$ according to Sage is just the set $\{1,2,3,4,5\}$ and $V(HS)$ is $\{1,2,\dots,50\}$. Even then, the second condition checks whether the first $5$ vertices of $HS$ form a $5$-cycle. This is not what you want to know.To check whether $HS$ contains a copy of $C_5$ (in other words, whether we can find some $5$-cycle in $HS$) use
HS.subgraph_search(X)instead.