MinLCA algorithms
Public Member Functions | Private Types | List of all members
minlca::MinLCAGreedyLpBfs< Graph > Class Template Reference

Use the MinLCAGreedyLp with Bfs. More...

#include <greedy-lp.hh>

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

Public Member Functions

 MinLCAGreedyLpBfs (const Graph &g, int maxK=0)
 Constructor. More...
 
virtual MinLCAStatus run ()
 Run the algorithm. More...
 
- Public Member Functions inherited from minlca::MinLCAGreedyBfs< MinLCAGreedyLp, Graph >
 TEMPLATE_GRAPH_TYPEDEFS (Graph)
 
 MinLCAGreedyBfs (const Graph &g, int maxK=0)
 Constructor for the algorithm class. More...
 
virtual ~MinLCAGreedyBfs ()
 Destructor.
 
virtual void init ()
 
void setSourceNodes (const std::list< Node > &sources)
 Set source vertices. More...
 
void setSourceNode (const Node &v)
 Set source node. More...
 
- Public Member Functions inherited from minlca::MinLCAGreedy< Graph >
 TEMPLATE_GRAPH_TYPEDEFS (Graph)
 
- Public Member Functions inherited from minlca::MinLCA< Graph >
 TEMPLATE_GRAPH_TYPEDEFS (Graph)
 
MinLCAStatus status () const
 Status of the solution.
 
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...
 

Private Types

typedef MinLCAGreedyBfs< MinLCAGreedyLp, Graph > Base
 

Additional Inherited Members

- Public Types inherited from minlca::MinLCA< Graph >
typedef IntNodeMap Colouring
 Type for graph colourings.
 
- Protected Types inherited from minlca::MinLCAGreedyBfs< MinLCAGreedyLp, Graph >
typedef MinLCAGreedyLp< Graph > BaseGreedy
 The greedy algorithm.
 
typedef MinLCAGreedyBfs< MinLCAGreedyLp, Graph > Visitor
 This class.
 
- Protected Types inherited from minlca::MinLCAGreedyLp< Graph >
typedef MinLCAGreedy< Graph > Base
 The greedy base class.
 
- Protected Types inherited from minlca::MinLCAGreedy< Graph >
typedef MinLCA< Graph > Base
 The base class, for shorter reference.
 
- Protected Member Functions inherited from minlca::MinLCAGreedyLp< Graph >
 TEMPLATE_GRAPH_TYPEDEFS (Graph)
 
 MinLCAGreedyLp (const Graph &g, int maxK=0)
 Constructor. More...
 
void solveModel ()
 
virtual void paintVertex (const Node &v)
 Assign a colour to a vertex using a greedy approach.
 
- Protected Member Functions inherited from minlca::MinLCAGreedy< Graph >
 MinLCAGreedy (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...
 
- Protected Attributes inherited from minlca::MinLCAGreedyBfs< MinLCAGreedyLp, Graph >
std::list< Node > _sources
 List of source nodes for BFS.
 
lemon::BfsVisit< Graph, Visitor > * _bfs
 Pointer to the visitor class.
 
- Protected Attributes inherited from minlca::MinLCAGreedyLp< Graph >
MinLCALpModel< Graph > model
 Relaxed linear model for the graph.
 
- 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::MinLCAGreedyLpBfs< Graph >

Use the MinLCAGreedyLp with Bfs.

Definition at line 85 of file greedy-lp.hh.

Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 95 of file greedy-lp.hh.

Member Function Documentation

template<typename Graph = lemon::SmartGraph>
virtual MinLCAStatus minlca::MinLCAGreedyLpBfs< Graph >::run ( )
inlinevirtual

Run the algorithm.

Runs the algorithm and returns its status. Need to call #init() before executing.

Returns
Status of the solution
See also
#init()

Reimplemented from minlca::MinLCAGreedyBfs< MinLCAGreedyLp, Graph >.

Definition at line 99 of file greedy-lp.hh.


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