{"id":22328091,"url":"https://github.com/umbrellaleaf5/graph_cpp","last_synced_at":"2026-02-14T16:33:54.033Z","repository":{"id":259906946,"uuid":"861913847","full_name":"UmbrellaLeaf5/graph_cpp","owner":"UmbrellaLeaf5","description":"Helper Graph class for C++ with CMake support","archived":false,"fork":false,"pushed_at":"2025-02-07T10:05:44.000Z","size":332,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-14T15:33:00.399Z","etag":null,"topics":["cmake","cpp","doxygen-documentation","graph"],"latest_commit_sha":null,"homepage":"https://umbrellaleaf5.github.io/graph_cpp/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UmbrellaLeaf5.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-23T17:58:25.000Z","updated_at":"2025-03-28T10:38:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"89885d06-6b8b-4527-a286-33432e3ae795","html_url":"https://github.com/UmbrellaLeaf5/graph_cpp","commit_stats":null,"previous_names":["umbrellaleaf5/graph_cpp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/UmbrellaLeaf5/graph_cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UmbrellaLeaf5%2Fgraph_cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UmbrellaLeaf5%2Fgraph_cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UmbrellaLeaf5%2Fgraph_cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UmbrellaLeaf5%2Fgraph_cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UmbrellaLeaf5","download_url":"https://codeload.github.com/UmbrellaLeaf5/graph_cpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UmbrellaLeaf5%2Fgraph_cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29449372,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cmake","cpp","doxygen-documentation","graph"],"created_at":"2024-12-04T03:11:36.217Z","updated_at":"2026-02-14T16:33:54.011Z","avatar_url":"https://github.com/UmbrellaLeaf5.png","language":"C++","readme":"# Graph_cpp: helper class for C++ with CMake support\n\n## Description\n\nIn the second year of my MIPT DAFE/RSE education, as part of the Algorithms and Data Structures course in C++, we studied graph algorithms. For writing these, a separate Graph class was required.\n\nAt that moment, a crazy idea came to my mind: \"What if I don't create a `Vertex` class, but create an `Edge` class and put it in the `private` field of the `Graph`?\". And so I set out...\n\nOver time, more and more such ideas emerged, and the lines of code grew at a doubled pace... And so this abnormal class was born, with eight static methods - pseudo-constructors, various auxiliary methods for deleting and searching for an edge or vertex, as well as templates for integer and string vertex types (more details - in the `examples` folder).\n\nSince the project uses CMake, it is easy to integrate it into projects with the same build system - just clone the project into one folder:\n```\ngit clone https://github.com/UmbrellaLeaf5/graph_cpp\n```\nor\n```\ngit submodule add https://github.com/UmbrellaLeaf5/graph_cpp\n```\nand import the subdirectory:\n```CMake\nadd_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/graph_cpp)\ntarget_link_libraries(project_name PUBLIC graph_cpp)\n```\n\n## Examples\n\n```C++\n#include \u003ciostream\u003e\n\n#include \"graph.hpp\"\n\nint main() {\n  std::cout \u003c\u003c std::endl\n            \u003c\u003c \"------------------------------\"\n               \"       Graph from pairs       \"\n               \"------------------------------\"\n            \u003c\u003c std::endl\n            \u003c\u003c std::endl;\n\n  std::vector\u003cstd::pair\u003csize_t, size_t\u003e\u003e edges_pairs = {{0, 1}, {1, 2}, {2, 0}};\n\n  auto graph = Graph\u003csize_t, long\u003e::GraphNonWeighted(edges_pairs);\n\n  std::cout \u003c\u003c \"Pairs: \" \u003c\u003c edges_pairs \u003c\u003c std::endl\n            \u003c\u003c std::endl\n            \u003c\u003c graph \u003c\u003c std::endl\n            \u003c\u003c std::endl;\n\n  graph.PrintAdjList();\n\n  return 0;\n}\n```\nOutput:\n```\n------------------------------       Graph from pairs       ------------------------------\n\nPairs: {{0; 1}; {1; 2}; {2; 0}}\n\nEdges:\n     {[0-\u003e1]; [1-\u003e2]; [2-\u003e0]}\nVertices:\n     {0; 1; 2}\n\n0: 1;\n1: 2;\n2: 0;\n\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumbrellaleaf5%2Fgraph_cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumbrellaleaf5%2Fgraph_cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumbrellaleaf5%2Fgraph_cpp/lists"}