{"id":15048062,"url":"https://github.com/bobluppes/graaf","last_synced_at":"2025-05-16T09:03:11.465Z","repository":{"id":166971387,"uuid":"595826707","full_name":"bobluppes/graaf","owner":"bobluppes","description":"A general-purpose lightweight C++ graph library","archived":false,"fork":false,"pushed_at":"2025-04-30T20:02:58.000Z","size":3751,"stargazers_count":280,"open_issues_count":14,"forks_count":48,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-30T21:20:08.172Z","etag":null,"topics":["algorithm","algorithms","bfs","bfs-algorithm","cpp","cpp-library","cpp20","dfs","dfs-algorithm","graph","graph-algorigthms","header-only","header-only-library","search-algorithm","shortest-path-algorithm"],"latest_commit_sha":null,"homepage":"https://bobluppes.github.io/graaf/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bobluppes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-31T22:14:33.000Z","updated_at":"2025-04-30T20:02:55.000Z","dependencies_parsed_at":"2023-12-27T22:30:21.256Z","dependency_job_id":"8dcfdbfb-efc9-4191-bcdb-8d0167e64ceb","html_url":"https://github.com/bobluppes/graaf","commit_stats":{"total_commits":191,"total_committers":22,"mean_commits":8.681818181818182,"dds":0.4973821989528796,"last_synced_commit":"4dbde3d19c8b55375ee8fabcbf75a378be588263"},"previous_names":["bobluppes/graaf"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobluppes%2Fgraaf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobluppes%2Fgraaf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobluppes%2Fgraaf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobluppes%2Fgraaf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bobluppes","download_url":"https://codeload.github.com/bobluppes/graaf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254501555,"owners_count":22081528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","algorithms","bfs","bfs-algorithm","cpp","cpp-library","cpp20","dfs","dfs-algorithm","graph","graph-algorigthms","header-only","header-only-library","search-algorithm","shortest-path-algorithm"],"created_at":"2024-09-24T21:07:35.041Z","updated_at":"2025-05-16T09:03:11.413Z","avatar_url":"https://github.com/bobluppes.png","language":"C++","funding_links":[],"categories":["Graph"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"docs/static/img/graaf.png\"\u003e\u003c/p\u003e\n\u003ch1 align=\"center\"\u003eGraaf Library\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  Graaf is a general-purpose header-only graph library implemented in C++. It is designed as a lightweight alternative to the \u003ca href=\"https://www.boost.org/doc/libs/1_82_0/libs/graph/doc/index.html\"\u003eBoost Graph Library (BGL)\u003c/a\u003e.\n\u003c/p\u003e\n\n\u003cbr/\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/bobluppes/graaf/actions/workflows/main-ci.yml\"\u003e\u003cimg src=\"https://github.com/bobluppes/graaf/actions/workflows/main-ci.yml/badge.svg\" height=\"20\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://codecov.io/github/bobluppes/graaf\"\u003e\u003cimg src=\"https://codecov.io/github/bobluppes/graaf/branch/main/graph/badge.svg?token=ZFBLNFN39C\" height=\"20\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://bobluppes.github.io/graaf/\"\u003e\u003cimg src=\"https://img.shields.io/badge/user_docs-docusaurus-%23ff69b4\" height=\"20\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/bobluppes/graaf/wiki\"\u003e\u003cimg src=\"https://img.shields.io/badge/contributer_docs-wiki-9cf\" height=\"20\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://discord.gg/cGczwRHJ9K\"\u003e\u003cimg src=\"https://img.shields.io/badge/chat-discord-%237289DA?style=flat\u0026logo=discord\u0026labelColor=white\" height=\"20\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://GitHub.com/bobluppes/graaf/releases/\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/bobluppes/graaf?color=%23F7DE3A\u0026include_prereleases\"\u003e\u003c/a\u003e\n  \u003ca href=\"LICENSE.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-black\" height=\"20\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\n\u003c/p\u003e\n\n# About\n\nGraph is an abstract data type that is widely used in computer science. It is a collection of vertices (nodes) and edges\nthat connect these vertices. Graphs are used to model many real-world problems, such as social networks, road networks,\nand computer networks. As such, graph algorithms are used in many applications, including route planning, network\nanalysis, and data mining.\n\nGraaf: A Lightweight, Header-Only C++20 Graph Library\n\n**Key Features**:\n\n- **Header-only**: No separate compilation or linking required.\n- **Generality**: Supports user-defined vertex and edge classes.\n- **Algorithm Support**: Provides a range of graph algorithms.\n\n**Purpose**:\nGraaf is designed with the goal of simplifying graph-related tasks. It offers a lightweight alternative to the [Boost Graph Library (BGL)](https://www.boost.org/doc/libs/1_82_0/libs/graph/doc/index.html) and is built for simplicity and extensibility. With Graaf, you can easily create, manipulate, and analyze graphs, making it suitable for a wide range of applications.\n\n# Installation\n\nThe most straightforward way to use the Graaf in your project is to include it as a header-only library. Please take a\nlook at the [installation guide](https://bobluppes.github.io/graaf/docs/quickstart/installation) for alternative\ninstallation methods.\n\n## Header-Only Library\n\nThe Graaf libary can be included as a header-only library. All it requires is a compiler with **C++ 20 support**.\n\nDownload the `header-only` library from our [release page](https://github.com/bobluppes/graaf/releases) and add\nthe `include/graaflib` directory to your include path. You can now use Graaf in your source files:\n\n```c++\n// main.cpp\n#include \u003cgraaflib/directed_graph\u003e\n```\n\nFor more details or alternative installation methods, see\nthe [installation guide](https://bobluppes.github.io/graaf/docs/quickstart/installation).\n\n# How to use Graaf\n\nUsing the Graaf library is easy! Specializations are provided for a `directed_graph` as well as for `undirected_graph`.\nTo create your first graph:\n\n```c++\nundirected_graph\u003cint, float\u003e my_graph{};\n```\n\nThis creates an undirected graph with `integer` values on the vertices and `float` weights on the edges. Graaf is\ndesigned with generality in mind. As such, it can be used to store any user-defined vertex and edge class:\n\n```c++\nstruct User {\n  std::string name;\n  int age;\n};\n\n// An edge type can also be unweighted if we don't derive from weighted_edge\nstruct Connection : public weighted_edge\u003cfloat\u003e {\n  float strength;\n  float get_weight() const override { return strength; }\n};\n\nundirected_graph\u003cUser, Connection\u003e my_graph{};\n```\n\nImplementations for common [graph algorithms](#algorithms) are provided under the `algorithm` namespace. Combining this\nwith built-in `dot` format support allows us to do things like visualizing the shortest path between two vertices:\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/static/img/graph_example.png\"\u003e\n\u003c/p\u003e\n\nTo get started, take a look at our [quickstart guide](https://bobluppes.github.io/graaf/docs/quickstart/intro).\n\n# Algorithms\n\nAlgorithms implemented in the Graaf library include the following. For more information on individual algorithms please\ntake a look at the [docs](https://bobluppes.github.io/graaf/docs/algorithms/intro).\n\n1. [**Cycle Detection Algorithms**](https://bobluppes.github.io/graaf/docs/category/cycle-detection-algorithms):\n   - [DFS-Based Cycle Detection](https://bobluppes.github.io/graaf/docs/algorithms/cycle-detection/dfs-based)\n2. [**Graph Coloring Algorithms**](https://bobluppes.github.io/graaf/docs/category/graph-coloring-algorithms):\n   - [Greedy Graph Coloring](https://bobluppes.github.io/graaf/docs/algorithms/coloring/greedy-graph-coloring)\n   - [Welsh-Powell Algorithm]\n3. [**Minimum Spanning Tree (MST) Algorithms**](https://bobluppes.github.io/graaf/docs/category/minimum-spanning-tree)\n   - [Kruskal's Algorithm](https://bobluppes.github.io/graaf/docs/algorithms/minimum-spanning-tree/kruskal)\n   - [Prim's Algorithm](https://bobluppes.github.io/graaf/docs/algorithms/minimum-spanning-tree/prim)\n4. [**Shortest Path Algorithms**](https://bobluppes.github.io/graaf/docs/category/shortest-path-algorithms):\n   - [A\\* search](https://bobluppes.github.io/graaf/docs/algorithms/shortest-path/a-star)\n   - [Bellman-Ford Shortest Path](https://bobluppes.github.io/graaf/docs/algorithms/shortest-path/bellman-ford)\n   - [BFS-Based Shortest Path](https://bobluppes.github.io/graaf/docs/algorithms/shortest-path/bfs-based-shortest-path)\n   - [Dijkstra Shortest Path](https://bobluppes.github.io/graaf/docs/algorithms/shortest-path/dijkstra)\n   - [Floyd-Warshall Algorithm](https://bobluppes.github.io/graaf/docs/algorithms/shortest-path/floyd-warshall)\n5. [**Strongly Connected Components Algorithms**](https://bobluppes.github.io/graaf/docs/category/strongly-connected-component-algorithms):\n   - [Tarjan's Strongly Connected Components](https://bobluppes.github.io/graaf/docs/algorithms/strongly-connected-components/tarjan)\n   - [Kosaraju's Strongly Connected Components](https://bobluppes.github.io/graaf/docs/algorithms/strongly-connected-components/kosarajus)\n6. [**Topological Sorting Algorithms**](https://bobluppes.github.io/graaf/docs/algorithms/topological-sort):\n7. [**Traversal Algorithms**](https://bobluppes.github.io/graaf/docs/category/traversal-algorithms):\n   - [Breadth-First Search (BFS)](https://bobluppes.github.io/graaf/docs/algorithms/traversal/breadth-first-search)\n   - [Depth-First Search (DFS)](https://bobluppes.github.io/graaf/docs/algorithms/traversal/depth-first-search)\n8. [**Clique Detection**](https://bobluppes.github.io/graaf/docs/category/clique-detection)\n    - [Bron-Kerbosch](https://bobluppes.github.io/graaf/docs/algorithms/clique-detection/bron-kerbosch)\n\n# Contributing\n\nThe Graaf library welcomes contributions 🎊\n\nIf you're interested in improving, fixing bugs, or adding features, please refer to\nthe [wiki](https://github.com/bobluppes/graaf/wiki) for guidelines and have your [development environment set up](https://github.com/bobluppes/graaf/wiki/development-setup) before you start. Check out our roadmap\non [YouTrack](https://graaf.youtrack.cloud/agiles/147-2/current) to stay up to date on planned features and\nimprovements. We also have an [issue tracker](https://github.com/bobluppes/graaf/issues) for bug reports and feature\nrequests.\n\nFeel free to join our [Discord](https://discord.gg/cGczwRHJ9K) for assistance and a smooth contribution experience.\n\n### Contributors\n\n\u003ca href=\"https://github.com/bobluppes/graaf/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=bobluppes/graaf\" /\u003e\n\u003c/a\u003e\n\n# Acknowledgements\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://www.jetbrains.com\"\u003e\n    \u003cimg src=\"docs/static/img/jetbrains-logo.svg\" width=\"60\" alt=\"JetBrains Logo\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nSpecial thanks to [JetBrains](https://www.jetbrains.com/community/opensource/) for providing development tools for this\nproject.\n\n# License\n\nThis project is licensed under the [MIT license](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobluppes%2Fgraaf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbobluppes%2Fgraaf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobluppes%2Fgraaf/lists"}