# programacioncompetitivaufps/notebook architecture

> Architecture diagram of the GitHub repository programacioncompetitivaufps/notebook, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/programacioncompetitivaufps/notebook
- Repository: https://github.com/programacioncompetitivaufps/notebook

## Overview

##### Main C++ components
- Data Structures
- Dynamic Programming
- Geometry
- Graphs
- Math
- Modular arithmetic
- Network flows
- Strings
- Utilities
- Values sequences and results

2. For each C++ module, expand the files contained in that module as subcomponents. For example:
── Data Structures:
▪ Centroid Decomposition.cpp
▪ Convex Hull Trick.cpp
▪ Disjoint Set.cpp
▪ Dsu on Tree (Sack).cpp
▪ Fenwick Tree.cpp
▪ Heavy Light Decomposition.cpp
▪ Min queue.cpp
▪ Ordered Set.cpp
▪ Persistent Segment Tree.cpp
▪ Segment Tree (Lazy Propagation).cpp
▪ Segment Tree 2D.cpp
▪ Sparse Table.cpp
▪ Sparse table 2D.cpp

── Dynamic Programming:
▪ Longest Increasing Subsequence.cpp
▪ Max Range Sum.cpp
▪ Min Max Range.cpp
▪ Traveling Salesman Problem.cpp

── Geometry:
▪ Point.cpp
▪ circle.cpp
▪ halfplanes.cpp
▪ line.cpp
▪ polygon.cpp
▪ segment.cpp

── Graphs:
▪ 2-satisfiability.cpp
▪ Articulation Bridges Biconnected.cpp
▪ BFS.cpp
▪ Bellman Ford.cpp
▪ Bipartite Check.cpp
▪ Cycle Detection.cpp
▪ DFS.cpp
▪ Dijkstra.cpp
▪ Flood Fill.cpp
▪ Floyd Warshall.cpp
▪ Kruskal.cpp
▪ Lowest Common Ancestor.cpp
▪ Prim.cpp
▪ Tarjan.cpp
▪ Topological Sort.cpp
▪ Tree Isomorphism.cpp

── Math:
▪ Basis of a Vector Space (mod 2 Field).cpp
▪ Binomial Coefficient.cpp
▪ Diophantine Ecuations.cpp
▪ Divisors.cpp
▪ Euler Totient.cpp
▪ Extended Euclides.cpp
▪ Fast Fourier Transform.cpp
▪ Fraction.cpp
▪ Gauss Jordan.cpp
▪ Greatest Common Divisor.cpp
▪ Lowest Common Multiple.cpp
▪ Miller Rabin.cpp
▪ Mobius.cpp
▪ Pollard Rho.cpp
▪ Prime Factorization.cpp
▪ Sieve of Eratosthenes.cpp
▪ Simplex integer.cpp
▪ Simplex.cpp
▪ Ternary Search.cpp

── Modular arithmetic:
▪ Chinese Remainder Theorem.cpp
▪ Discrete Logarithm.cpp
▪ Fibonacci mod m.cpp
▪ Linear Recurrence.cpp
▪ Matrix Multiplication.cpp
▪ Modular Exponentiation.cpp
▪ Modular Inverse.cpp
▪ Modular Multiplication.cpp
▪ Pisano Period.cpp
▪ Primitive Root.cpp

── Network flows:
▪ Blossom.cpp
▪ Dinic.cpp
▪ Hungarian.cpp
▪ Maximum Bipartite Matching.cpp
▪ MinCost MaxFlow.cpp
▪ Stoer Wagner.cpp
▪ Weighted matching.cpp

── Strings:
▪ Aho Corasick (Trie).cpp
▪ Hashing.cpp
▪ KMP Automaton.cpp
▪ KMP.cpp
▪ Manacher.cpp
▪ Minimum Expression.cpp
▪ Palindromic tree.cpp
▪ Prefix Function.cpp
▪ Suffix Array.cpp
▪ Suffix Automaton.cpp
▪ Z Function.cpp

── Utilities:
▪ Bits Manipulation.cpp
▪ Random Integer.cpp
▪ Split String.cpp
▪ Template.cpp
▪ scanf and printf.cpp

── Values sequences and results:
▪ ASCII Table.tex
▪ Formulas.tex
▪ Sequences.tex
▪ Time Complexities.tex

