Colophon
About this edition
An independent rewrite of Graph Theory for Olympiad in Informatics: the figures are reused, the text is not.
What this is
The original GTOI book (by Mohammad Pheshan) is a free, GPL-licensed graph-theory text for contestants, built with Sphinx from reStructuredText. This edition keeps the chapter map and the vector figures and rewrites everything else: the prose, the proofs, the code, the comparison tables, the trap lists and the problem annotations. Nothing here is translated or copied from the source text.
The numbers
Built site
- 80 pages across 15 chapters and an appendix
- 63,685 words, 98 code snippets, 13 interactive demos
- 180 judge problems (CSES, Codeforces, SPOJ) with a reason for each
- 39 figures inlined as SVG and recoloured for both themes
How it is built
A single Python script with no dependencies: build/markup.py is the markdown and
highlighting engine, build/figures.py sanitises and theme-maps the SVGs, and
build/build.py assembles pages, indexes, the search corpus and the lint checks. The
output is static files — no JavaScript framework, no runtime data fetching except
search.json.
Conventions used everywhere
Reading a page
@chapter/pagelinks are resolved at build time; an unresolved one is flagged, never shipped silently.- Complexity claims are stated for worst case unless the word expected appears.
- Code is C++17, 0-indexed arrays, and compiles as written except where
n,g,INFcome from the surrounding program. - Difficulty: warm-up core hard olympiad.
Licence
The source material is GPL-3.0; the figures in assets/img/ come from it and stay under
that licence. The rewritten text and code in content/ and assets/js/ were
written for this edition.