A* search, any kind of heuristic estimation, learning, or simulated reasoning. All of those things would count.
We don't need mathematical optimization to call it "AI", but there SHOULD be more than a simple if-then.
At least show me that you're path-finding. That's not even being done here - this is just path-following.
"I leave a trail, you follow it." Explain to me how that qualifies as AI. Simple BFS/DFS achieves a lot more than this - which is considered by most to not even really be AI.
You seem to acknowledge a distinction between ML and AI, but I'm not able to understand in your categorization, what would AI be?