##### Relationships and interactions
- Inter-module relationships where algorithms in one module (e.g., Network flows for matching problems) often rely on graph representations (thus linking to the Graphs module).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Module: Data Structures
    subgraph "Module: Data Structures"
        DS_Module["Data Structures"]:::module
        DS1["Centroid Decomposition.cpp"]:::file
        DS2["Convex Hull Trick.cpp"]:::file
        DS3["Disjoint Set.cpp"]:::file
        DS4["Dsu on Tree (Sack).cpp"]:::file
        DS5["Fenwick Tree.cpp"]:::file
        DS6["Heavy Light Decomposition.cpp"]:::file
        DS7["Min queue.cpp"]:::file
        DS8["Ordered Set.cpp"]:::file
        DS9["Persistent Segment Tree.cpp"]:::file
        DS10["Segment Tree (Lazy Propagation).cpp"]:::file
        DS11["Segment Tree 2D.cpp"]:::file
        DS12["Sparse Table.cpp"]:::file
        DS13["Sparse table 2D.cpp"]:::file
        %% Grouping relationship within Data Structures
        DS_Module --> DS1
        DS_Module --> DS2
        DS_Module --> DS3
        DS_Module --> DS4
        DS_Module --> DS5
        DS_Module --> DS6
        DS_Module --> DS7
        DS_Module --> DS8
        DS_Module --> DS9
        DS_Module --> DS10
        DS_Module --> DS11
        DS_Module --> DS12
        DS_Module --> DS13
    end

    %% Module: Dynamic Programming
    subgraph "Module: Dynamic Programming"
        DP_Module["Dynamic Programming"]:::module
        DP1["Longest Increasing Subsequence.cpp"]:::file
        DP2["Max Range Sum.cpp"]:::file
        DP3["Min Max Range.cpp"]:::file
        DP4["Traveling Salesman Problem.cpp"]:::file
        DP_Module --> DP1
        DP_Module --> DP2
        DP_Module --> DP3
        DP_Module --> DP4
    end

    %% Module: Geometry
    subgraph "Module: Geometry"
        GEOM_Module["Geometry"]:::module
        GEOM1["Point.cpp"]:::file
        GEOM2["circle.cpp"]:::file
        GEOM3["halfplanes.cpp"]:::file
        GEOM4["line.cpp"]:::file
        GEOM5["polygon.cpp"]:::file
        GEOM6["segment.cpp"]:::file
        GEOM_Module --> GEOM1
        GEOM_Module --> GEOM2
        GEOM_Module --> GEOM3
        GEOM_Module --> GEOM4
        GEOM_Module --> GEOM5
        GEOM_Module --> GEOM6
    end

    %% Module: Graphs
    subgraph "Module: Graphs"
        GR_Module["Graphs"]:::module
        GR1["2-satisfiability.cpp"]:::file
        GR2["Articulation Bridges Biconnected.cpp"]:::file
        GR3["BFS.cpp"]:::file
        GR4["Bellman Ford.cpp"]:::file
        GR5["Bipartite Check.cpp"]:::file
        GR6["Cycle Detection.cpp"]:::file
        GR7["DFS.cpp"]:::file
        GR8["Dijkstra.cpp"]:::file
        GR9["Flood Fill.cpp"]:::file
        GR10["Floyd Warshall.cpp"]:::file
        GR11["Kruskal.cpp"]:::file
        GR12["Lowest Common Ancestor.cpp"]:::file
        GR13["Prim.cpp"]:::file
        GR14["Tarjan.cpp"]:::file
        GR15["Topological Sort.cpp"]:::file
        GR16["Tree Isomorphism.cpp"]:::file
        GR_Module --> GR1
        GR_Module --> GR2
        GR_Module --> GR3
        GR_Module --> GR4
        GR_Module --> GR5
        GR_Module --> GR6
        GR_Module --> GR7
        GR_Module --> GR8
        GR_Module --> GR9
        GR_Module --> GR10
        GR_Module --> GR11
        GR_Module --> GR12
        GR_Module --> GR13
        GR_Module --> GR14
        GR_Module --> GR15
        GR_Module --> GR16
    end

    %% Module: Math
    subgraph "Module: Math"
        M_Module["Math"]:::module
        M1["Basis of a Vector Space (mod 2 Field).cpp"]:::file
        M2["Binomial Coefficient.cpp"]:::file
        M3["Diophantine Ecuations.cpp"]:::file
        M4["Divisors.cpp"]:::file
        M5["Euler Totient.cpp"]:::file
        M6["Extended Euclides.cpp"]:::file
        M7["Fast Fourier Transform.cpp"]:::file
        M8["Fraction.cpp"]:::file
        M9["Gauss Jordan.cpp"]:::file
        M10["Greatest Common Divisor.cpp"]:::file
        M11["Lowest Common Multiple.cpp"]:::file
        M12["Miller Rabin.cpp"]:::file
        M13["Mobius.cpp"]:::file
        M14["Pollard Rho.cpp"]:::file
        M15["Prime Factorization.cpp"]:::file
        M16["Sieve of Eratosthenes.cpp"]:::file
        M17["Simplex integer.cpp"]:::file
        M18["Simplex.cpp"]:::file
        M19["Ternary Search.cpp"]:::file
        M_Module --> M1
        M_Module --> M2
        M_Module --> M3
        M_Module --> M4
        M_Module --> M5
        M_Module --> M6
        M_Module --> M7
        M_Module --> M8
        M_Module --> M9
        M_Module --> M10
        M_Module --> M11
        M_Module --> M12
        M_Module --> M13
        M_Module --> M14
        M_Module --> M15
        M_Module --> M16
        M_Module --> M17
        M_Module --> M18
        M_Module --> M19
    end

    %% Module: Modular arithmetic
    subgraph "Module: Modular arithmetic"
        MA_Module["Modular arithmetic"]:::module
        MA1["Chinese Remainder Theorem.cpp"]:::file
        MA2["Discrete Logarithm.cpp"]:::file
        MA3["Fibonacci mod m.cpp"]:::file
        MA4["Linear Recurrence.cpp"]:::file
        MA5["Matrix Multiplication.cpp"]:::file
        MA6["Modular Exponentiation.cpp"]:::file
        MA7["Modular Inverse.cpp"]:::file
        MA8["Modular Multiplication.cpp"]:::file
        MA9["Pisano Period.cpp"]:::file
        MA10["Primitive Root.cpp"]:::file
        MA_Module --> MA1
        MA_Module --> MA2
        MA_Module --> MA3
        MA_Module --> MA4
        MA_Module --> MA5
        MA_Module --> MA6
        MA_Module --> MA7
        MA_Module --> MA8
        MA_Module --> MA9
        MA_Module --> MA10
    end

    %% Module: Network flows
    subgraph "Module: Network flows"
        NF_Module["Network flows"]:::module
        NF1["Blossom.cpp"]:::file
        NF2["Dinic.cpp"]:::file
        NF3["Hungarian.cpp"]:::file
        NF4["Maximum Bipartite Matching.cpp"]:::file
        NF5["MinCost MaxFlow.cpp"]:::file
        NF6["Stoer Wagner.cpp"]:::file
        NF7["Weighted matching.cpp"]:::file
        NF_Module --> NF1
        NF_Module --> NF2
        NF_Module --> NF3
        NF_Module --> NF4
        NF_Module --> NF5
        NF_Module --> NF6
        NF_Module --> NF7
    end

    %% Module: Strings
    subgraph "Module: Strings"
        ST_Module["Strings"]:::module
        ST1["Aho Corasick (Trie).cpp"]:::file
        ST2["Hashing.cpp"]:::file
        ST3["KMP Automaton.cpp"]:::file
        ST4["KMP.cpp"]:::file
        ST5["Manacher.cpp"]:::file
        ST6["Minimum Expression.cpp"]:::file
        ST7["Palindromic tree.cpp"]:::file
        ST8["Prefix Function.cpp"]:::file
        ST9["Suffix Array.cpp"]:::file
        ST10["Suffix Automaton.cpp"]:::file
        ST11["Z Function.cpp"]:::file
        ST_Module --> ST1
        ST_Module --> ST2
        ST_Module --> ST3
        ST_Module --> ST4
        ST_Module --> ST5
        ST_Module --> ST6
        ST_Module --> ST7
        ST_Module --> ST8
        ST_Module --> ST9
        ST_Module --> ST10
        ST_Module --> ST11
    end

    %% Module: Utilities
    subgraph "Module: Utilities"
        UT_Module["Utilities"]:::module
        UT1["Bits Manipulation.cpp"]:::file
        UT2["Random Integer.cpp"]:::file
        UT3["Split String.cpp"]:::file
        UT4["Template.cpp"]:::file
        UT5["scanf and printf.cpp"]:::file
        UT_Module --> UT1
        UT_Module --> UT2
        UT_Module --> UT3
        UT_Module --> UT4
        UT_Module --> UT5
    end

    %% Module: Values sequences and results
    subgraph "Module: Values sequences and results"
        VS_Module["Values sequences and results"]:::module
        VS1["ASCII Table.tex"]:::file
        VS2["Formulas.tex"]:::file
        VS3["Sequences.tex"]:::file
        VS4["Time Complexities.tex"]:::file
        VS_Module --> VS1
        VS_Module --> VS2
        VS_Module --> VS3
        VS_Module --> VS4
    end

    %% Click Events for Modules
    click DS_Module "https://github.com/programacioncompetitivaufps/notebook/tree/master/c++/Data structures"
    click DP_Module "https://github.com/programacioncompetitivaufps/notebook/tree/master/c++/Dynamic programming"
    click GEOM_Module "https://github.com/programacioncompetitivaufps/notebook/tree/master/c++/Geometry"
    click GR_Module "https://github.com/programacioncompetitivaufps/notebook/tree/master/c++/Graphs"
    click M_Module "https://github.com/programacioncompetitivaufps/notebook/tree/master/c++/Math"
    click MA_Module "https://github.com/programacioncompetitivaufps/notebook/tree/master/c++/Modular arithmetic"
    click NF_Module "https://github.com/programacioncompetitivaufps/notebook/tree/master/c++/Network flows"
    click ST_Module "https://github.com/programacioncompetitivaufps/notebook/tree/master/c++/Strings"
    click UT_Module "https://github.com/programacioncompetitivaufps/notebook/tree/master/c++/Utilities"
    click VS_Module "https://github.com/programacioncompetitivaufps/notebook/tree/master/c++/Values sequences and results"

    %% Styles
    classDef module fill:#f4a261,stroke:#000,stroke-width:2px;
    classDef file fill:#2a9d8f,stroke:#000,stroke-width:1px,stroke-dasharray: 3 3;
```
