I have data represented as follows.
A-> B,C,D,E,F
B-> C,(D,E),F
D-> (E,F)
E-> (F,G)
F-> (G)
G-> NULL
Each letter represents a string. All letters/strings are in alphabetical order. The B-> means that B is a member of every element succeeding it. So for this example row B consists of the sets (B,C), (B,D,E) and (B,F). Each row can only contain strings higher in order then the row string. I have to arrange the data this way.
Should I use a sequence container like vector or an associative container like set.
I am building small clusters to make big clusters, so I will be iterating through all the data starting from the bottom up.
My guess would be a set of sets?
It seems a graph is what you are looking for, but the standard C++ library (STL) does not have such a data structure. The next best bet is multimap: a map is an 1:1 associated array, where as multimap is a 1:many associated array.