equal
deleted
inserted
replaced
120 |
120 |
121 private: |
121 private: |
122 |
122 |
123 // The maximum number of iterations for the first execution of the |
123 // The maximum number of iterations for the first execution of the |
124 // Bellman-Ford algorithm. It should be at least 2. |
124 // Bellman-Ford algorithm. It should be at least 2. |
125 static const int BF_FIRST_LIMIT = 2; |
125 static const int BF_FIRST_LIMIT = 2; |
126 // The iteration limit for the Bellman-Ford algorithm is multiplied |
126 // The iteration limit for the Bellman-Ford algorithm is multiplied |
127 // by BF_ALPHA in every round. |
127 // by BF_LIMIT_FACTOR/100 in every round. |
128 static const double BF_ALPHA = 1.5; |
128 static const int BF_LIMIT_FACTOR = 150; |
129 |
129 |
130 private: |
130 private: |
131 |
131 |
132 // The directed graph the algorithm runs on |
132 // The directed graph the algorithm runs on |
133 const Graph &_graph; |
133 const Graph &_graph; |
499 } |
499 } |
500 } |
500 } |
501 } |
501 } |
502 |
502 |
503 if (!cycle_found) |
503 if (!cycle_found) |
504 length_bound = int(length_bound * BF_ALPHA); |
504 length_bound = length_bound * BF_LIMIT_FACTOR / 100; |
505 } |
505 } |
506 } |
506 } |
507 } |
507 } |
508 |
508 |
509 /// \brief Executes the algorithm using \ref MinMeanCycle. |
509 /// \brief Executes the algorithm using \ref MinMeanCycle. |