Main Page   Class Hierarchy   Compound List   File List   Contact   Download   Symbolic Constraints   Examples  

spantree.h

00001 #ifndef SPAN_TREE_H
00002 #define SPAN_TREE_H
00003 
00004 #include<scil/scil.h>
00005 #include<boost/graph/adjacency_list.hpp>
00006 #include<boost/graph/adjacency_matrix.hpp>
00007 
00008 using namespace boost;
00009 
00010 namespace SCIL {
00011 
00012 // The "vertex reached" property-tag
00013 struct vertex_reached_t { 
00014   typedef vertex_property_tag kind;
00015 };
00016 
00032 template
00033 <typename Graph>
00034 class SpanTree : public sym_constraint { 
00035 
00036    typedef typename graph_traits<Graph>::edge_descriptor edge_descriptor;
00037    typedef typename graph_traits<Graph>::vertex_descriptor vertex;
00038 
00039 
00041    typedef adjacency_list_traits < vecS, vecS, bidirectionalS > Traits;
00042 
00043    typedef property < vertex_name_t, std::string,
00044            property < vertex_index_t, int,
00045            property < vertex_color_t, boost::default_color_type,
00046            property < vertex_distance_t, int,
00047            property < vertex_predecessor_t, Traits::edge_descriptor > > > > > kolmogorov_util_property;
00048 
00049    typedef property<vertex_reached_t, bool, kolmogorov_util_property> VertexProperty;
00050 
00051    typedef property<edge_capacity_t, int, 
00052            property<edge_residual_capacity_t, int,
00053            property<edge_reverse_t, Traits::edge_descriptor > > > EdgeProperty;
00054   
00055    typedef boost::adjacency_list<vecS,vecS,bidirectionalS, VertexProperty, EdgeProperty> bdGraph;
00056    typedef graph_traits<bdGraph>::vertex_descriptor H_vertex;
00057    typedef graph_traits<bdGraph>::edge_descriptor H_edge;
00058 
00059    private:
00060       Graph& G;
00061       var_map<edge_descriptor>& VM;     
00062 
00063       bdGraph H;
00064       std::map<vertex,H_vertex> GtoH;
00065       H_vertex son;
00066       H_vertex tan;
00067       std::map<edge_descriptor,H_edge> GtoH1;
00068       std::map<edge_descriptor,H_edge> GtoH2;
00069 
00070  
00071   class st_cutset_inequality;
00072 
00073    public:
00074 
00083       SpanTree(Graph& G_, var_map<edge_descriptor>& VM_);
00084 
00088       void init(subproblem& S);
00089   
00095       status standard_separation(subproblem& S);
00096 
00099       status feasible(solution& S);
00100 
00103       void min_cut(H_vertex u, property_map<bdGraph, edge_capacity_t>::type& C,  
00104          property_map<bdGraph, edge_residual_capacity_t>::type& resC,
00105          property_map<bdGraph, vertex_reached_t>::type& R, int& k);
00106 
00107 
00110       void info();
00111 
00112 };
00113 }
00114 #include<../src/constraints/spantree.cc>
00115 #endif
Generated on Mon Mar 28 22:03:49 2011 for SCIL by  doxygen 1.6.3