StableSetBranchRule Class Reference

#include <StableSetBranchRule.hh>

List of all members.

Public Member Functions

 StableSetBranchRule (ABA_MASTER *master, int node, vector< int > *nodes)
virtual ~StableSetBranchRule ()
virtual int extract (ABA_SUB *sub)


Detailed Description

This class is derived from tha abacus class ABA_BRANCHRULE. It represents one node of the Barnch & Cut tree.

Definition at line 40 of file StableSetBranchRule.hh.


Constructor & Destructor Documentation

StableSetBranchRule::StableSetBranchRule ABA_MASTER *  master,
int  node,
vector< int > *  nodes
 

Constructor.

Parameters:
*master Pointer to the corresponding master of the optimization.
node The node which is set to value 1.
*nodes Pointer to a vector storing the nodes to be set to value 0.

Definition at line 30 of file StableSetBranchRule.cpp.

00031                                                             :
00032     ABA_BRANCHRULE(master),
00033     master_(master),
00034     setToOne(node)
00035 {
00036 
00037     setToZeroSize = nodes->size();
00038 
00039     if (setToZeroSize > 0) {
00040         setToZero = new int[setToZeroSize];
00041         for (int i=0; i<setToZeroSize; i++) {
00042             setToZero[i] = (*nodes)[i];
00043         }
00044     }
00045 }

StableSetBranchRule::~StableSetBranchRule  )  [virtual]
 

Destructor.

Definition at line 51 of file StableSetBranchRule.cpp.

00051                                           {
00052 
00053     if (setToZeroSize > 0) {
00054         delete [] setToZero;
00055     }
00056 
00057 }


Member Function Documentation

int StableSetBranchRule::extract ABA_SUB *  sub  )  [virtual]
 

Activate this branching node.

Parameters:
*sub Pointer to the current subproblem.
Returns:
0 Setting of the variables could be done without error.

1 There was an error.

Definition at line 65 of file StableSetBranchRule.cpp.

00065                                              {
00066 
00067     int  i, j;
00068     int  size;
00069 
00070     ((StableSetSub *)sub)->setVertex(setToOne, true);
00071 
00072 
00073     for (i=0; i<setToZeroSize; i++) {
00074         // Check for contradictions.
00075         if(sub->variable(setToZero[i])->fsVarStat()->set()) {
00076             return 1;
00077         }
00078         ((StableSetSub *)sub)->setVertex(setToZero[i], false);
00079     }
00080 
00081     return 0;
00082 }


The documentation for this class was generated from the following files:
Generated on Fri Apr 28 15:50:01 2006 for Branch and Cut algorithm for the Maximum Stable Set Problem by  doxygen 1.4.6-NO