Even when you're not sitting down and working a problem, you can be working the problem while going about doing other things (if those things don't require your full attention) like this: take aspects of your environment, your actions, thoughts, etc and analogically morph them into your problem, then see how they behave. eg: You might be eating breakfast and see a picture of cows or something, and you start mentally linking the cows into a network to help you solve a graph-related problem. Another eg: you might be talking to someone about other people (thats gossip) and you imagine the relationships involved are a stack, and you're popping and pushing people while talking to help you solve a programming problem
I've been doing this while going about my morning routine today and it does seem very effective
I bet its best to try a variety of analogies, or as many analogies you can come up with, than just one. I mean, I bet variety is the key to this technique