My algorithm for deciding what to cook

I don’t really follow recipes. I sometimes read recipes for inspiration, but I rarely end up following them more than even vaguely.

Instead I just haphazardly thrash around until I come up with something to cook. This works surprisingly well.

It occurred to me earlier that the way I do this is a greedy algorithm. As well as being an interesting insight, this is an amusing pun (here let me explain the joke: You see, a greedy algorithm is both a solution finding algorithm from computer science but also someone who eats lots of food is “greedy”. Therefore the humour derives from the double meaning of the word greedy in this context: It is both accurate from an algorithmic design point of view and also carries the hidden implication that you are going to eat lots of food. Is this funny yet? I can explain more if you like).

That is to say it works by maintaining a set of ingredients. The algorithm is then:

  1. Find an ingredient which would go well with the existing set of ingredients.
  2. If I am in the mode for that ingredient, accept it and add it to the list.
  3. Repeat until the current set of ingredients seems like it could be turned into a complete meal.

This seems to produce consistently good results.

The problem is that it requires a good implementation of step 1 in order to function. I think mine is basically performing a rejection sampling on the set of available things (i.e. wandering randomly through the supermarket / browsing through my cupboard / fridge) until I find something that catches my eye and go “Oooh. That could work”. The empty set is a special case here where it requires me finding out what I’m in the mood for.

It also requires being able to figure out what goes well together without actually trying it. Some people seem to find this hard. All I can offer as advice is that a protracted period of vegetarianism in which you can’t eat cheese works really well for developing this skill (at least that’s how I did it). The problem with meat and cheese is that they constitute a dominant flavour for the dish, so it’s very easy to just make them the centre piece and not do much else to it. Without that as a crutch what you will make will tend to be very boring unless you figure out how to make a variety of different flavours work well together, and you’re forced to learn out of survival instinct. It’s not dissimilar to the immersive way of learning a language I imagine.

Here is a dish I made recently that resulted from this:

Gnocchi with Aubergine/tomato/Caper sauce

Gnocchi is self-explanatory. The sauce is as follows:

  • Approx 1 kg aubergine
  • 1 head of garlic
  • approx 50g butter
  • “some” olive oil.
  • coarse salt “to taste” (sorry, I know. But I have no idea how much I used, except I tend to salt things quite heavily).
  • About 5 tsp of capers
  • 1 pretty embarrassingly weak red chilli (note: recipe needs more chilli than I used)
  • fresh thyme until I got bored stripping it off the stems
  • 800g canned chopped tomatoes

It proceeded in two stages. To be honest, I’m a little disappointed in the second stage because the first was so amazing and the end result was merely really good. You might want to stop halfway through and just eat the aubergine bit.

Step 1:

Cut the aubergine into roughly cm cubes. Peel but don’t crush the garlic. Chop the chilli without removing the seeds (you may wish to remove the seeds if you have a real chilli rather than the pathetic imitation chillis I found in a Swiss supermarket). Put these in a pressure cooker with the butter and enough olive oil that the aubergine is lightly oiled but not soaked in it and as much thyme as you can be bothered with. Stir it all up, then pressure cook for 10 minutes once the pressure is up.

The result was basically perfect salty garlicky soft cooked aubergine. The pressure cooker basically fixed all the pathologies of cooking aubergine where there’s a complex dysfunctional middle ground between undercooked and burned.

Step 2 is simply to add the tomatoes and capers, stir and then pressure cook for another 5 minutes.

The result is a really nice garlicky sharp sauce a little reminiscent of puttanesca (it didn’t have olives, but they’d probably have been a good addition now that I think about it).

The basic starting point of this recipe was gnocchi, found while browsing the supermarket. I then added the aubergine, and everything else just build up around there.

Of course, now I’m using a subtly different algorithm for tonight’s dinner: The aubergine intermediate step was really good. What could I serve that with? (The answer BTW is that it’s going to be served with a quinoa done with dill, lemon and feta plus a side of fresh made guacamole. I’m pretty excited by this plan).

This entry was posted in Food, Open sourcing my brain on by .

One thought on “My algorithm for deciding what to cook

  1. Pingback: Gnocchi with Courgettes and Sundried tomatoes | David R. MacIver

Comments are closed.