⏱️ Lectura: 10 min

A blog post about botany, with no code or frameworks, orders a technical study plan better than most guides for self-taught developers: without meaning to, it describes what in programming we’d call a prerequisite graph.

📑 En este artículo
  1. TL;DR
  2. What happened
  3. Context and history
  4. Technical details: how a prerequisite graph works
  5. Getting started
  6. Impact and analysis
  7. What’s next
  8. Frequently Asked Questions
    1. What is a prerequisite graph in a study plan?
    2. Why isn’t it enough to follow a reading list in the order it was published?
    3. What’s the difference between graphlib.TopologicalSorter and the toposort package from npm?
    4. What happens if the prerequisite graph has a cycle?
    5. Does this method work for fields other than programming?
    6. Where can I see the original reading list that inspired this method?
  9. References

The original article, published on Crime Pays But Botany Doesn’t, doesn’t use those words, but it describes the same logic precisely: there’s no point reading about molecular phylogenetics without first understanding basic taxonomy. That dependency relationship can be applied, as is, to any programming, systems, or artificial intelligence curriculum.

TL;DR

  • The blog Crime Pays But Botany Doesn’t published a reading list for self-teaching botany, with reference books and an explicit study method.
  • The original article insists on a key principle: there’s no point studying molecular phylogenetics without understanding basic taxonomy first.
  • The same dependency principle applies to programming: some topics can’t be understood without first mastering their technical prerequisite.
  • Modeling a study plan as a prerequisite graph (DAG) makes it possible to calculate the correct order with a topological sort.
  • Python solves this problem with graphlib.TopologicalSorter, part of the standard library since version 3.9.
  • Node.js solves it with the toposort package from npm, which has to be installed separately.
  • Curated lists like OSSU or TeachYourselfCS solve what to read, but not in what order: that’s where the prerequisite graph adds real value.

What happened

The site Crime Pays But Botany Doesn’t, written by a paleobotanist, published a guide for people who want to self-teach botany from scratch. The guide isn’t a flat list of titles: it first explains why Latin nomenclature exists (a universal system created by Carl Linnaeus so scientists from different cultures could name organisms without ambiguity), then introduces the concept of evolutionary taxonomy, and only after that recommends the reference texts.

The central book on the list is Plant Systematics, by Michael Simpson, which explains how botanists identified evolutionary relationships between plant families using synapomorphies (shared derived traits) before DNA analysis existed, and why some of those classifications turned out to be wrong once molecular phylogenetics arrived. The point isn’t memorizing plant names: it’s understanding that each level of knowledge depends on the one before it.

That explicit dependency (first taxonomy, then systematics, then molecular phylogenetics) is exactly the kind of structure that almost no programming resource list makes explicit: most of them list books or courses without stating what the reader needs to know before starting each one, meaning without building a real prerequisite graph.

💭 Key point: the real value of the list isn’t the botany bibliography, it’s the order: each resource is recommended only after the reader already has the vocabulary to understand it.
Stack of technical reference books for building a study plan
Order resources by dependency, not by publication date. Foto de Stephen Phillips – Hostreviews.co.uk en Unsplash

Context and history

Curated reading lists aren’t new in tech. OSSU (Open Source Society University) builds a complete computer science study plan with free courses organized into mandatory phases. roadmap.sh draws learning paths as decision trees for frontend, backend, or DevOps roles. Neither one popularizes the concept of dependency as an explicit, editable data structure: they generally show a fixed sequence, not a graph that readers themselves can inspect or modify.

In its simplest form, any curated reading list is already an implicit graph: each resource has zero or more prerequisites. The problem shows up when the list grows. Past 15 or 20 interrelated topics, manually ordering what comes before what stops being trivial, especially when a topic has more than one prerequisite or when a single prerequisite unlocks several topics in parallel.

Technical details: how a prerequisite graph works

Modeling a curriculum as a directed acyclic graph (DAG) turns the problem of ordering study into a topological sorting problem: each topic is a node, each prerequisite is a directed edge, and the result is a sequence where no node appears before its dependencies. Kahn’s algorithm solves this in O(V + E) time, where V is the number of topics and E is the number of prerequisite relationships: practically instant even for a curriculum with several hundred topics.

flowchart TD
A["Data structures"] --> B["Algorithms and complexity"]
B --> C["Operating systems"]
B --> D["Databases"]
C --> E["Networks and protocols"]
D --> F["API design"]
E --> G["Distributed systems"]
F --> G
⚠️ Watch out: if the prerequisite graph has a cycle (for example, “distributed systems” depends on “databases”, and by mistake “databases” ends up marked as dependent on “distributed systems”), no valid order exists. Both graphlib.TopologicalSorter and toposort detect this and raise an exception instead of returning an incorrect order.
Diagram of a prerequisite graph with nodes and dependencies
Each edge is a dependency the algorithm respects when ordering. Foto de Sharad Bhat en Unsplash

Getting started

To reproduce the example you need Python 3.9 or higher (for graphlib, which is already included) or Node.js 16 or higher (for the toposort package, which has to be installed separately). Installation by operating system:

  • Windows: winget install Python.Python.3.12 or winget install OpenJS.NodeJS.LTS
  • macOS: brew install python or brew install node
  • Linux (Debian/Ubuntu): sudo apt install python3 or sudo apt install nodejs npm

