Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Need help in creating an adjacency graph
Forum Updated to NodeBB v4.3 + New Features

Need help in creating an adjacency graph

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 1.3k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Codeseeker
    wrote on last edited by
    #1

    Hi everyone,
    I need to create an adjacency graph and find the shortest path using Boost library (BGL) ! I'm a complete amateur and it's a huge challenge for me !
    Let's take this adjacency graph as an exemple
    alt text

    Let's start with these questions
    1-How can I create each node and name it ? ( A , B ,C ...)
    2-How to connect nodes with arrows or lines ?
    3-How can I give values to each line/arrow ?
    I couldn't find any tutorials related to this I wish someone helps me

    1 Reply Last reply
    0
    • Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by Pablo J. Rogina
      #2

      @Codeseeker sorry but how is this related to Qt? in addition to using BGL library to solve the graph algorithms, are you planning to draw the graph?

      I couldn't find any tutorials related to this I wish someone helps me

      What about this tutorial?

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      1
      • C Offline
        C Offline
        Charlie_Hdz
        wrote on last edited by
        #3

        Why Boost library?- This is a Qt forum, and of course, you can create a graph in Qt, even in plain C++ with Winapi.

        Once I created a similar project and I recommend you to think about your architecture:

        • You create a Vertex class with x,y, and ID properties; also a GraphManager class to store all the vector that you can create.

        • You create a Edge class , and also create a container to this Edges (every Edge has a first and second id to connect vertex).

        • This is answered with point number 2.

        Recommendation: Create a graph view, and create a graph manager to store all the containers that you'll need.

        This is a whole process, I think is quite big to answer it in one forum post.

        Kind Regards,
        Enrique Hernandez
        gearstech.com.mx
        chernandez@gearstech.com.mx

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          Hi
          This one is quite compact sample ( considering its boost)
          http://www.boost.org/doc/libs/1_46_1/libs/graph/example/quick_tour.cpp
          http://www.boost.org/doc/libs/1_46_1/libs/graph/doc/quick_tour.html
          alt text

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved