Implementation of some ds for graphs

Revision en1, by hackerbaba, 2020-04-27 12:04:07

Hello again. I am newbie learning graphs, currently doing it in c++ and there are multiple opinions everywhere as to what should be used to implement the (min heap) structure(currently looking into Dijkstra's algo). 1. Should it be PRIORITY QUEUE or MULTISET or SET.? 2. How should the weighted graph be represented in the adjacency list? Currently I started doing a vector<pair<int, int> > with the node as the first element and the weight as the second. Is it right or something else has to be added?

Any other good practices for graphs are appreciated.

Tags graphs, multiset, #set, priorityqueue, vector

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English hackerbaba 2020-04-27 12:04:07 605 Initial revision (published)