Vecteur de vecteur c++
Résolu/Fermé
mony84
Messages postés
68
Date d'inscription
mercredi 19 juillet 2006
Statut
Membre
Dernière intervention
5 octobre 2010
-
21 juil. 2010 à 15:42
mony84 Messages postés 68 Date d'inscription mercredi 19 juillet 2006 Statut Membre Dernière intervention 5 octobre 2010 - 23 juil. 2010 à 15:55
mony84 Messages postés 68 Date d'inscription mercredi 19 juillet 2006 Statut Membre Dernière intervention 5 octobre 2010 - 23 juil. 2010 à 15:55
1 réponse
mony84
Messages postés
68
Date d'inscription
mercredi 19 juillet 2006
Statut
Membre
Dernière intervention
5 octobre 2010
11
23 juil. 2010 à 15:55
23 juil. 2010 à 15:55
la solution :
j'espère qu eça pourrait intéresser quelqu'un
vector <vector<int> > partitions;
vector<int> partitions_intermediary;
int i,j,k,s;
bool find = true;// the node is already in a partition = true
i=0;
while (i< NETWORK_SIZE){
for (j=0; j< NETWORK_SIZE; j++){
if (neighbors_matrix_connected[i][j] == 1){
partitions_intermediary.push_back(j);
}
}
partitions.push_back(partitions_intermediary);
partitions_intermediary.clear();
find =true;
//////////////delete redundancy
i++;
//parcourir ttes les partitions
//find funtion return true if i is included
while (find==true){
find = false;
//find funtion return true if i is included
for (k=0 ;k <partitions.size(); k++){
for (s=0 ;s <partitions[k].size(); s++){
if (i==partitions[k][s])
find =true;
}
}
//////////////
if (find==true){
i++;}
}
}
j'espère qu eça pourrait intéresser quelqu'un