Changeset 990


Ignore:
Timestamp:
Jun 24, 2008 11:49:14 PM (11 years ago)
Author:
ladanyi
Message:

one step closer...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dynamicbranching/dynamicbranching.cpp

    r989 r990  
    4343#include "OsiClpSolverInterface.hpp"
    4444
     45#define FUNNY_BRANCHING 1
    4546#define DEBUG_DYNAMIC_BRANCHING
    4647
     
    655656
    656657#include <vector>
    657 #define FUNNY_BRANCHING 1
    658658
    659659// Must code up by hand
     
    10701070  if (brub < brlb) {
    10711071    // This node became infeasible. Get rid of it and of its descendants
     1072    const int parent_id = node.parent_;
    10721073    removeSubTree(subroot);
     1074    if (nodes_[parent_id].child_down_ == subroot) {
     1075      nodes_[parent_id].child_down_ = -1;
     1076    } else {
     1077      nodes_[parent_id].child_up_ = -1;
     1078    }
    10731079    return;
    10741080  }
     
    12191225    } else { // only parent is processed from the two children of grandparent
    12201226      if (! child_to_move_is_processed) {
    1221         grandparent.way_ = parent_is_down_child ?
    1222           DBNodeSimple::WAY_DOWN_UP__NOTHING_DONE :
    1223           DBNodeSimple::WAY_UP_DOWN__NOTHING_DONE;
     1227        // remove grandparent, none of its children is processed now, why
     1228        // force its branching decision?
     1229        removeNode(grandparent_id);
     1230        parent.child_up_ = -1;
     1231        parent.way_ = DBNodeSimple::WAY_DOWN_UP__DOWN_DONE;
     1232        sizeDeferred_--;
    12241233      } else {
    12251234        grandparent.way_ = parent_is_down_child ?
     
    12421251    } else { // only parent is processed from the two children of grandparent
    12431252      if (! child_to_move_is_processed) {
    1244         grandparent.way_ = parent_is_down_child ?
    1245           DBNodeSimple::WAY_DOWN_UP__NOTHING_DONE :
    1246           DBNodeSimple::WAY_UP_DOWN__NOTHING_DONE;
     1253        removeNode(grandparent_id);
     1254        parent.child_down_ = -1;
     1255        parent.way_ = DBNodeSimple::WAY_UP_DOWN__UP_DONE;
     1256        sizeDeferred_--;
    12471257      } else {
    12481258        grandparent.way_ = parent_is_down_child ?
     
    15981608          assert(lpres.isDualObjectiveLimitReached ||
    15991609                 (lpres.isProvenPrimalInfeasible == model.isProvenPrimalInfeasible()));
     1610          printf("Finished moving node %d up by %i levels.\n", node.node_id_, cnt);
    16001611        }
    16011612           
     
    16151626        }
    16161627#endif
    1617         if ((numberNodes%1000)==0)
     1628        if ((numberNodes%10)==0)
    16181629          printf("%d nodes, tree size %d\n",
    16191630                 numberNodes,branchingTree.size());
Note: See TracChangeset for help on using the changeset viewer.