In the Project Euler problem
Tom and Jerry, it defines Tom graphs. A cat named Tom and a mouse named Jerry play a game on a graph G. Each vertex of G is a mouse hole. Jerry hides in one of the holes. Then, Tom tries to catch Jerry by picking a hole. Then, Jerry moves to an adjacent hole. Then, Tom picks another hole. They keep doing this, where Jerry moves to an adjacent hole and Tom picks a hole. A Tom graph is a graph that Tom can always catch Jerry by following a sequence of holes.
Example: This is a Tom graph.
1---2---3
Tom can do the sequence 2, 2 to guarantee catching Jerry.
1. Prove that all Tom graphs are cycle-free.
2. Find the smallest cycle-free graph that is not a Tom graph.
The only connected graph on 4 nodes with no cycles besides the line graph is the star graph. That's an easy Tom: hit the center twice.
The only 5 node graph to check is the Y shaped
4---1---2---3
|
5
But Tom wins with 1,2,2,1 which nullifies the extra branch.
I think the solution to Part 2, is to lengthen a branch:
5---4---1---2---3
|
6
Here the escape hatch for Jerry seems to cancel the parity solution from the straight line I gave in my first post.
Nope. 2,1,4,4,1,2
I'm wondering if Tom wins in any cycle free graph because the nodes can be 2-colored. Or maybe we just need more longer branches. I'm taking a break before trying to add node 7 to 6.
|
Posted by Jer
on 2021-02-20 13:43:30 |