Solving problems with simple yet powerful abstractions in Python

A series of posts on solving problems with simple yet powerful abstractions in Python. We explore a few algorithms.

A mask (an abstraction).
Great abstractions are simple yet powerful. Photo by Laurentiu Robu

Recently I’ve had the pleasure of working with my colleague Frank Kelly on solving a modestly difficult problem in Python. As we used varying approaches, it was increasingly difficult to illustrate the differences among them. This was mainly due to the complexities in the solution itself, and the algorithms used in those solutions. I thought it’s a good time to separate out the approaches from our solutions using them, and that’s what sparked the idea for this series of posts.

In this series, we look at a few algorithms, and come up with a set of abstractions to use them effectively. We also look at various kinds of problems and useful abstractions to help solve them before moving on to other algorithms. We use python3 and typing information to make the source self-documenting where possible.

This post is an index into the series:

  1. Finding multiples of a number using brute-force search
  2. Solving different types of problems with brute-force search
  3. Solving for multiple variables in brute-force search
  4. Solving the n-queens problem with brute-force search
  5. Optimizing the brute-force search for an n-queens solution
  6. Coming soon…

Subscribe to The ArtfulDev Journal

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.