With Python, load the curriculum as a dictionary of dependencies and ask graphlib for the order:

from graphlib import TopologicalSorter

curriculo = {
    "estructuras_de_datos": set(),
    "algoritmos": {"estructuras_de_datos"},
    "sistemas_operativos": {"algoritmos"},
    "bases_de_datos": {"algoritmos"},
    "redes": {"sistemas_operativos"},
    "sistemas_distribuidos": {"redes", "bases_de_datos"},
}

orden = list(TopologicalSorter(curriculo).static_order())
print(orden)

The result is the exact sequence in which to study each topic so you never reach one without having already covered what it needs. If you add a new topic with its dependencies, the order recalculates itself.

With Node.js, the same curriculum as a list of [dependent, prerequisite] pairs, using the toposort package (npm install toposort):

const toposort = require("toposort");

const dependencias = [
  ["algoritmos", "estructuras_de_datos"],
  ["sistemas_operativos", "algoritmos"],
  ["bases_de_datos", "algoritmos"],
  ["redes", "sistemas_operativos"],
  ["sistemas_distribuidos", "redes"],
  ["sistemas_distribuidos", "bases_de_datos"],
];

const ordenDeEstudio = toposort(dependencias).reverse();
console.log(ordenDeEstudio);

The call to .reverse() is necessary because toposort returns the order from dependents to prerequisites: reversing it gives the actual study order, from most basic to most advanced.

Impact and analysis

MethodWhen to use itAdvantageLimitation
Structured bootcampWhen you need a fixed schedule with delivery datesOrder already validated by instructorsLittle flexibility to skip topics you already master
Curated list (OSSU, TeachYourselfCS)When you want a complete, free syllabusSaves you the work of curating resourcesThe order is fixed, it doesn’t adapt to what you already know
Path generated by an LLMWhen you need a quick starting point for a specific topicGenerated in seconds and customizable through the promptCan hallucinate prerequisites or nonexistent resources
Curriculum modeled as a prerequisite graphWhen the plan has many interdependent topics and changes over timeThe order recalculates itself when topics are added or removedRequires you to maintain the dependency relationships yourself

The real limitation of this method is that someone has to declare the dependencies by hand: a poorly built prerequisite graph orders things wrong, even though the algorithm itself never fails silently. For a study plan of four or five topics, the gain over a simple list is minimal; the model starts paying off once the curriculum passes a dozen cross-dependent topics, which is exactly the size at which a botany list like Plant Systematics plus Raven’s Biology of Plants plus a dozen additional texts stops being something you can order by eye.

What’s next

The natural next step is for these curricula to stop living in the head of whoever builds them and move into a versioned file: a JSON or YAML in a repository, with change history in Git, that anyone can fork and adapt to their own starting point. Tools like roadmap.sh already publish their paths as structured data; what’s missing is for that format to become standardized enough that a community-maintained script could take someone else’s curriculum, mark which nodes are already completed, and automatically recalculate the rest of the path.

📖 Summary on Telegram: See summary

Try it yourself: install graphlib (it already comes with Python 3.9 or higher) or run npm install toposort, load three or four topics you want to learn along with their dependencies, and let the algorithm build your own prerequisite graph.

Frequently Asked Questions

What is a prerequisite graph in a study plan?

It’s a way of representing a curriculum where each topic is a node and each arrow indicates a mandatory dependency: if topic B needs topic A, there’s an edge from A to B. The result is a directed graph that, if built correctly, has no cycles.

Why isn’t it enough to follow a reading list in the order it was published?

Because publication order doesn’t always match the real dependency order between topics. The Crime Pays But Botany Doesn’t list works because its author manually ordered the concepts by dependency, something not every list does explicitly.

What’s the difference between graphlib.TopologicalSorter and the toposort package from npm?

They solve the same problem, topological sorting, in different languages: graphlib is part of Python’s standard library since version 3.9, while toposort is a third-party package for Node.js that has to be installed with npm.

What happens if the prerequisite graph has a cycle?

No valid order is possible, and both tools detect it: graphlib.TopologicalSorter raises a CycleError and toposort throws an exception indicating which nodes form the cycle, which helps you fix the curriculum before you start studying.

Does this method work for fields other than programming?

Yes: the original example is precisely botany, not technology. Any field with concepts that depend on one another (mathematics, biology, even music theory) benefits from modeling the material as a graph instead of a linear list.

Where can I see the original reading list that inspired this method?

It’s published on Crime Pays But Botany Doesn’t, the blog of the paleobotanist who wrote it; the direct link is in the references section of this article.

References

📱 Enjoying this content? Follow @programacion on Telegram for daily tech content in Spanish: quick summaries, fresh content every day.

Imagen destacada: Foto de GuerrillaBuzz en Unsplash

Categories: Noticias Tech

Andrés Morales

Developer and AI researcher. Writes about language models, frameworks, developer tooling, and open source releases. Covers ML papers, the tech startup ecosystem, and programming trends.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.