December 1st, 2008, 12:20 AM
how to construct directed graph in c++
I need to construct a directed graph in c++. I need to add keywords as nodes and represent phrases (of words) with the edges. But I dont know what data structures to use and how I can implement this.
Can anyone please help me or give any pointers to available graph libraries?
December 1st, 2008, 12:48 AM
Re: how to construct directed graph in c++
The 2 most common data structures used to represent graphs are Adjacency Matrix and Adjacency List.
Each has it's own upsides and downsides (in terms of operations complexity and space (memory) complexity), but both are very easy to implement.
There are numerous libraries that include a graph class.
One of them that I can think of immediately is Boost. Search the web - you'll find plenty of resources by yourself.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.