# michaelidan/sys_pro_2_ex1_2_april architecture

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

- Interactive diagram: https://gitdiagram.com/michaelidan/sys_pro_2_ex1_2_april
- Repository: https://github.com/michaelidan/sys_pro_2_ex1_2_april

## Overview

##### Project type and purpose
- This is a C++ library + CLI demo for an undirected weighted graph data structure (adjacency‐list) implemented without STL, plus classical graph algorithms (BFS, DFS, Dijkstra, Prim, Kruskal).
- It also includes a console “main” driver and a unit‐test harness based on doctest.

##### File structure
Top‐level files & directories:
- Graph.h/.cpp – the graph core
- DataStructures.h/.cpp – supporting DS (Queue, PriorityQueue, UnionFind)
- Algorithms.h/.cpp – implements BFS, DFS, Dijkstra, Prim, Kruskal over Graph
- main.cpp – demo application
- tests.cpp + doctest.h – unit tests
- Makefile – build & run scripts

Architectural patterns:
- Core library modules with clear dependency chain: DataStructures → Graph → Algorithms
- Two “clients” of the library: main app and the test suite
- Build orchestration via Makefile

##### README for additional insights
- All DS are home‐grown (no std::vector, no std::queue)
- Algorithms return new Graph instances (trees or shortest‐paths)
- Test suite uses doctest.h; Makefile supports build/test/valgrind

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Core Library"
        DS["DataStructures\n(Queue, PriorityQueue, UnionFind)"]:::core
        Graph["Graph\n(adjacency-list)"]:::core
        Algo["Algorithms\n(BFS, DFS, Dijkstra, Prim, Kruskal)"]:::core
    end

    subgraph "Clients"
        CLI["main.cpp\n(CLI Demo)"]:::client
        Tests["tests.cpp\n(Unit Tests)"]:::client
        Doc["doctest.h"]:::external
    end

    Build["Makefile"]:::build
    Readme["README.md"]:::external

    DS -->|include| Graph
    Graph -->|include| Algo
    Graph -->|used by| CLI
    Algo -->|used by| CLI
    Graph -->|tested by| Tests
    Algo -->|tested by| Tests
    Doc -->|test framework| Tests

    Build -->|builds| CLI
    Build -->|builds| Tests

    click DS "https://github.com/michaelidan/sys_pro_2_ex1_2_april/blob/main/DataStructures.h"
    click Graph "https://github.com/michaelidan/sys_pro_2_ex1_2_april/blob/main/Graph.h"
    click Algo "https://github.com/michaelidan/sys_pro_2_ex1_2_april/blob/main/Algorithms.h"
    click CLI "https://github.com/michaelidan/sys_pro_2_ex1_2_april/blob/main/main.cpp"
    click Tests "https://github.com/michaelidan/sys_pro_2_ex1_2_april/blob/main/tests.cpp"
    click Doc "https://github.com/michaelidan/sys_pro_2_ex1_2_april/blob/main/doctest.h"
    click Build "https://github.com/michaelidan/sys_pro_2_ex1_2_april/tree/main/Makefile"
    click Readme "https://github.com/michaelidan/sys_pro_2_ex1_2_april/blob/main/README.md"

    classDef core fill:#D0E6FF,stroke:#0366d6,color:#0366d6
    classDef client fill:#E6FFED,stroke:#28a745,color:#28a745
    classDef build fill:#F0F0F0,stroke:#6a737d,color:#6a737d
    classDef external fill:#FFF5B1,stroke:#dbab09,color:#735C0F
```
