gravatar
alpar (Alpar Juttner)
alpar@cs.elte.hu
Merge #417
0 1 0
merge default
1 file changed with 2 insertions and 2 deletions:
↑ Collapse diff ↑
Ignore white space 24 line context
... ...
@@ -902,25 +902,25 @@
902 902
      _max_rank = _alpha * _res_node_num;
903 903
      _buckets.resize(_max_rank);
904 904
      _bucket_next.resize(_res_node_num + 1);
905 905
      _bucket_prev.resize(_res_node_num + 1);
906 906
      _rank.resize(_res_node_num + 1);
907 907

	
908 908
      // Execute the algorithm
909 909
      switch (method) {
910 910
        case PUSH:
911 911
          startPush();
912 912
          break;
913 913
        case AUGMENT:
914
          startAugment();
914
          startAugment(_res_node_num - 1);
915 915
          break;
916 916
        case PARTIAL_AUGMENT:
917 917
          startAugment(MAX_PATH_LENGTH);
918 918
          break;
919 919
      }
920 920

	
921 921
      // Compute node potentials for the original costs
922 922
      _arc_vec.clear();
923 923
      _cost_vec.clear();
924 924
      for (int j = 0; j != _res_arc_num; ++j) {
925 925
        if (_res_cap[j] > 0) {
926 926
          _arc_vec.push_back(IntPair(_source[j], _target[j]));
... ...
@@ -1079,25 +1079,25 @@
1079 1079

	
1080 1080
      // Relabel nodes
1081 1081
      for (int u = 0; u != _res_node_num; ++u) {
1082 1082
        int k = std::min(_rank[u], r);
1083 1083
        if (k > 0) {
1084 1084
          _pi[u] -= _epsilon * k;
1085 1085
          _next_out[u] = _first_out[u];
1086 1086
        }
1087 1087
      }
1088 1088
    }
1089 1089

	
1090 1090
    /// Execute the algorithm performing augment and relabel operations
1091
    void startAugment(int max_length = std::numeric_limits<int>::max()) {
1091
    void startAugment(int max_length) {
1092 1092
      // Paramters for heuristics
1093 1093
      const int EARLY_TERM_EPSILON_LIMIT = 1000;
1094 1094
      const double GLOBAL_UPDATE_FACTOR = 3.0;
1095 1095

	
1096 1096
      const int global_update_freq = int(GLOBAL_UPDATE_FACTOR *
1097 1097
        (_res_node_num + _sup_node_num * _sup_node_num));
1098 1098
      int next_update_limit = global_update_freq;
1099 1099

	
1100 1100
      int relabel_cnt = 0;
1101 1101

	
1102 1102
      // Perform cost scaling phases
1103 1103
      std::vector<int> path;
0 comments (0 inline)