Header-Only C++ Library for Graph Representation and Algorithms
Header-Only C++ Library for Graph Representation and Algorithms
CXXGraph is a comprehensive C++ library that manages graph algorithms. This header-only library serves as an alternative to the Boost Graph Library (BGL).
| Completed | Description | Date of Completition |
|---|---|---|
| :heavy_check_mark: | Release 0.4.0 | Oct 7, 2022 |
| :heavy_check_mark: | Release 0.5.0 | Mar 23, 2023 |
| :heavy_check_mark: | First Stable Release 1.0.0 | Mar 28, 2023 |
| :heavy_check_mark: | Release 1.0.1 | May 7, 2023 |
| :heavy_check_mark: | Release 1.1.0 | May 8, 2023 |
| :heavy_check_mark: | Stable Release 2.0.0 | Jun 1, 2023 |
| :heavy_check_mark: | Stable Release 3.0.0 | Nov 3, 2023 |
| :heavy_check_mark: | Release 3.1.0 | Jan 9, 2023 |
| :heavy_check_mark: | Release 4.0.0 | Jun 20, 2024 |
| :heavy_check_mark: | Release 4.1.0 | Jun 21, 2024 |
| :heavy_check_mark: | Introduce Hypergraph #122 | Mar 16, 2026 |
| :memo: | Stable Release 5.0.0 | TBD |
| CXXGraph ✅ | Boost Graph ❌ | |
|---|---|---|
| Setup time | Seconds | Minutes–Hours |
| API readability | High | Low |
| Boilerplate | Minimal | Heavy |
| Modern C++ style | Yes | Mixed/Legacy |
| Learning curve | Low | High |
CXXGraph focuses on developer experience first.
To install on Unix/Linux systems, execute the following from the command line:
$ sudo tar xjf CXXGraph-{version}.tar.bz2
To uninstall:
$ sudo rm -f /usr/include/Graph.hpp /usr/include/CXXGraph*
To install on Fedora/CentOS/RedHat systems, execute the following from the command line:
$ sudo rpm -ivh CXXGraph-{version}.noarch.rpm
To uninstall:
$ sudo rpm -e CXXGraph-{version}
To install on Debian/Ubuntu systems, execute the following from the command line:
$ sudo dpkg -i CXXGraph_{version}.deb
To uninstall:
$ sudo apt-get remove CXXGraph
For self-compiled installations using CMake, execute the following from the command line once compilation is complete:
$ sudo make install
To use the library, simply include the CXXGraph/CXXGraph.hpp file at the top of your file.
While compiling the file, include the two include paths mentioned in the To compile and run the program section in the command.
CXXGraph revolves around the graph object which contains nodes and edges. This object can then be manipulated with a wide variety of algorithms. Please see the examples section, examples folder and website for more information
In this example file example.cpp, the shortest path between nodeA and nodeC is obtained using Dijkstra's algorithm.
$ mkdir folder
$ cd folder
$ touch example.cpp Paste the below code into example.cpp
#include
#include "CXXGraph/CXXGraph.hpp"
int main(){
CXXGraph::Node nodeA("A", 1);
CXXGraph::Node nodeB("B", 2);
CXXGraph::Node nodeC("C", 3);
CXXGraph::DirectedWeightedEdge edge1("1", nodeA, nodeB, 1);
CXXGraph::DirectedWeightedEdge edge2("2", nodeB, nodeC, 1);
CXXGraph::UndirectedWeightedEdge edge3("3", nodeA, nodeC, 6);
CXXGraph::T_EdgeSet edgeSet;
edgeSet.insert(std::make_shared(edge1));
edgeSet.insert(std::make_shared(edge2));
edgeSet.insert(std::make_shared(edge3));
CXXGraph::Graph graph(edgeSet);
CXXGraph::DijkstraResult res = graph.dijkstra(nodeA, nodeC);
for(auto node_user_id : res.path){
std::cout
[GitHub Profile](https://github.com/ZigRazor)
## Support
To support me, add a ***Star*** to the project [](https://GitHub.com/ZigRazor/CXXGraph/stargazers/) or ***follow me*** [](https://github.com/ZigRazor?tab=followers)
To stay updated, ***watch*** the project [](https://GitHub.com/ZigRazor/CXXGraph/watchers/)
## References
We are referenced by:
- [awesome-hpp](https://github.com/p-ranav/awesome-hpp)
- [cppreference.com](https://en.cppreference.com/w/cpp/links/libs)
- [awesome-cpp](https://github.com/fffaraz/awesome-cpp)
## Credits
Thanks to the community of [TheAlgorithms](https://github.com/TheAlgorithms) for some algorithm inspiration.
Thanks to [GeeksForGeeks](https://www.geeksforgeeks.org/) for some algorithm inspiration.
## Contributors
Thank you to all the people who have already contributed to CXXGraph!
## Cited By
- Ruizhe Wang, Meng Xu, and N. Asokan. 2024. SeMalloc: Semantics-Informed Memory Allocator. In Proceedings of the 2024 on ACM SIGSAC Conference on Computer and Communications Security (CCS '24). Association for Computing Machinery, New York, NY, USA, 1375–1389.
## Cite Us
If you use this software please follow the [CITATION](https://github.com/ZigRazor/CXXGraph/blob/master/CITATION) instructions.
Thank you!
## Other Details
We participated in Hacktoberfest 2021, 2022 and 2023. Thank you to all the contributors!
View the [Estimated Value of the Project](https://www.openhub.net/p/CXXGraph/estimated_cost)
## Author
| [
@ZigRazor](https://github.com/ZigRazor) |
|:----:|No open issues yet, or sync has not completed.