What’s an algorithm? You ask.

All right. Maybe you didn’t, but I’m going to tell you anyway.Thinking about plot, sequencing, cause and effect, that sort of thing, prompted me to recall my many days studying computers. Computers execute instructions, and they do so in sequence. The ordering of the instructions is an algorithm. This is a higher-level concept than the nuts and bolts of ones and zeros. It’s more like a cooking recipe.

In a way characters are like little computer programs, executing their own actions in sequence.

So what sorts of things can be gleaned from computer science, which may cross over to the world of fiction? That’s where I’m at here, and we’re all caught up.

Here’s a little baseball algorithm I drew up just for you guys.

(P.S. I ran out of room, but the one node “SWING” could easily branch down again into a long consideration of pitch speed, curve of the ball, the number of people on base, whether it’s a line drive or swinging for the fence, etc. Each of these nodes could branch down further with changes in the amount of force used, the position of the legs, shoulders, etc.)

An algorithm combines a sequence of events with a multi-level tree structure (an upside down branching tree is often used). The algorithm goes through a series of major functions, but each one of these can jump down to a subroutine. The subroutine is a self-contained unit that executes fully and then returns control back up the tree to wherever it had left off. You can see an example of this kind of organization in your word processor, that being the menu bar. A menu bar is a type of tree structure that includes a number of subroutines. Each of these subroutines includes its own specific set of subroutines, and this can continue indefinitely, increasing complexity. As soon as the subroutine finishes, the program resumes wherever it left off, allowing you to continue formatting your paper.

It is often necessary to edit a fiction scene and reorder the actions so that they make more logical sense. If you just belch out a series of actions and reactions, chances are that you will slip up and toss in a non-sequitur or two (I know I do). But that’s okay. Get the ideas out, so you have something to play with.

Most plots center on a series of obstacles, which is a dry, emotionally draining way of describing fiction, but on one level characters need to take actions. These actions should be of an escalating nature, more and more danger, higher stakes, riskier encounters, bigger lies, uglier responses; you get the idea.

But in the moment to moment series of actions it’s easy to get lost in the myriad details. That’s why a higher-level understanding (like an outline) helps keep the plot focused. While you engage in a particular scene – like a subroutine – the scene ends and returns to the higher-level plot, as when a sub-program ends and returns control to the main program.

A character may need to perform sub-tasks to accomplish sub-goals. And once a sub-task is completed the broader plot resumes wherever it had left off. It seems pretty obvious, but I don’t recall anyone pointing it out so bluntly.

In mathematics and computer science, an algorithm is a self-contained step-by-step set of operations to be performed.

So when rewriting it’s often useful to analyze what actions and reactions are taken, and to consider if they should be reordered. The order is the thing, the sequence. An error in the sequencing is less powerful, less dramatic and can even be a plot hole. In the interest of avoiding plot holes this sort of multidimensional analysis is useful.

It also provides a measure of balance. If some sub-task takes considerably longer to perform than another, then these may need to be reconceptualized. Is this a sub-goal or a main goal? On which level does it belong? Perhaps it is a scene, or perhaps it is a chapter, or even a longer chunk?

Moment to moment actions are particularly important in thrillers, where danger is present. Every movement and choice can be deadly. Senses are attuned to any mistake the character may make. Any character mistakes should be intended, deliberate and for effect. That requires an analysis of the various ways a scene could play out.

And so we’re back to another computer concept: If this then that. It’s one of the most useful computer instructions. At each juncture a character has a set of options to choose from. Hopefully one of these expresses the theme and just pops out as the best choice. The theme sits at the highest level and is the ultimate arbiter of what’s right and what isn’t.

My Posts  |  Reblogs  |  Films


2 thoughts on “What’s an algorithm? You ask.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s