Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mincoverpetri
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dev
mincoverpetri
Commits
85a07a09
Commit
85a07a09
authored
Feb 08, 2018
by
Florent Jaillet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Performing acceleration only after checking domination to improve performance
parent
d660d507
Pipeline
#353
passed with stage
in 1 minute and 35 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
27 deletions
+37
-27
main.hpp
src/main.hpp
+1
-1
mincoversetcomputer.cpp
src/mincoversetcomputer.cpp
+24
-17
mincoversetcomputer.hpp
src/mincoversetcomputer.hpp
+10
-7
tests_main.cpp
tests/tests_main.cpp
+2
-2
No files found.
src/main.hpp
View file @
85a07a09
...
...
@@ -43,7 +43,7 @@
#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
...
...
src/mincoversetcomputer.cpp
View file @
85a07a09
...
...
@@ -92,28 +92,35 @@ void MinCoverSetComputer::monotone_pruning(const MonotonePruningParam& param) {
tmp_marking
.
add_omegaless_marking
(
mapping_diff_
[
candidate
.
ind_transition
]);
// NOTE: The following lines allow to choose between
// MinCoverSetComputer::accelerate() and OrderedTuples::accelerate()
// to perform the acceleration step. Note that both functions are not
// exactly equivalent (see the documentation of
// OrderedTuples::accelerate() for more details).
// Note also that neither of the two functions exactly implements the
// acceleration described in the reference paper, as the acceleration is
// done in-place here (see the documentation of
// MinCoverSetComputer::monotone_pruning() for more details).
if
(
param
.
use_orderedtuples_for_accelerate
)
{
p_curr_node_
->
mark_ancestors
();
ord_tuples_
.
accelerate
(
tmp_marking
);
}
else
{
accelerate
(
p_curr_node_
,
tmp_marking
);
}
++
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: 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
// MinCoverSetComputer::accelerate() and OrderedTuples::accelerate()
// to perform the acceleration step.
// Note that both functions are not exactly equivalent (see the
// documentation of OrderedTuples::accelerate() for more details).
// Note also that neither of the two functions exactly implements the
// acceleration described in the reference paper, as the acceleration
// is done in-place here (see the documentation of
// MinCoverSetComputer::monotone_pruning() for more details).
if
(
param
.
use_orderedtuples_for_accelerate
)
{
p_curr_node_
->
mark_ancestors
();
ord_tuples_
.
accelerate
(
tmp_marking
);
}
else
{
accelerate
(
p_curr_node_
,
tmp_marking
);
}
++
computation_stats_
.
nb_accelerated
;
// NOTE: In this implementation, a new node is created only when
// reaching the following line. Note that this differs from what is
// described in the reference paper (see the documentation of
...
...
src/mincoversetcomputer.hpp
View file @
85a07a09
...
...
@@ -256,13 +256,16 @@ private:
* \ref article "[Reynier]". The implementation differs from the
* algorithm in the article in two places:
* * The acceleration of the new omega-marking (cf. line 7 of algorithm
* 2 in \ref article "[Reynier]") is done in-place in this
* implementation, which can lead to some over-acceleration compared
* to the acceleration function described in the section 3.1 of
* \ref article "[Reynier]". 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.
* 2 in \ref article "[Reynier]") is only performed after
* checking the domination condition (cf. line 9 of algorithm 2 in
* \ref article "[Reynier]"). Furthermore, the acceleration of the
* new omega-marking is done in-place in this implementation, which
* can lead to some over-acceleration compared to the acceleration
* function described in the section 3.1 of \ref article "[Reynier]".
* 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
* nodes for each acceleration (cf. lines 7 and 8 of algorithm 2 in
* \ref article "[Reynier]"), but in the case where the condition
...
...
tests/tests_main.cpp
View file @
85a07a09
...
...
@@ -224,7 +224,7 @@ TEST_CASE("parse_args_and_compute()", "[main]") {
std
::
string
expected_stats_bfs
=
"Nb wait: 11
\n
"
"Nb accelerated:
10
\n
"
"Nb accelerated:
8
\n
"
"Nb nodes: 9
\n
"
"Nb min. cover. set: 6
\n
"
;
...
...
@@ -243,7 +243,7 @@ TEST_CASE("parse_args_and_compute()", "[main]") {
std
::
string
expected_stats_dfs
=
"Nb wait: 15
\n
"
"Nb accelerated: 1
5
\n
"
"Nb accelerated: 1
2
\n
"
"Nb nodes: 13
\n
"
"Nb min. cover. set: 6
\n
"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment