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, and visualization.
- π 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.
- Integrated Visualization - An integrated SFML-based engine for real-time graph rendering, making it easy to visualize your data.
- 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::PeakStore;
using namespace CinderPeak;
// Custom vertex & edge
class CustomVertex : public CinderVertex {
public:
int data;
CustomVertex(int d = 0) : data(d) {}
};
class CustomEdge : public CinderEdge {
public:
int weight;
CustomEdge(int w = 0) : weight(w) {}
};
int main() {
GraphCreationOptions opts({
GraphCreationOptions::Undirected,
GraphCreationOptions::Weighted
});
// --- Custom Types ---
GraphMatrix<CustomVertex, CustomEdge> customGraph(opts);
CustomVertex A(1), B(2);
customGraph.addVertex(A);
customGraph.addVertex(B);
customGraph[A][B] = CustomEdge(1290);
std::cout << "CustomGraph Edge Weight: "
<< customGraph.getEdge(A, B).weight << "\n";
// --- Primitive Types ---
GraphMatrix<int, int> intGraph(opts);
intGraph.addVertex(1);
intGraph.addVertex(2);
intGraph.addEdge(1, 2, 10);
std::cout << "IntGraph Edge Weight: " << intGraph[1][2] << "\n";
return 0;
}
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.
/CinderPeak
βββ CMakeLists.txt # Build system configuration
βββ docs # Docusaurus documentation
β βββ examples
β β βββ GraphMatrixExample.md # Example usage for GraphMatrix
β βββ GraphList.md # Adjacency List documentation
β βββ GraphMatrix.md # Adjacency Matrix documentation
β βββ index.md # Main documentation page
β βββ installation.md # Installation guide
β βββ usage.md # Usage guide
βββ examples # Sample code demonstrating usage
β βββ CMakeLists.txt # Build config for examples
β βββ extras
β β βββ COOExample.cpp # Coordinate List example
β β βββ CSRExample.cpp # Compressed Sparse Row example
β β βββ LogExample.cpp # Logging utility example
β β βββ PeakExample.cpp # General CinderPeak usage example
β βββ ListExample1.cpp # Adjacency List example
β βββ MatrixExample.cpp # Adjacency Matrix example
β βββ PrimitiveGraph.cpp # Basic graph example
βββ src # Source files
β βββ ArialFontDataEmbed.hpp # Embedded font data for visualization
β βββ CinderExceptions.hpp # Custom exception handling
β βββ CinderPeak.hpp # Main API entry point
β βββ GraphList.hpp # Adjacency List implementation
β βββ GraphMatrix.hpp # Adjacency Matrix implementation
β βββ PeakLogger.hpp # Logging utility
β βββ PeakStore.hpp # Core storage engine
β βββ StorageEngine
β β βββ AdjacencyList.hpp # Adjacency List storage
β β βββ CoordinateList.hpp # Coordinate List storage
β β βββ ErrorCodes.hpp # Error handling codes
β β βββ GraphContext.hpp # Graph context management
β β βββ HybridCSR_COO.hpp # Hybrid CSR/COO storage
β β βββ Utils.hpp # Utility functions
β βββ StorageInterface.hpp # Storage interface definition
β βββ Visualizer.hpp # SFML-based visualization engine
βββ tests # Unit tests
β βββ AdjacencyShard.cpp # Tests for adjacency list
β βββ CoordinateShard.cpp # Tests for coordinate list
β βββ HybridShard.cpp # Tests for hybrid CSR/COO
β βββ tests.cpp # Main test suite
βββ README.md # Project overview and setup
βββ LICENSE # License file
- 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.
- SFML: Powers the integrated visualization engine.
- 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 visualizing 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.