What is the most efficient c / c ++ framework I can use to create and store cycles, so that I ensure that repeated cycles are not stored?
I have a struct CYCLE, such that:
struct CICLO {
vector<Arco> rota;
float COST;
}
struct Arco {
int i, j;
Arco () {};
Arco (const Arco& obj): i(obj.i), j(obj.j) {};
Arco(int _i, int _j) : i(_i), j(_j) {}
};
I thought about having a cycle vector to store all the already created cycles.
vector<CICLO> ConjCiclos;
For each new cycle created, I need to check if it is no longer stored in Conjuncts. The 1-2-2-1 cycle is the same as the 2-2-1-2 cycle. How can I detect this efficiently? I thought using map would be a good option. However, what key logic can I create, such that the above cycles have the same key?