Skip to content

Commit 15d40d0

Browse files
committed
index rewrite
1 parent 356094e commit 15d40d0

1 file changed

Lines changed: 66 additions & 1 deletion

File tree

docs/index.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,69 @@
2121

2222
## Overview
2323

24-
{% include-markdown "../README.md" start="## Overview" %}
24+
CPP-GL is a highly customizable, intuitive, and concept-driven graph and hypergraph library designed for modern C++ standards.
25+
26+
Designed strictly around modern C++ paradigms, the library heavily leverages templates and concepts to deliver an API that is exceptionally fast, generic, and type-safe. It relies solely on the C++ standard library, meaning it requires no external dependencies and integrates perfectly with modern C++ tools such as range-based loops, the `<ranges>` library, standard algorithms, stream operations and more.
27+
28+
## Module Architecture: GL vs. HGL
29+
30+
To accommodate different mathematical models without compromising API clarity or performance, the library is strictly partitioned into two primary modules:
31+
32+
- **GL (Graph Library):** The core module dedicated to standard graphs. It handles both directed and undirected topologies where edges represent connections between two vertices. It provides a comprehensive suite of utilities including structural generators, graph modifiers, and a broad spectrum of classical graph algorithms.
33+
- **HGL (Hypergraph Library):** A specialized module dedicated to hypergraphs, where a single hyperedge represent higher-order connections. It features generalized traversal algorithms and incidence-based memory models tailored for complex, multi-way relationships.
34+
35+
## GL: Core Features
36+
37+
- **Unified API:** The `gl::graph` class offers a single, consistent interface that completely abstracts away the underlying data structures. Users can seamlessly swap between different backend representations without needing to rewrite any of their traversal logic, property accesses, or algorithm calls.
38+
- **Flexible Memory Layouts:** The library provides a comprehensive suite of memory-efficient representations tailored to different graph types and access patterns. Users can choose between standard container-based layouts (Adjacency Lists and Matrices) and highly optimized, cache-friendly contiguous array structures (Flat Lists and Flat Matrices).
39+
- **Customizable Element Properties:** Vertices and edges can carry arbitrary, user-defined payloads. Whether you are assigning standard metric weights and colors or attaching complex, application-specific data structures, the library's traits system ensures that property injection and access remain strictly type-safe and performant.
40+
- **Zero-Cost Abstractions:** By relying on C++20 concepts instead of virtual interfaces and dynamic dispatch, CPP-GL eliminates vtable overhead while enforcing strict compile-time contracts.
41+
- **Extensible Engines & Concrete Algorithms:** CPP-GL features a dual-layered algorithmic architecture. At its core, it provides highly generic search templates (such as BFS, DFS and Priority-First Search) that act as foundational engines, allowing users to build entirely new algorithms by injecting custom callbacks. Built upon these engines is a robust suite of concrete, ready-to-use algorithms for immediate application.
42+
- **Robust I/O Facilities:** Built-in serialization and formatting tools allow for seamless translation of in-memory graphs to and from standard streams and files, utilizing a shared global state for consistent formatting.
43+
44+
## Installation & Integration
45+
46+
CPP-GL is a header-only template library. You can integrate it into your project either by directly including the headers or via CMake.
47+
48+
### Option A: CMake `FetchContent` (Recommended)
49+
50+
The easiest way to integrate CPP-GL is to fetch it directly from the GitHub repository during your CMake configuration phase:
51+
52+
```cmake
53+
cmake_minimum_required(VERSION 3.14)
54+
project(my_project LANGUAGES CXX)
55+
56+
include(FetchContent)
57+
58+
FetchContent_Declare(
59+
cpp-gl
60+
GIT_REPOSITORY [https://github.com/SpectraL519/cpp-gl.git](https://github.com/SpectraL519/cpp-gl.git)
61+
GIT_TAG <tag> # Spcify the desired version tag, branch, or specific commit
62+
)
63+
64+
FetchContent_MakeAvailable(cpp-gl)
65+
66+
add_executable(my_project main.cpp)
67+
68+
set_target_properties(my_project PROPERTIES
69+
CXX_STANDARD 23 # (1)!
70+
CXX_STANDARD_REQUIRED YES
71+
)
72+
73+
target_link_libraries(my_project PRIVATE cpp-gl)
74+
```
75+
76+
1. The CPP-GL library requires C++23
77+
78+
### Option B: CMake `find_package`
79+
80+
If you have already downloaded or installed the library locally, you can add the <cpp-gl-root>/include path to your system and link it using `find_package`:
81+
82+
```cmake
83+
find_package(cpp-gl REQUIRED)
84+
target_link_libraries(my_project PRIVATE cpp-gl::cpp-gl)
85+
```
86+
87+
### Option C: Including the Headers Directly
88+
89+
If you do not wish to use CMake, you can simply download the desired version of the library from the [Releases Page](https://github.com/SpectraL519/cpp-gl/releases) and add the `include` directory of the library to your project via the `-I<cpp-gl-dir>/include` flag.

0 commit comments

Comments
 (0)