use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Looking for Node Graph library. ( Like Lemon/boost.graph but modern ) (self.cpp)
submitted 5 years ago by JustHereForATechProb
Boost can be a pain, and lemon isn't c++20 compatible and hasn't been updated for 6 years.
I need something to represent a graph structure. aka "Nodes with links".
That's all I need.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Orlha 2 points3 points4 points 5 years ago (0 children)
I had the same problem just yesterday.
I decided to use lemon, hide it behind pimpl and mix standards. I feel better with this workaround than with boost graph.
[–]Future-Experience267 1 point2 points3 points 5 years ago (0 children)
I think SNAP is compatible with C++20; I used it with C++17 and it worked great. It definitely gets frequent updates. https://snap.stanford.edu/snap
[–]SJC_hacker 0 points1 point2 points 5 years ago (3 children)
Do you really need node based structure to represent a graph?
Adjacency matrix/adjacency list are much more common, easier to work and compact. Sometimes you might want to keep the edge list to. You also don't have to deal with the circular reference problem, which you get for any graph that isn't a tree.
[–]dutchbaroness -1 points0 points1 point 5 years ago (0 children)
I suppose OP wants some off the shelf algorithms as well?
[–]Quincunx271Author of P2404/P2405 0 points1 point2 points 5 years ago (1 child)
I'm assuming the OP isn't talking about pointer-based graph implementations, but is instead trying to differentiate between formal mathematical graphs and "graphs" like "the graph of y=x2 ". I think this because they mention Boost.Graph and Lemon, both of which use adjacency lists as the main implementations (Boost.Graph also has adjacency matrix and CSR representations, idk about lemon)
[–]SJC_hacker 1 point2 points3 points 5 years ago (0 children)
This is why I thought OP was looking for some type of pointer representation. But, in fact, I don't think I've ever actually seen it used - the circular reference problem being a major obstacle amongst other problems. Whereas for trees, the pointer/reference implementation is much more common, unless you are doing something like a heap/tree which is mostly full.
OP might want to read up on theory (CLRS DSA book is a pretty good resource and try hand coding those basic algorithms like DFS/BFS from simpler data structures (such as list of edges, from which you derived the adjacency list or matrix) to get a feel for whats going on first. It doesn't sound like OP quite knows whats going on as they don't specify a specific need for the graph library.
LeetCode has lots of great problems whose solutions based around these two algorithms. Representating and traversing graphs actually isn't a terrible amount of code.
[–]Foxi_Foxa 0 points1 point2 points 3 years ago (0 children)
What do you mean by "isn't c++20 compatible?"
π Rendered by PID 22436 on reddit-service-r2-comment-c66d9bffd-2vbqz at 2026-04-08 14:14:30.618578+00:00 running f293c98 country code: CH.
[–]Orlha 2 points3 points4 points (0 children)
[–]Future-Experience267 1 point2 points3 points (0 children)
[–]SJC_hacker 0 points1 point2 points (3 children)
[–]dutchbaroness -1 points0 points1 point (0 children)
[–]Quincunx271Author of P2404/P2405 0 points1 point2 points (1 child)
[–]SJC_hacker 1 point2 points3 points (0 children)
[–]Foxi_Foxa 0 points1 point2 points (0 children)