graph_partitioning.hpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /**
  2. * @file tests/boost_graph/graph_partitioning.hpp
  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. #ifndef __TESTS_BOOST_GRAPH_GRAPH_PARTITIONING_HPP
  26. #define __TESTS_BOOST_GRAPH_GRAPH_PARTITIONING_HPP 1
  27. #include <tests/boost_graph/graph_defs.hpp>
  28. #include <tests/boost_graph/partitioning/graph_build.hpp>
  29. #include <tests/boost_graph/partitioning/gggp.hpp>
  30. namespace paradevs { namespace tests { namespace boost_graph {
  31. class PartitioningGraphBuilder
  32. {
  33. public:
  34. PartitioningGraphBuilder()
  35. { }
  36. void build(OrientedGraphs& graphs,
  37. InputEdgeList& input_edges,
  38. OutputEdgeList& output_edges,
  39. Connections& parent_connections)
  40. {
  41. srand(7266);
  42. UnorientedGraph* g = new UnorientedGraph();
  43. OrientedGraph* go = new OrientedGraph();
  44. UnorientedGraph* graph_origin = new UnorientedGraph();
  45. OrientedGraph* gop = new OrientedGraph();
  46. build_graph(*g, *go);
  47. build_graph(*graph_origin, *gop);
  48. delete gop;
  49. int nbr_parties = 8;
  50. Edges edge_partie;
  51. Connections connections;
  52. /*
  53. * teste sur la fonction gggp_pond amélioration + validation complete
  54. * sur un nombre de parties supérieur à 6. Recherche de l'origine de
  55. * l'erreur de segmentation et la corriger
  56. */
  57. output_edges = OutputEdgeList(nbr_parties);
  58. graphs = Multiniveau(num_vertices(*g)/4, g, graph_origin, go, nbr_parties,"rand", "gggp_pond",
  59. "cut_norm", "norm", edge_partie ,
  60. output_edges, input_edges,
  61. parent_connections);
  62. //std::cout<<"Sorti ! "<<std::endl;
  63. delete graph_origin;
  64. }
  65. };
  66. } } } // namespace paradevs tests boost_graph
  67. #endif