Biorithm  1.1
Public Member Functions | Protected Attributes | Static Protected Attributes
MyDensestSubgraphAnnealState Class Reference

A subgraph of MyAbstractAnnealState that computes the most heavy subgraph of a graph. The heavy subgraph need not be connected. More...

#include <graph.C>

Inheritance diagram for MyDensestSubgraphAnnealState:
MyAbstractAnnealState MyDensestSubgraphConnectedBruteForceAnnealState

List of all members.

Public Member Functions

 MyDensestSubgraphAnnealState (const MyGraph &g)
MyDensestSubgraphAnnealStateoperator= (const MyDensestSubgraphAnnealState &rhs)
 MyDensestSubgraphAnnealState (const MyGraph &g, MyAbstractGraphModification *graphMod, bool keepOldPermutation=true)
virtual void computeRandomNeighbour (MyAbstractAnnealState &neighbour)
virtual void getCurrentGraph (MyGraph &graph) const
virtual MyNT computeScore () const
 Compute the score of the state.
virtual void print (ostream &ostr) const
 Print the score and length of the path followed by the elements of the path.
virtual void undo ()
 Undo the previous change made to the state.

Protected Attributes

const MyGraph_graph
MyAbstractGraphModification_previousModification
bool _restart

Static Protected Attributes

static MyGraph _currentGraph = MyGraph()
static vector< MyEdge_randomlyPermutedEdges = vector< MyEdge >()
static vector< MyNode_randomlyPermutedNodes = vector< MyNode >()

Detailed Description

A subgraph of MyAbstractAnnealState that computes the most heavy subgraph of a graph. The heavy subgraph need not be connected.


Constructor & Destructor Documentation

MyDensestSubgraphAnnealState::MyDensestSubgraphAnnealState ( const MyGraph g,
MyAbstractGraphModification graphMod,
bool  keepOldPermutation = true 
) [inline]

Constructor that initialises both _graph and _currentGraph. This constructor is useful during MySimulatedAnnealer::run().

Parameters:
[in]keepOldPermutation,ifthis Boolean is true, do not change the static member variable _randomlyPermuteEdges. Otherwise, create a new random permutation.

Member Function Documentation

virtual void MyDensestSubgraphAnnealState::computeRandomNeighbour ( MyAbstractAnnealState neighbour) [inline, virtual]

Compute a random neighbour of *this.

We define a neighbour as any graph that differs from _currentGraph by one edge or by one node (deleted or inserted). The method makes an edge-change or a node-change with equal probability. If changing by an edge (respectively, node), the method picks an edge (respectively, node) uniformly at random from the set of all edges (respectively, nodes) in _graph.

Implements MyAbstractAnnealState.

Reimplemented in MyDensestSubgraphConnectedBruteForceAnnealState.


The documentation for this class was generated from the following file:
 All Classes Functions Variables Typedefs Friends