Lyn C. Guenther, MD, FRCPC
Professor of Dermatology, Western University, London ON, Canada

Conflict of interest: No funding was received to write this paper.

Introduction

Medical algorithms are created, yet there is a paucity of information about how such algorithms should be created and the optimal way to develop an excellent algorithm. An algorithm is a logical sequence of steps to solve a problem.1 It is a precise, unambiguous set of steps to solve a problem using a finite amount of data in a finite amount of time.2

Background

  • Algorithms are commonly used for data processing and calculation in computer and mathematical operations.3
  • They are used in everyday life. Examples of algorithms include how to wash clothing in your washing machine and dryer, how to operate a home security system and cookie recipes. An excellent cookie recipe gives the necessary ingredients, preparation and cooking procedures to produce reproducible cookies every time you bake them.
  • Computational algorithms are used for addition, subtraction, multiplication and division.
  • More than 1 algorithm can be used to solve the same problem. For example, mathematical problems can often be solved in many ways.

Medical Algorithms

  • Medical algorithms are used to make medical decisions such as test selection, diagnoses, treatment including drug allergies and drug-drug interactions, and prognosis.4
  • Examples include calculators to determine body mass index using weight and height as inputs.
  • Decision trees are used to decide the cause of a symptom and nomograms such as a moving circular slide to calculate body surface area or drug dosage.
  • The purpose of medical algorithms is to improve and standardize medical decisions even when there is a variety of health care providers.
  • They are used to standardize the selection and use of treatment regimens, thereby improving adherence to evidence-based guidelines. They can also predict outcome (e.g. critical care scoring system).

Features of Great Algorithms

  • Great algorithms have inputs and outputs, are simple and precise with steps uniquely defined, with the results depending on the input and results of the preceding step(s).
  • There should be only one way to interpret the instructions and the exact circumstances in which an action is to be carried out should be specified.
  • The terms “occasionally”, “sometimes” and “maybe” should not be used.5
  • They must proceed through steps and end with a conclusion (output).
  • The results must be correct and complete with all sets of input.
  • Algorithms should be complete and account for all inputs and stop after a finite number of instructions.6
  • There should be no unnecessary steps or complexity.
  • Each step should carry out one logical step of the process.
  • Steps should not be defined as “Do this after you have done that.”5
  • Abstraction (i.e. grouping steps) may be used but should be appropriate.6
  • Abstraction considers an item independently of its associations, or an attribute independently of the item to which it belongs. It allows us to view algorithms as a series of major aggregate steps, with details hidden in a lower level (top down design). After determining major steps, the details for how to accomplish them is determined and additional levels are filled in as required.
  • A great algorithm should follow the pneumonic “RECUR”—

Reliable
Efficient
Clear
Understandable
Remember easily

  • Taking the example of a cookie recipe, it is reliable if you follow the recipe exactly and the cookies come out the same every time. It is efficient if no extra ingredients or steps are used in the recipe. The instructions are clear if they are not confusing, ambiguous, or vague. The recipe is understandable if it makes sense. Good recipes should also be easy to remember.
  • The best algorithm depends on the situation. For example, who are the cookies for—children or adults? What are they paired with? Does the recipe work at all altitudes? A variation in the recipe or another recipe may meet the different needs. In addition, not all experts will agree on the best recipe. Analyzing a number of different recipes may enable chefs to adapt their baking for a variety of situations.

Great Medical Algorithms

  • An example of a great medical algorithm is the International algorithm for the management of chronic spontaneous/idiopathic urticaria.7,8
  • It is a simple algorithm that is easy to remember.

There are 4 steps:

      1. Second-generation antihistamines at standard doses.
      2. Increased dosage up to 4-fold of second-generation antihistamines if the symptoms persist after 2-4 weeks.
      3. Omalizumab if there is inadequate control after 2-4 weeks.
      4. Cyclosporin A if there is inadequate control after 6 months.
  • This is a reliable, efficient (only 4 steps), clear, understandable algorithm that is easy to remember. The solution is always the same under all circumstances.
  • It is much simpler and a better algorithm than the US algorithm which is much more complicated without clear guidance as to what should be used in the next step. For example, in the US chronic urticaria treatment algorithm, step 2 is not binary and includes multiple choices (increased dosage of second-generation antihistamine, addition of another second-generation antihistamine, addition of a H2-antagonist, addition of leukotriene-modifying agents and addition of a first-generation antihistamine at bedtime.8 This algorithm is complex and would not result in reproducible results.

How to Create a Great Algorithm

  • The problem should be first determined (e.g. directions, recipe, solving a problem, medication treatment plan).
  • The input variables should then be determined (e.g. width and length to determine area) and output stated.
  • A simple complete precise plan with or without abstraction should then be developed after determining the audience.
  • There is often no reason to reinvent the wheel and a search should be made for algorithms that are already in existence to treat a given problem.
  • Necessary steps should also be determined, and
  •  The plan tried out to determine if:
    • The plan works
    • Each step is right/correct
    • Each step is necessary (efficiency)
    • The solution is reproducible and accurate under all circumstances.
  • In medical treatment algorithms, it is often difficult to have a single treatment option for a particular step since different classes of medications could potentially be used.
  • Where possible, using classes of medications rather than specific medication names may help simplify the algorithm and make it easier to remember and implement.

Conclusion

Adherence to the “RECUR”—Reliable, Efficient, Clear, Understandable and Remember easily pneumonic should increase the quality of medical algorithms being created. Well constructed medical algorithms have the potential to improve and standardize medical decisions, enhance adherence to better guidelines and improve patient care.

References



  1. Dictionary.com. Algorithm [Internet]. The Random House Unabridged Dictionary; 2019. Available from: https://www.dictionary.com/browse/algorithm?s=t

  2. Dale N, Lewis J. Computer Science Illuminated. 5th ed. Jones and Bartlett Publishers, Inc; 2012.

  3. Techopedia. Algorithm [Internet]. Techopedia; [date unknown]. Available from: https://www.techopedia.com/definition/3739/algorithm

  4. Wikipedia. Medical algorithm [Internet]. Wikimedia Foundation; 2007 Sept [updated 2019 Sept]. Available from: https://en.wikipedia.org/wiki/Medical_algorithm

  5. Lincoln School. Algorithm properties [Slides]. LinkedIn Slideshare; 2013 Jan. Available from: https://www.slideshare.net/jrcampos/03-algorithm-properties

  6. Chegg Study. Question: The Characteristics Of A Good Algorithm Are: [Internet]. Chegg; [date unknown]. Available from: https://www.chegg.com/homework-help/questions-and-answers/characteristics-good-algorithm-precision-steps-preciselystated-defined–uniqueness-result-q603838?trackid=97bd1cb7e801&strackid=4a18c18b26b1&ii=1

  7. Westby EP, Lynde C, Sussman G. Skin Therapy Lett. 2018 May;23(3):1-4.

  8. Beck LA, Bernstein JA, Maurer M. Acta Derm Venereol. 2017 Feb 8;97(2):149-158.