r/projecteuler • u/Maleficent_Local9163 • Sep 19 '25
Question about Problem 690
I'm having kind of a hard time understanding how graphs are decided to be identical or not. I thought I understood well enough for 3 nodes but I'm failing to understand for 7 nodes. Below are all of the Tom graphs I could come up with based on how I am currently thinking of unique.

I'm obviously missing quite a few from the 37 there actually are so my understanding must be flawed in some way. If anyone knows where I'm going wrong I would appreciate a quick explanation very much.
4
Upvotes
2
u/jeroen-79 Sep 21 '25
It seems that all your graphs have 'arms' no longer than 1 edge.
I.e. a single edge between two vertices or multiple single edge spokes radiating out from a single hub vertex.
But you can also have spokes that are longer than 1 edge, 2 or even 3 edges would be possible.
Or a snake of 6 edges and 7 vertices.
Or a 'dumbbell' with a central axle of 1 or 2 edges and at each end 2 branches.
https://imgur.com/uEsZJPO
3
u/hacatu Sep 19 '25
I would recommend using something like networkx to programmatically analyze every graph on n nodes for small n where this is feasible. Beyond that, what kinds of graphs aren't included in your set? You didn't include any graphs with cycles, or any graphs with a path longer than 3 nodes. Clearly from the givens, graphs with a 3 cycle can't be Tom graphs, but what about 4+ cycles? And what about graphs with a path of 4+?