RNAblueprint-1.3.2
decompose.h
Go to the documentation of this file.
1 
11 #ifndef DECOMPOSE_H
12 #define DECOMPOSE_H
13 
14 
15 // include common header with graph definition and global variables
16 #include "common.h"
17 #include "graphcommon.h"
18 
19 // include standard library parts
20 #include <limits>
21 #include <iterator>
22 #include <list>
23 
24 // include boost components
25 #include <boost/graph/bipartite.hpp>
26 #include <boost/graph/connected_components.hpp>
27 #include <boost/graph/biconnected_components.hpp>
28 #include <boost/graph/breadth_first_search.hpp>
29 #include <boost/graph/random_spanning_tree.hpp>
30 #include <boost/property_map/shared_array_property_map.hpp>
31 #include <boost/property_map/property_map.hpp>
32 #include <boost/property_map/vector_property_map.hpp>
33 // #include <boost/graph/ear_decomposition.hpp>
34 #include "ear-decomposition.hpp"
35 
36 namespace design {
37  namespace detail {
38 
39  // does the graph decomposition, and calls the coloring of the subgraphs
40  template <typename RG>
41  bool decompose_graph(Graph& graph, RG& rand);
42  // does the graph decomposition recursion
43  template <typename RG>
44  void decompose_recursion(Graph& g, RG& rand);
45 
46  // get a vector of all vertices with their component id. finds connected components with DFS
47  void connected_components_to_subgraphs(Graph& g);
48 
49  // finds biconnected components with DFS
50  void biconnected_components_to_subgraphs(Graph& g);
51 
52  // iterate over graph and create subgraph of biconnected components
53  void create_biconnected_subgraphs(Graph& g, Vertex v, std::map<int, Graph*> bicomponent_graphs, std::map<Edge, int>& component, int j);
54 
55  // starts at a degree>3 articulation point and walks along a path to connect it to one component
56  void merge_biconnected_paths(Graph& g, Vertex p, Vertex v, std::map<Edge, int>& component, std::vector<Vertex>& art_points, int& nc);
57 
58  // ear decomposition of blocks
59  template <typename RG>
60  void ear_decomposition_to_subgraphs(Graph& g, RG& rand, bool optimize_decomposition);
61 
62  // calculate alpha and beta values as measure for the complexity of this ear_decomposition
63  std::pair<int, int> get_alpha_beta(Graph& g, std::vector<Vertex> att_points, int num);
64 
65  // identify attachment points and add them as graph property Ak
66  void color_attachment_points(Graph& g);
67 
68  // now create subgraphs for the parts between Ak and Iks
69  void parts_between_articulations_to_subgraphs(Graph& g);
70 
71  // recursion for parts function
72  void parts_recursion(Graph& g, Graph * subgptr, Vertex v);
73  }
74 }
75 #endif
76 
77 
78 /*
79  * \endcond INTERNAL
80  */
This file holds all global includes, definitions and variables.
This file holds all important information for the dependency graph, its definition and often used fun...
All classes and functions for the RNA design library are under the design namespace.
Definition: RNAblueprint.h:101