auto min_cycle_ratio(const Graph& g);
```
β Without equations & diagrams: Users **guess** the algorithm
--
β
With Doxygen:
```cpp
/**
* @f[ r(C) = \frac{\sum c(e)}{\sum t(e)} @f]
*
* @dot
* digraph { A -> B -> C -> A }
* @enddot
*/
```
**Rendered:** SVG diagram + LaTeX formula β in the browser π
---
### β¨ What Doxygen Gives You
.pull-left[
**Equations** via MathJax (CDN, zero install)
$$ \det\begin{bmatrix} a & b \\\\ c & d \end{bmatrix} = ad - bc $$
$$ \alpha_k = \frac{r_k^T r_k}{d_k^T A d_k} $$
]
.pull-right[
**Diagrams** via Graphviz `dot` (SVG output)
.mermaid[
graph LR
A["Input"] --> B["Process"]
B --> C["Output"]
style A fill:#a9cce3
style B fill:#d4e6f1
style C fill:#7fb3d8
]
**Algorithm flows**, **graph structures**, **state machines**
]
---
### βοΈ One-time Setup
**Doxyfile** β two settings:
```makefile
# Equations
USE_MATHJAX = YES
# MATHJAX_RELPATH defaults to https://cdn.jsdelivr.net/npm/mathjax@2
# Diagrams
HAVE_DOT = YES
DOT_IMAGE_FORMAT = svg
```
**CI** (`documentation.yaml`):
```yaml
- name: Install dependencies
run: sudo apt-get install -y --no-install-recommends doxygen graphviz
```
That's it. No LaTeX toolchain. No Python build steps. Just Doxygen.
---
### π Writing Equations
**Display math** (block):
```cpp
/// @f[
/// \phi_b(n) = \sum_{k=0}^{\infty} a_k(n) \, b^{-k-1}
/// @f]
```
**Inline math**:
/// For a given base @f$b@f$, the @f$n@f$-th value is...
**Inside comments:**
```cpp
/**
* The central cut:
* @f[
* g^T (x - x_c) \le 0
* @f]
*/
```
Doxygen converts `@f[...@f]` β `\[...\]` β MathJax renders it β¨
---
### π« Pitfall: `\operatorname`
**What NOT to use:**
```latex
\operatorname{cross}_0(v,w) β Breaks in MathJax v2
```
Doxygen's default MathJax config may not load the AMSmath extension.
**What to use instead:**
```latex
\mathrm{cross}_0(v,w) β
Always works
```
`\mathrm` is a core TeX primitive β guaranteed available.
.bg-nord-dark[
**Rule:** Use `\mathrm` for multi-letter function names in equations
]
---
### π¨ Adding Diagrams
.pull-left[
**Basic `@dot` block:**
.font-sm.mb-xs[
```cpp
/**
* @dot
* digraph my_graph {
* bgcolor="transparent";
* rankdir=LR;
* node [shape=box, style=filled, fillcolor="#d4e6f1"];
* A -> B -> C;
* }
* @enddot
*/
```
]
Doxygen calls `dot` β generates SVG β embeds as `