A fast and efficient, open-source C++ graph library built to handle a wide range of graph types. It provides a flexible, templated API for graph manipulation, analysis.
A fast and efficient, open-source C++ graph library built to handle a wide range of graph types. It provides a flexible, templated API for graph manipulation and analysis.
- 🚀 Key Features
- 🗓️ Development Notice
- 📂 Project Structure
- ⚙️ Getting Started
- 🛠️ Technology Stack
- ❓ Why CinderPeak?
- 🧑💻 Community & Contributions
- 📄 License
- Flexible Graph Representations - Supports adjacency lists, adjacency matrices, and hybrid CSR/COO formats for efficient storage.
- Customizable & Templated - Fully templated design allows you to define custom vertex and edge types.
- Thread Safety - Designed to work seamlessly in multi-threaded applications.
- High Performance - Leverages modern C++ features like smart pointers and STL containers for optimized execution.
- Comprehensive Testing - Built with Google Test (GTest) to ensure reliability and robustness.
- Extensive Documentation - Detailed usage guides, examples, and API references are hosted with Docusaurus.
#include <iostream>
#include "CinderPeak.hpp"
using namespace CinderPeak;
// Custom vertex/edge types
struct MyVertex : CinderPeak::CinderVertex {
int id;
MyVertex(int id) : id(id) {}
};
struct MyEdge : CinderPeak::CinderEdge {
float w;
MyEdge(float w) : w(w) {}
};
int main() {
// --- Complex Graph (custom vertex + weighted edge) ---
GraphCreationOptions optsU({GraphCreationOptions::Undirected});
PolicyConfiguration cfg(PolicyConfiguration::Throw,
PolicyConfiguration::Silent);
CinderGraph<MyVertex, MyEdge> customGraph(optsU, cfg);
MyVertex v1(1);
MyVertex v2(2);
MyEdge e1(0.5f);
MyEdge e2(0.8f);
customGraph.addVertex(v1);
customGraph.addVertex(v2);
customGraph.addEdge(v1, v2, e1);
customGraph.updateEdge(v1, v2, e2);
// --- Simple Weighted Graph (int vertices/edges) ---
GraphCreationOptions optsD({GraphCreationOptions::Directed});
PolicyConfiguration cfg(PolicyConfiguration::Throw,
PolicyConfiguration::LogConsole);
CinderGraph<int, int> intGraph(optsD);
intGraph.addVertex(1);
intGraph.addVertex(2);
intGraph.addEdge(1, 2, 10);
intGraph.updateEdge(1, 2, 20);
std::cout << "Vertices: " << intGraph.numVertices()
<< ", Edges: " << intGraph.numEdges() << "\n";
// --- Unweighted Graph ---
CinderGraph<int, Unweighted> unweighted(optsD);
unweighted.addVertex(1);
unweighted.addVertex(2);
unweighted.addEdge(1, 2);
}CinderPeak is currently under active development. We are committed to delivering a polished and comprehensive release. The stable version, with refined functionalities and complete documentation, is scheduled to be available soon.
- Installation: Follow the installation guide to set up CinderPeak with CMake.
- Usage: Check the usage guide for API details and the examples directory for sample code.
- Documentation: Explore the full documentation hosted with Docusaurus in the docs directory.
- C++17/C++20: Leverages modern C++ features for performance and flexibility.
- Google Test: Provides the framework for robust unit testing.
- Docusaurus: Hosts comprehensive documentation with examples and API references.
- CMake: Used for the cross-platform build system.
CinderPeak strikes a balance between performance, flexibility, and ease of use. Whether you're building complex network models, analyzing graph-based data, or managing relationships, CinderPeak provides a robust and intuitive solution. Its open-source nature encourages community contributions, and its modular design makes it easy to extend for specialized use cases.
We welcome contributions! See the CONTRIBUTING.md file for guidelines on how to get involved. Join the CinderPeak community on GitHub to report issues, suggest features, or contribute code.
This project is licensed under the MIT License.