I have a hobby project that deals a lot with graphical data structures. Think like choose-your-own-adventure-stories, mostly hierarchical, but with some DAG and even an occasional loop (but those are annoying). Each node just has a list of what it points to, and all my programming just does a lot of recursion. It's doable; while I have a number of graphs, none of them will have more than 1000 nodes, so I'm not actually hitting performance problems. But I wonder if I'm missing something; each time I think of a new graph-based feature (show only the part of the graph that leads to this category of nodes; display the graph while hiding everything downstream of node X; possibilities are endless) I'm spending hours doing recursive programming making sure I get it just right. I know there are plenty of graph algorithms out there but they're all quite academic and it's hard to grasp the utility of each one - even here, I grasp what the Knuth Transform is but it's harder to grasp what it gains me. Is there something I'm missing for a good next step, like graph theory for dummies?

Also, I like storing my data in mysql for other reasons so I don't want to switch everything wholesale to a graph database, but I wonder if I should be loading the graphical part of the data into something in memory, like a graph cache, that I can easily query rather than having to do all the recursive programming myself. Does something like that exist, a simple free library that acts as an in-memory graph db?

Sounds like DataScript [0] could be a good fit for you. The Datalog query language is very powerful for writing recursive rules.

[0] https://github.com/tonsky/datascript