CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2007
    Posts
    5

    how to construct directed graph in c++

    Hi all,

    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?

    Thanks

  2. #2
    Join Date
    Oct 2006
    Posts
    616

    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.

    Regards,
    Zachm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured