MinLCA algorithms
Public Member Functions | Protected Types | Protected Member Functions | List of all members
minlca::MinLCAOpt< Graph > Class Template Referenceabstract

Base class for defining optimisation MinLCA algorithms. More...

#include <optimisation.hh>

Inheritance diagram for minlca::MinLCAOpt< Graph >:
[legend]
Collaboration diagram for minlca::MinLCAOpt< Graph >:
[legend]

Public Member Functions

virtual void initialSolution (const typename MinLCA< Graph >::Colouring &c)=0
 Set the initial solution for the algorithm. More...
 
- Public Member Functions inherited from minlca::MinLCA< Graph >
 TEMPLATE_GRAPH_TYPEDEFS (Graph)
 
virtual void init ()
 Reset the data structures of the algorithm. More...
 
MinLCAStatus status () const
 Status of the solution.
 
virtual MinLCAStatus run ()
 Run the algorithm. More...
 
const Colouringcolouring () const
 Current colouring. More...
 
int operator[] (const Node &v) const
 Colour of a vertex. More...
 
int operator[] (const Edge &e) const
 Cost of an edge. More...
 
long long lcaValue () const
 Value (cost) of the current solution. More...
 
int totalColours () const
 Total number of colours used. More...
 
long long recalculateLca ()
 Force a recalculation of the cost for the current solution. More...
 
int maxK ()
 Maximum number of allowed colours. More...
 

Protected Types

typedef MinLCA< Graph > Base
 

Protected Member Functions

 MinLCAOpt (const Graph &g, int maxK=0)
 Constructor for derived classes to use. More...
 
- Protected Member Functions inherited from minlca::MinLCA< Graph >
void setSolutionNotFound ()
 Auxiliary function to set solution status to not found.
 
void setSolutionFound ()
 Auxiliary function to set solution status to found.
 
virtual void setColour (const Node &v, int vColour)
 Set the colour of a vertex. More...
 
 MinLCA (const Graph &g, int maxK=0)
 Constructor for derived classes to use. More...
 

Additional Inherited Members

- Public Types inherited from minlca::MinLCA< Graph >
typedef IntNodeMap Colouring
 Type for graph colourings.
 
- Protected Attributes inherited from minlca::MinLCA< Graph >
const Graph & _g
 A const reference to the graph we want to arrange.
 
int _k
 Largest index of the colours used.
 
int _max_k
 Maximum number of colours allowed.
 
long long _lca
 Cost of the current solution.
 
Colouring _c
 The vertex colouring.
 
MinLCAStatus _s
 The status of the solution.
 

Detailed Description

template<typename Graph = lemon::SmartGraph>
class minlca::MinLCAOpt< Graph >

Base class for defining optimisation MinLCA algorithms.

This class allows to define optimisation algorithms using an initial solution given by a Colouring.

Definition at line 24 of file optimisation.hh.

Constructor & Destructor Documentation

template<typename Graph = lemon::SmartGraph>
minlca::MinLCAOpt< Graph >::MinLCAOpt ( const Graph &  g,
int  maxK = 0 
)
inlineprotected

Constructor for derived classes to use.

The constructor the derived classes should call. If the maximum number of colours is 0, sets it to \(1+ \Delta(G)\).

See also
MinLCA::MinLCA(const Graph &, int)

Definition at line 38 of file optimisation.hh.

Member Function Documentation

template<typename Graph = lemon::SmartGraph>
virtual void minlca::MinLCAOpt< Graph >::initialSolution ( const typename MinLCA< Graph >::Colouring c)
pure virtual

Set the initial solution for the algorithm.

Parameters
cInitial solution

Implemented in minlca::MinLCAOptMip< Graph >.


The documentation for this class was generated from the following file: