MinLCA algorithms
optimisation.hh
Go to the documentation of this file.
1 #ifndef __MINLCA_MINLCA_OPT_HH
2 #define __MINLCA_MINLCA_OPT_HH
3 
4 #include <vector>
5 #include <algorithm>
6 #include <utility>
7 #include <lemon/core.h>
8 #include <lemon/smart_graph.h>
9 #include <utils/graph_utils.hh>
10 #include <minlca/base.hh>
11 
14 
15 namespace minlca
16 {
17 
18 
23 template<typename Graph = lemon::SmartGraph>
24 class MinLCAOpt : public MinLCA<Graph>
25 {
26 protected:
27  typedef MinLCA<Graph> Base;
28  using Base::_g;
29  using Base::_s;
30  using Base::_k;
31  using Base::_lca;
32  using Base::_max_k;
33  using Base::_c;
34 
35 protected:
38  MinLCAOpt(const Graph &g, int maxK = 0)
39  : Base(g, maxK)
40  {
41  }
42 
43 public:
45  virtual void initialSolution(
46  const typename MinLCA<Graph>::Colouring &c
47  ) = 0;
48 };
49 }
50 
51 #endif
MinLCAStatus _s
The status of the solution.
Definition: base.hh:41
MinLCAOpt(const Graph &g, int maxK=0)
Constructor for derived classes to use.
Definition: optimisation.hh:38
const Graph & _g
A const reference to the graph we want to arrange.
Definition: base.hh:36
int _k
Largest index of the colours used.
Definition: base.hh:37
virtual void initialSolution(const typename MinLCA< Graph >::Colouring &c)=0
Set the initial solution for the algorithm.
Colouring _c
The vertex colouring.
Definition: base.hh:40
Default namespace Default namespace for MinLCA algorithms.
Definition: base.hh:15
Defines the base class for MinLCA algorithms.
Functions for reading graphs and getting graph properties.
int _max_k
Maximum number of colours allowed.
Definition: base.hh:38
Base class for MinLCA algorithms.
Definition: base.hh:29
Base class for defining optimisation MinLCA algorithms.
Definition: optimisation.hh:24
IntNodeMap Colouring
Type for graph colourings.
Definition: base.hh:33
int maxK()
Maximum number of allowed colours.
Definition: base.hh:205
long long _lca
Cost of the current solution.
Definition: base.hh:39