Changeset 956:141f9c0db4a3 in lemon for lemon/hartmann_orlin_mmc.h
- Timestamp:
- 03/06/10 15:35:12 (14 years ago)
- Branch:
- default
- Children:
- 957:f802439d2b58, 959:38213abd2911, 1041:f112c18bc304
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/hartmann_orlin_mmc.h
r942 r956 1 /* -*- C++-*-1 /* -*- mode: C++; indent-tabs-mode: nil; -*- 2 2 * 3 * This file is a part of LEMON, a generic C++ optimization library 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 085 * Copyright (C) 2003-2010 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 344 344 init(); 345 345 findComponents(); 346 346 347 347 // Find the minimum cycle mean in the components 348 348 for (int comp = 0; comp < _comp_num; ++comp) { 349 349 if (!initComponent(comp)) continue; 350 350 processRounds(); 351 351 352 352 // Update the best cycle (global minimum mean cycle) 353 if ( _curr_found && (!_best_found || 353 if ( _curr_found && (!_best_found || 354 354 _curr_cost * _best_size < _best_cost * _curr_size) ) { 355 355 _best_found = true; … … 504 504 if (n < 1 || (n == 1 && _out_arcs[(*_nodes)[0]].size() == 0)) { 505 505 return false; 506 } 506 } 507 507 for (int i = 0; i < n; ++i) { 508 508 _data[(*_nodes)[i]].resize(n + 1, PathData(INF)); … … 577 577 } 578 578 } 579 579 580 580 // Check early termination 581 581 bool checkTermination(int k) { … … 587 587 int size; 588 588 Node u; 589 589 590 590 // Search for cycles that are already found 591 591 _curr_found = false; … … 608 608 level[u] = Pair(i, j); 609 609 if (j != 0) { 610 611 610 u = _gr.source(_data[u][j].pred); 611 } 612 612 } 613 613 }
Note: See TracChangeset
for help on using the changeset viewer.