gggp.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. /**
  2. * @file tests/boost_graph/partitioning/gggp.cpp
  3. * @author The PARADEVS Development Team
  4. * See the AUTHORS or Authors.txt file
  5. */
  6. /*
  7. * PARADEVS - the multimodeling and simulation environment
  8. * This file is a part of the PARADEVS environment
  9. *
  10. * Copyright (C) 2013 ULCO http://www.univ-litoral.fr
  11. *
  12. * This program is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation, either version 3 of the License, or
  15. * (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. */
  25. #include <tests/boost_graph/partitioning/gggp.hpp>
  26. #include <algorithm>
  27. #include <iostream>
  28. namespace paradevs { namespace tests { namespace boost_graph {
  29. extern UnorientedGraph::vertex_iterator vertexIt, vertexEnd;
  30. extern UnorientedGraph::adjacency_iterator neighbourIt, neighbourEnd;
  31. extern OrientedGraph::vertex_iterator vertexIto, vertexEndo;
  32. extern OrientedGraph::adjacency_iterator neighbourIto, neighbourEndo;
  33. void gggp(UnorientedGraph *g, Entiers *sommetsSource,
  34. Entiers *sommetsDestination, EntiersEntiers &Partition)
  35. {
  36. int val;
  37. Entiers sommets_adj;
  38. if (sommetsSource->size() - 1 == 0) {
  39. Entiers tailles;
  40. val = 0;
  41. for (uint i = 0;i < Partition.size(); i++) {
  42. tailles.push_back(Partition.at(i)->size());
  43. }
  44. uint tmp = *max_element(tailles.begin(), tailles.end());
  45. for (uint i = 0; i < Partition.size(); i++) {
  46. if (Partition.at(i)->size() == tmp) {
  47. gggp(g, Partition.at(i), sommetsDestination, Partition);
  48. }
  49. break;
  50. }
  51. } else {
  52. // Tirage aléatoire de l'indice du premier sommet entre 0 et
  53. // taille du tableau -1
  54. val = rand_fini(0, sommetsSource->size() - 1);
  55. }
  56. float poids_max=sommetsSource->size()/2.;
  57. float poids=1;
  58. Entiers sommets_cut;
  59. //clog<<"Etape 1 : "<<std::endl;
  60. sommetsDestination->push_back(sommetsSource->at(val));
  61. sommetsSource->erase(sommetsSource->begin() + val);
  62. if (sommetsSource->size() < 2) {
  63. return;
  64. }
  65. while (poids < poids_max) {
  66. // for(uint i =0; i< sommetsDestination.size();i++){
  67. // std::cout<<sommetsDestination.at(i)<<std::endl;
  68. // }
  69. Liste_Voisin(*sommetsDestination, sommets_adj, *g);
  70. if (sommets_adj.size() == 0) {
  71. for (uint i=0; i<sommetsSource->size();i++)
  72. {
  73. for (uint j=0; j<sommetsDestination->size();j++)
  74. {
  75. remove_edge(sommetsSource->at(i),sommetsDestination->at(j),*g);
  76. }
  77. }
  78. sort(sommetsDestination->begin(), sommetsDestination->end());
  79. return;
  80. } else {
  81. /*clog<<"Liste voisin est : "<<std::endl;
  82. for(int i=0;i<sommets_adj.size();i++)
  83. {
  84. std::cout<<sommets_adj[i]<<std::endl;
  85. }*/
  86. std::sort(sommets_adj.begin(), sommets_adj.end());
  87. for (uint i = 0; i < sommets_adj.size(); i++) {
  88. sommets_cut.push_back(Cout_coupe(*sommetsDestination,
  89. sommets_adj[i], *g));
  90. }
  91. int tmp = recherche_val(sommets_cut,
  92. *min_element(sommets_cut.begin(),
  93. sommets_cut.end()));
  94. sommetsDestination->push_back(sommets_adj[tmp]);
  95. suprim_val(*sommetsSource, sommets_adj[tmp]);
  96. suprim_val(sommets_adj, sommets_adj[tmp]);
  97. sommets_cut.clear();
  98. poids++;
  99. }
  100. }
  101. for (uint i = 0; i < sommetsSource->size(); i++) {
  102. for (uint j = 0; j < sommetsDestination->size(); j++) {
  103. remove_edge(sommetsSource->at(i), sommetsDestination->at(j), *g);
  104. }
  105. }
  106. sort(sommetsDestination->begin(), sommetsDestination->end());
  107. }
  108. void gggp_pond(UnorientedGraph *g, Entiers *sommetsSource,
  109. Entiers *sommetsDestination, EntiersEntiers &Partition)
  110. {
  111. int val;
  112. Entiers sommets_adj;
  113. if(sommetsSource->size()==1){
  114. val=0;
  115. //std::cout<<"Entré dans le debug ! "<<std::endl;
  116. Entiers tailles;
  117. for(uint i=0;i<Partition.size();i++){
  118. tailles.push_back(Partition.at(i)->size());
  119. }
  120. uint tmp=*max_element(tailles.begin(),tailles.end());
  121. for(uint i=0; i<Partition.size();i++){
  122. if(Partition.at(i)->size()==tmp)
  123. {
  124. gggp_pond(g,Partition[i],sommetsDestination,Partition);
  125. return;
  126. }
  127. }
  128. }
  129. else
  130. val=rand_fini(0,sommetsSource->size()-1);//Tirage aléatoire de l'indice du premier sommet entre 0 et taille du tableau -1
  131. //std::cout<<"val : "<<sommetsSource->at(val)<<std::endl;
  132. double poids_max=0;
  133. for(uint i=0;i<sommetsSource->size();i++){
  134. poids_max+=(*g)[sommetsSource->at(i)]._weight;
  135. }
  136. poids_max/=2.;
  137. double poids=(*g)[sommetsSource->at(val)]._weight;
  138. std::vector<float> sommets_cut;
  139. sommetsDestination->push_back(sommetsSource->at(val));
  140. sommetsSource->erase(sommetsSource->begin() + val);
  141. // std::cout<<"taille sommetsSource avant le while : "<<sommetsSource->size()<<std::endl;
  142. while(poids<poids_max && sommetsSource->size()>1)
  143. {
  144. //std::cout<<"taille sommetsSource dans le while "<<sommetsSource->size()<<std::endl;
  145. Liste_Voisin(*sommetsDestination,sommets_adj,*g);
  146. if(sommets_adj.size()==0)
  147. {
  148. //std::cout<<"Je suis sorti car pas de voisin !!!! "<<std::endl;
  149. for (uint i=0; i<sommetsSource->size();i++)
  150. {
  151. for (uint j=0; j<sommetsDestination->size();j++)
  152. {
  153. remove_edge(sommetsSource->at(i),sommetsDestination->at(j),*g);
  154. }
  155. }
  156. sort(sommetsDestination->begin(), sommetsDestination->end());
  157. return;
  158. }
  159. else{
  160. sort(sommets_adj.begin(), sommets_adj.end());
  161. /*std::cout<<"adj :"<<std::endl;
  162. for(uint a = 0; a<sommets_adj.size(); a++){
  163. std::cout<<sommets_adj.at(a)<<std::endl;
  164. }
  165. std::cout<<std::endl;*/
  166. for(uint i=0;i<sommets_adj.size();i++)
  167. {
  168. sommets_cut.push_back(Cout_coupe_pond(*sommetsDestination,sommets_adj[i],*g));
  169. }
  170. /*std::cout<<"cut :"<<std::endl;
  171. for(uint a = 0; a<sommets_cut.size(); a++){
  172. std::cout<<sommets_cut.at(a)<<std::endl;
  173. }
  174. std::cout<<std::endl;*/
  175. sommetsDestination->push_back(sommets_adj[recherche_val2(sommets_cut,*min_element(sommets_cut.begin(),sommets_cut.end()))]);
  176. //std::cout<<"Sommet deplacé : "<<sommets_adj[recherche_val2(sommets_cut,*min_element(sommets_cut.begin(),sommets_cut.end()))]<<std::endl;
  177. poids+=(*g)[sommets_adj[recherche_val2(sommets_cut,*min_element(sommets_cut.begin(),sommets_cut.end()))]]._weight;
  178. suprim_val(*sommetsSource, sommets_adj[recherche_val2(sommets_cut,*min_element(sommets_cut.begin(),sommets_cut.end()))]);
  179. suprim_val(sommets_adj, sommets_adj[recherche_val2(sommets_cut,*min_element(sommets_cut.begin(),sommets_cut.end()))]);
  180. sommets_cut.clear();
  181. }
  182. /*for(uint i =0; i<sommetsSource->size();i++){
  183. std::cout<<sommetsSource->at(i)<<",";
  184. }
  185. std::cout<<std::endl;
  186. for(uint i =0; i<sommetsDestination->size();i++){
  187. std::cout<<sommetsDestination->at(i)<<",";
  188. }
  189. std::cout<<std::endl;*/
  190. }
  191. for (uint i=0; i<sommetsSource->size();i++)
  192. {
  193. for (uint j=0; j<sommetsDestination->size();j++)
  194. {
  195. remove_edge(sommetsSource->at(i),sommetsDestination->at(j),*g);
  196. }
  197. }
  198. sort(sommetsDestination->begin(), sommetsDestination->end());
  199. //std::cout<<"fin du gggp_pond"<<std::endl;
  200. }
  201. void Iter_2l(EntiersEntiers &part, int nbr_parties, UnorientedGraph *g,
  202. const std::string &nom)
  203. {
  204. if (nom!="gggp_pond"){
  205. //std::cout<<"je jsuis dans gggp"<<std::endl;
  206. for(int i = 0; i<floor(log(nbr_parties)/log(2)); i++)
  207. {
  208. //std::cout<<"Et un tours de plus !!!! "<<std::endl;
  209. for(int j = 0; j< pow(2,i);j++)
  210. {
  211. Entiers *Q = new Entiers();
  212. gggp(g,part[j],Q,part);
  213. part.push_back(Q);
  214. }
  215. }
  216. } else {
  217. //std::cout<<"je jsuis dans gggp_pond"<<std::endl;
  218. for(int i = 0; i<floor(log(nbr_parties)/log(2)); i++)
  219. {
  220. //std::cout<<"Et un tours de plus !!!! "<<std::endl;
  221. for(int j = 0; j< pow(2,i);j++)
  222. {
  223. Entiers *Q = new Entiers();
  224. gggp_pond(g,part.at(j),Q,part);
  225. //std::clog<<"sortie du gggp_pond"<<std::endl;
  226. part.push_back(Q);
  227. }
  228. //std::cout<<"\n"<<std::endl;
  229. }
  230. }
  231. }
  232. void bissectionRec(UnorientedGraph *g, EntiersEntiers &Partition,
  233. int nbr_parties, const std::string &nom)
  234. {
  235. if((nbr_parties&(nbr_parties-1))==0)
  236. {
  237. //std::cout<<"C'est de la forme 2l : "<<nbr_parties<<std::endl;
  238. Iter_2l(Partition,nbr_parties,g,nom);
  239. }
  240. else
  241. {
  242. int puissance_2=0;
  243. Entiers tailles;
  244. while(pow(2,puissance_2)<nbr_parties)
  245. puissance_2++;
  246. Iter_2l(Partition,pow(2,puissance_2-1),g,nom);
  247. for(unsigned int i = 0; i< Partition.size() -1 ; i++)
  248. {
  249. for(EntiersEntiers::iterator it1 = Partition.begin() + i ; it1!=Partition.end(); it1++)
  250. {
  251. if((*it1)->size() > Partition.at(i)->size())
  252. Partition.at(i)->swap(**it1);
  253. }
  254. }
  255. for(int j = 0; j<nbr_parties-pow(2,puissance_2-1);j++)
  256. {
  257. Entiers *Q = new Entiers();
  258. if(nom!="gggp_pond")
  259. gggp(g,Partition.at(j),Q,Partition);
  260. else
  261. gggp_pond(g,Partition.at(j),Q,Partition);
  262. Partition.push_back(Q);
  263. }
  264. }
  265. std::cout<<"Partition avant affinage "<<std::endl;
  266. for(uint i = 0 ; i<Partition.size(); i++){
  267. for(uint j = 0 ; j<Partition.at(i)->size(); j++){
  268. std::cout<<Partition.at(i)->at(j)<<" ";
  269. }
  270. std::cout<<"\n"<<std::endl;
  271. }
  272. }
  273. /**
  274. * Fonction réalisant un partitionnement pseudo aléatoire suivant un voisinage.
  275. * @param *g : adresse d'un graphe de type boost graphe undirected
  276. * @param Partition : vecteur contenant des vecteurs d'entiers [tableau contenant les parties de la partition]
  277. * @param nbr_partie : entier correspondant au nombre de parties voulues pour la partition
  278. * @return
  279. */
  280. void Pseudo_random_partitioning(UnorientedGraph *g, EntiersEntiers &Partition,
  281. uint nbr_parties)
  282. {
  283. /*
  284. * Principe : distribution des sommets de la première partie en plusieurs autres parties
  285. * Le partitionnement étant pseudo aléatoire il n'y a pas de contrainte stricte sur le nombre
  286. * de sommets par partie
  287. */
  288. uint size = Partition.at(0)->size();
  289. uint cpt_sommets=1;
  290. int val;
  291. uint cpt;
  292. if(nbr_parties==size){
  293. for(uint i = 0; i < nbr_parties;i++){
  294. if(Partition.at(0)->size()!=1)
  295. {
  296. val=rand_fini(0,Partition.at(0)->size()-1);//tirage aléatoire d'un sommets
  297. }
  298. else
  299. val=0;
  300. int vertex = Partition.at(0)->at(val);
  301. Entiers *part = new Entiers();
  302. part->push_back(vertex);// ajout du sommet tiré
  303. suprim_val(*Partition.at(0),vertex);//suppression du sommet dans la premiere partie
  304. }
  305. }
  306. /*
  307. * Boucle sur le nombre de partie à réaliser
  308. */
  309. for(uint i = 0; i < nbr_parties-1;i++){
  310. if(Partition.at(0)->size()!=1)
  311. {
  312. val=rand_fini(0,Partition.at(0)->size()-1);//tirage aléatoire d'un sommets
  313. }
  314. else
  315. val=0;
  316. int vertex = Partition.at(0)->at(val);
  317. /*
  318. * Initialisation d'un pointeur sur un vecteur d'entier, dans notre cas
  319. * la n+1 ième partie de la partition
  320. */
  321. Entiers *part = new Entiers();
  322. part->push_back(vertex);// ajout du sommet tiré
  323. suprim_val(*Partition.at(0),vertex);//suppression du sommet dans la premiere partie
  324. cpt=1;
  325. /*
  326. * Pour chaque element de la nouvelle partie faire
  327. */
  328. for(uint j = 0; j<part->size();j++){
  329. /*
  330. * Détermination des voisins de chacun des sommets de cette nouvelle
  331. * partie et ajoue de ce voisin si celui-ci est présent dans la première partie (Partition[0])
  332. */
  333. tie(neighbourIt, neighbourEnd) = adjacent_vertices(part->at(j),*g);
  334. for (; neighbourIt != neighbourEnd; ++neighbourIt){
  335. if(In_tab(*Partition.at(0),*neighbourIt)==1){
  336. std::cout<<"le voisin déplacé est : "<<*neighbourIt<<std::endl;
  337. part->push_back(*neighbourIt);
  338. cpt_sommets++;
  339. suprim_val(*Partition.at(0),*neighbourIt);
  340. cpt++;
  341. }
  342. /*
  343. * Si le nombre moyen de sommets est atteind dans la partie on sort de la boucle des voisins
  344. * Même chose si l'on a rencontré le nombre total de sommets
  345. */
  346. if(cpt==(size/nbr_parties)+1)
  347. break;
  348. if(cpt_sommets==size)
  349. break;
  350. }
  351. /*
  352. * Même chose
  353. */
  354. if(cpt==(size/nbr_parties)+1)
  355. break;
  356. if(cpt_sommets==size)
  357. break;
  358. }
  359. Partition.push_back(part);// ajoue de la nouvelle partie à la partition
  360. if(cpt_sommets==size)
  361. break;
  362. }
  363. }
  364. EntiersEntiers Random_partitioning(UnorientedGraph *g,
  365. uint nbr_parties)
  366. {
  367. EntiersEntiers Partition;
  368. Entiers random_order; //gestion d'un tableau contenant tout les sommets et ranger de façon aléatoire
  369. for (uint i=0 ; i<num_vertices(*g) ; i++)
  370. random_order.push_back(i);
  371. for (uint j=0 ; j<num_vertices(*g)-1 ; j++) {
  372. int rand_pos = rand()%(num_vertices(*g)-j)+j;
  373. int tmp = random_order.at(j);
  374. random_order.at(j) = random_order.at(rand_pos);
  375. random_order.at(rand_pos) = tmp;
  376. }
  377. uint size = num_vertices(*g)/nbr_parties;
  378. for(uint j = 0 ; j < nbr_parties-1 ; j++){
  379. Entiers *part = new Entiers();
  380. for(uint i = j*size; i<(j+1)*size; i++){
  381. part->push_back(random_order.at(i));
  382. }
  383. Partition.push_back(part);
  384. }
  385. Entiers *part = new Entiers();
  386. for(uint i = (nbr_parties-1)*size; i < random_order.size(); i++){
  387. part->push_back(random_order.at(i));
  388. }
  389. Partition.push_back(part);
  390. for(uint i = 0 ; i < Partition.size() ; i++){
  391. sort(Partition.at(i)->begin(),Partition.at(i)->end());
  392. }
  393. return Partition;
  394. }
  395. OrientedGraphs Multiniveau(uint niveau_contraction,
  396. UnorientedGraph *g,
  397. UnorientedGraph *graph_origin,
  398. OrientedGraph *go,
  399. int nbr_parties,
  400. std::string contraction,
  401. std::string type_methode,
  402. std::string choix_affinage,
  403. std::string type_cut,
  404. Edges& /* edge_partie */,
  405. OutputEdgeList& outputedgeslist,
  406. InputEdgeList& inputedgelist,
  407. Connections& connections)
  408. {
  409. EntiersEntiers Partition;
  410. Entiers *part = new Entiers();
  411. Base_Graph baseg;
  412. baseg.push_back(g);
  413. ListEntiersEntiers liste_corr;
  414. uint cpt =0;
  415. while(num_vertices(*baseg.at(cpt))>niveau_contraction)
  416. {
  417. if(contraction == "HEM")
  418. contraction_HEM(baseg.at(cpt),baseg,liste_corr);
  419. else
  420. contraction_Random_Maching(baseg.at(cpt),baseg,liste_corr);
  421. cpt++;
  422. std::cout<<"passage"<<std::endl;
  423. }
  424. std::cout<<"Graphe contracté : "<<std::endl;
  425. for (uint i = 0; i< baseg.size(); i++) {
  426. tie(vertexIt, vertexEnd) = vertices(*baseg[i]);
  427. for (; vertexIt != vertexEnd; ++vertexIt) {
  428. std::cout << (*baseg[i])[*vertexIt]._index
  429. << " est connecté avec ";
  430. tie(neighbourIt, neighbourEnd) = adjacent_vertices(*vertexIt,
  431. *baseg[i]);
  432. for (; neighbourIt != neighbourEnd; ++neighbourIt)
  433. std::cout << (*baseg[i])[*neighbourIt]._index << " ";
  434. std::cout << " et son poids est de "
  435. << (*baseg[i])[*vertexIt]._weight<<std::endl;
  436. }
  437. std::cout << std::endl;
  438. }
  439. std::cout<<"Partitionnement "<<std::endl;
  440. if(type_methode == "gggp_pond" || type_methode == "gggp"){
  441. for(uint i = 0;i < num_vertices(*baseg.at(baseg.size() - 1)); i++)
  442. {
  443. part->push_back(i);
  444. }
  445. Partition.push_back(part);
  446. bissectionRec(baseg.at(baseg.size()-1),Partition,nbr_parties,type_methode);
  447. }
  448. else
  449. Partition = Random_partitioning(baseg.at(baseg.size()-1),nbr_parties);
  450. std::cout<<std::endl;
  451. ListEntiersEntiers::iterator lit(liste_corr.end());
  452. bool proj;
  453. uint taille_list = liste_corr.size();
  454. if(liste_corr.size()==0){
  455. taille_list = 1;
  456. proj = true;
  457. }
  458. else{
  459. lit--;
  460. proj = false;
  461. }
  462. for(uint y =0; y<taille_list;y++){
  463. if(proj != true){
  464. std::cout<<"Projection "<<std::endl;
  465. projection(Partition,lit);
  466. std::cout<<std::endl;
  467. double cut = Cut_cluster(Partition,*baseg.at(baseg.size()-2-y),type_cut);
  468. std::cout<<"Cout de coupe avant affinage : "<<cut<<std::endl;
  469. std::cout<<std::endl;
  470. std::cout<<"Affinage "<<std::endl;
  471. if(choix_affinage=="charge")
  472. Affinage_equilibrage_charge(baseg.at(baseg.size()-2-y),Partition);
  473. else
  474. Affinage_recherche_locale(baseg.at(baseg.size()-2-y),Partition,cut,type_cut);
  475. lit--;
  476. }
  477. else{
  478. std::cout<<"Pas de projection "<<std::endl;
  479. std::cout<<std::endl;
  480. if(nbr_parties != num_vertices(*g)){
  481. std::cout<<"Affinage "<<std::endl;
  482. double cut = Cut_cluster(Partition,*graph_origin,type_cut);
  483. std::cout<<"Cout de coupe avant affinage : "<<cut<<std::endl;
  484. if(choix_affinage=="charge")
  485. Affinage_equilibrage_charge(graph_origin,Partition);
  486. else{
  487. Affinage_recherche_locale(graph_origin,Partition,cut,type_cut);
  488. std::cout<<"Cout de coupe après affinage : "<<cut<<std::endl;
  489. }
  490. }
  491. else
  492. std::cout<<"Pas d'affinage "<<std::endl;
  493. }
  494. }
  495. OrientedGraphs Graphes = Graph_Partition(Partition, go, g, outputedgeslist,
  496. inputedgelist, connections);
  497. std::cout<<std::endl;
  498. std::cout<<"Résultat de la partition "<<std::endl;
  499. for(uint k=0; k<Partition.size(); k++)
  500. {
  501. for(uint j=0; j<Partition.at(k)->size(); j++)
  502. {
  503. std::cout<<Partition.at(k)->at(j)<<" ";
  504. }
  505. std::cout<<"\n"<<std::endl;
  506. }
  507. double cut = Cut_cluster(Partition,*graph_origin,"cut");
  508. std::cout<<"Cout de coupe engendré par le partitionnement: "<<cut<<std::endl;
  509. for(EntiersEntiers::iterator it = Partition.begin(); it != Partition.end(); it++)
  510. {
  511. delete *it;
  512. *it = NULL;
  513. }
  514. for(ListEntiersEntiers::iterator it = liste_corr.begin(); it != liste_corr.end(); it++)
  515. {
  516. for(EntiersEntiers::iterator it1 = (*it)->begin(); it1 != (*it)->end(); it1++)
  517. {
  518. delete *it1;
  519. *it1 = NULL;
  520. }
  521. delete *it;
  522. *it = NULL;
  523. }
  524. for(Base_Graph::iterator it = baseg.begin(); it != baseg.end(); it++)
  525. {
  526. delete *it;
  527. *it = NULL;
  528. }
  529. return Graphes;
  530. }
  531. } } } // namespace paradevs tests boost_graph