Skip to content
Snippets Groups Projects
Commit 85a07a09 authored by Florent Jaillet's avatar Florent Jaillet
Browse files

Performing acceleration only after checking domination to improve performance

parent d660d507
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#include "mincoversetcomputer.hpp" #include "mincoversetcomputer.hpp"
#define VERSION_NUMBER "1.0.2" ///< Version number of the application #define VERSION_NUMBER "1.0.3" ///< Version number of the application
/** /**
* \brief Set of flags parametrizing the output sent to stdout by the * \brief Set of flags parametrizing the output sent to stdout by the
......
...@@ -92,14 +92,26 @@ void MinCoverSetComputer::monotone_pruning(const MonotonePruningParam& param) { ...@@ -92,14 +92,26 @@ void MinCoverSetComputer::monotone_pruning(const MonotonePruningParam& param) {
tmp_marking.add_omegaless_marking( tmp_marking.add_omegaless_marking(
mapping_diff_[candidate.ind_transition]); mapping_diff_[candidate.ind_transition]);
param.bfs_traversal ? wait_.pop_front() : wait_.pop_back();
if (!(param.use_orderedtuples_for_is_dominated ?
ord_tuples_.is_dominated(tmp_marking) :
is_dominated(tmp_marking, p_root_))) {
// NOTE: To improve the processing speed of this implementation,
// the following acceleration is only done after checking the condition
// above.
// Note that this differs from what is described in the reference paper
// where the acceleration is systematically done before checking the
// condition.
// NOTE: The following lines allow to choose between // NOTE: The following lines allow to choose between
// MinCoverSetComputer::accelerate() and OrderedTuples::accelerate() // MinCoverSetComputer::accelerate() and OrderedTuples::accelerate()
// to perform the acceleration step. Note that both functions are not // to perform the acceleration step.
// exactly equivalent (see the documentation of // Note that both functions are not exactly equivalent (see the
// OrderedTuples::accelerate() for more details). // documentation of OrderedTuples::accelerate() for more details).
// Note also that neither of the two functions exactly implements the // Note also that neither of the two functions exactly implements the
// acceleration described in the reference paper, as the acceleration is // acceleration described in the reference paper, as the acceleration
// done in-place here (see the documentation of // is done in-place here (see the documentation of
// MinCoverSetComputer::monotone_pruning() for more details). // MinCoverSetComputer::monotone_pruning() for more details).
if (param.use_orderedtuples_for_accelerate) { if (param.use_orderedtuples_for_accelerate) {
p_curr_node_->mark_ancestors(); p_curr_node_->mark_ancestors();
...@@ -109,11 +121,6 @@ void MinCoverSetComputer::monotone_pruning(const MonotonePruningParam& param) { ...@@ -109,11 +121,6 @@ void MinCoverSetComputer::monotone_pruning(const MonotonePruningParam& param) {
} }
++computation_stats_.nb_accelerated; ++computation_stats_.nb_accelerated;
param.bfs_traversal ? wait_.pop_front() : wait_.pop_back();
if (!(param.use_orderedtuples_for_is_dominated ?
ord_tuples_.is_dominated(tmp_marking) :
is_dominated(tmp_marking, p_root_))) {
// NOTE: In this implementation, a new node is created only when // NOTE: In this implementation, a new node is created only when
// reaching the following line. Note that this differs from what is // reaching the following line. Note that this differs from what is
// described in the reference paper (see the documentation of // described in the reference paper (see the documentation of
......
...@@ -256,13 +256,16 @@ private: ...@@ -256,13 +256,16 @@ private:
* \ref article "[Reynier]". The implementation differs from the * \ref article "[Reynier]". The implementation differs from the
* algorithm in the article in two places: * algorithm in the article in two places:
* * The acceleration of the new omega-marking (cf. line 7 of algorithm * * The acceleration of the new omega-marking (cf. line 7 of algorithm
* 2 in \ref article "[Reynier]") is done in-place in this * 2 in \ref article "[Reynier]") is only performed after
* implementation, which can lead to some over-acceleration compared * checking the domination condition (cf. line 9 of algorithm 2 in
* to the acceleration function described in the section 3.1 of * \ref article "[Reynier]"). Furthermore, the acceleration of the
* \ref article "[Reynier]". This doesn't affect the validity of * new omega-marking is done in-place in this implementation, which
* the algorithm which still converges to the right solution. It can * can lead to some over-acceleration compared to the acceleration
* only in the best case reduce the number of iterations needed to * function described in the section 3.1 of \ref article "[Reynier]".
* reach the solution compared to the version in the paper. * This doesn't affect the validity of the algorithm which still
* converges to the right solution. It can only in the best case
* reduce the number of iterations needed to reach the solution
* compared to the version in the paper.
* * In the paper, a new node *n* is created and added to the set of * * In the paper, a new node *n* is created and added to the set of
* nodes for each acceleration (cf. lines 7 and 8 of algorithm 2 in * nodes for each acceleration (cf. lines 7 and 8 of algorithm 2 in
* \ref article "[Reynier]"), but in the case where the condition * \ref article "[Reynier]"), but in the case where the condition
......
...@@ -224,7 +224,7 @@ TEST_CASE("parse_args_and_compute()", "[main]") { ...@@ -224,7 +224,7 @@ TEST_CASE("parse_args_and_compute()", "[main]") {
std::string expected_stats_bfs = std::string expected_stats_bfs =
"Nb wait: 11\n" "Nb wait: 11\n"
"Nb accelerated: 10\n" "Nb accelerated: 8\n"
"Nb nodes: 9\n" "Nb nodes: 9\n"
"Nb min. cover. set: 6\n"; "Nb min. cover. set: 6\n";
...@@ -243,7 +243,7 @@ TEST_CASE("parse_args_and_compute()", "[main]") { ...@@ -243,7 +243,7 @@ TEST_CASE("parse_args_and_compute()", "[main]") {
std::string expected_stats_dfs = std::string expected_stats_dfs =
"Nb wait: 15\n" "Nb wait: 15\n"
"Nb accelerated: 15\n" "Nb accelerated: 12\n"
"Nb nodes: 13\n" "Nb nodes: 13\n"
"Nb min. cover. set: 6\n"; "Nb min. cover. set: 6\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment