# siavashk/lignum-vitae architecture

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

- Interactive diagram: https://gitdiagram.com/siavashk/lignum-vitae
- Repository: https://github.com/siavashk/lignum-vitae

## Overview

##### Project type and purpose
- This is a C++ library + example suite demonstrating graph traversals using the Boost Graph Library.
- The “core” folder contains graph‐related code and headers. The “examples” folder contains standalone executables (e.g., Dijkstra, generic graph) that link against the core code and Boost. CMake drives the build.

##### File structure
- Top-level:
- CMakeLists.txt – orchestrates the entire build.
- build/ – out-of-source build scripts (PrecompiledHeader.cmake).
- core/ – the reusable graph library (graphs.cpp/h, writegraph.h, precompiled header).
- examples/ – each example has its own CMakeLists, pch, and main.cpp.
- Each example is a separate CMake target that links core and Boost.
- Configuration files: CMakeLists at root and subfolders dictate dependencies and targets.

##### README
- Confirms CMake + Boost as only dependencies.
- No runtime services or networks—pure CLI builds and runs local graph demos.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build System
    subgraph "Build System"
        direction TB
        CMakeBuild["CMake Build System"]:::build
        RootCMake["Root CMakeLists.txt"]:::build
        PrecompiledHeaderCmake["PrecompiledHeader.cmake"]:::build
        CoreCMake["core/CMakeLists.txt"]:::build
        ExamplesCMake["examples/CMakeLists.txt"]:::build
        DjikstraCMake["examples/djikstra/CMakeLists.txt"]:::build
        GraphCMake["examples/graph/CMakeLists.txt"]:::build
    end

    %% Core Module
    subgraph "Core Graph Module"
        direction TB
        GraphsCpp["graphs.cpp"]:::module
        GraphsH["graphs.h"]:::module
        WriteGraphH["writegraph.h"]:::module
        PCHCpp["pch.cpp"]:::module
        PCHH["pch.h"]:::module
    end

    %% Examples
    subgraph "Examples"
        direction TB
        subgraph "Dijkstra Example"
            direction TB
            DjikMain["main.cpp"]:::example
            DjikPCHCpp["pch.cpp"]:::example
            DjikPCHH["pch.h"]:::example
        end
        subgraph "Generic Graph Example"
            direction TB
            GraphMain["main.cpp"]:::example
            GraphPCHCpp["pch.cpp"]:::example
            GraphPCHH["pch.h"]:::example
        end
    end

    %% External Dependency
    Boost["Boost Graph Library"]:::external

    %% Connections
    CMakeBuild -->|"drives build"| GraphsCpp
    CMakeBuild -->|"drives build"| DjikMain
    CMakeBuild -->|"drives build"| GraphMain
    GraphsCpp -->|"uses APIs from"| Boost

    %% Click Events
    click RootCMake "https://github.com/siavashk/lignum-vitae/blob/master/CMakeLists.txt"
    click PrecompiledHeaderCmake "https://github.com/siavashk/lignum-vitae/blob/master/build/PrecompiledHeader.cmake"
    click CoreCMake "https://github.com/siavashk/lignum-vitae/blob/master/core/CMakeLists.txt"
    click ExamplesCMake "https://github.com/siavashk/lignum-vitae/blob/master/examples/CMakeLists.txt"
    click DjikstraCMake "https://github.com/siavashk/lignum-vitae/blob/master/examples/djikstra/CMakeLists.txt"
    click GraphCMake "https://github.com/siavashk/lignum-vitae/blob/master/examples/graph/CMakeLists.txt"
    click GraphsCpp "https://github.com/siavashk/lignum-vitae/blob/master/core/graphs.cpp"
    click GraphsH "https://github.com/siavashk/lignum-vitae/blob/master/core/graphs.h"
    click WriteGraphH "https://github.com/siavashk/lignum-vitae/blob/master/core/writegraph.h"
    click PCHCpp "https://github.com/siavashk/lignum-vitae/blob/master/core/pch.cpp"
    click PCHH "https://github.com/siavashk/lignum-vitae/blob/master/core/pch.h"
    click DjikMain "https://github.com/siavashk/lignum-vitae/blob/master/examples/djikstra/main.cpp"
    click DjikPCHCpp "https://github.com/siavashk/lignum-vitae/blob/master/examples/djikstra/pch.cpp"
    click DjikPCHH "https://github.com/siavashk/lignum-vitae/blob/master/examples/djikstra/pch.h"
    click GraphMain "https://github.com/siavashk/lignum-vitae/blob/master/examples/graph/main.cpp"
    click GraphPCHCpp "https://github.com/siavashk/lignum-vitae/blob/master/examples/graph/pch.cpp"
    click GraphPCHH "https://github.com/siavashk/lignum-vitae/blob/master/examples/graph/pch.h"

    %% Styles
    classDef build fill:#f9f,stroke:#333,stroke-width:2px
    classDef module fill:#bbf,stroke:#333,stroke-width:2px
    classDef example fill:#bfb,stroke:#333,stroke-width:2px
    classDef external fill:#ffb,stroke:#333,stroke-width:2px
```
