I am converting VB6 to C # and I want to create my own data structure that will support values and relationships more efficiently. In VB, I have a set of values and another set of relationships between these values with priorities for these relationships. I also have an algorithm that, when a set of values is passed, it returns all the relationships necessary to combine these values together. For example, let's say that the collection of values contains 1-10, and the collection of relations contains
1,2
3.2
5.2
2,8
8.10
9.10
If the input was 1,9,10, the returned relationship would be -
1,2
2,8
8.10
9.10
Since there can be several paths, the least number of relationships will be returned, but there is a caution about the priorities of the relationships. If the relationship has a higher priority, then this relationship will be added, and the rest of the relationship will be added from there. I am thinking of using a data structure with unrelated sets , but I'm not sure.
Any ideas?
thank
Additional Information -
The number of values will usually be less than 100, and relationships less than 500. Collections are static, and the algorithm will be used again and again to find paths. In addition, I did not ask about this, but is the "Data structure with unrelated sets" algorithm most effective ?
design c # algorithm data-structures
Dan R. Dec 22 '08 at 15:08 2008-12-22 15:08
source share