Loading repository data…
Loading repository data…
SharonIV0x86 / repository
CinderPeak is a fast and efficient, open-source C++ graph library designed to handle directed, undirected, and mixed graphs with customizable vertex and edge types.
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.
#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) ---
CinderGraph<MyVertex, MyEdge> customGraph(optsU);
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});
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.
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.