Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mincoverpetri
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dev
mincoverpetri
Commits
85a07a09
There was a problem fetching the pipeline summary.
Commit
85a07a09
authored
7 years ago
by
Florent Jaillet
Browse files
Options
Downloads
Patches
Plain Diff
Performing acceleration only after checking domination to improve performance
parent
d660d507
Branches
master
Tags
v1.0.3
No related merge requests found
Pipeline
#
Changes
4
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/main.hpp
+1
-1
1 addition, 1 deletion
src/main.hpp
src/mincoversetcomputer.cpp
+24
-17
24 additions, 17 deletions
src/mincoversetcomputer.cpp
src/mincoversetcomputer.hpp
+10
-7
10 additions, 7 deletions
src/mincoversetcomputer.hpp
tests/tests_main.cpp
+2
-2
2 additions, 2 deletions
tests/tests_main.cpp
with
37 additions
and
27 deletions
src/main.hpp
+
1
−
1
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
...
...
This diff is collapsed.
Click to expand it.
src/mincoversetcomputer.cpp
+
24
−
17
View file @
85a07a09
...
...
@@ -92,14 +92,26 @@ void MinCoverSetComputer::monotone_pruning(const MonotonePruningParam& param) {
tmp_marking
.
add_omegaless_marking
(
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
// 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).
// 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
// 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
();
...
...
@@ -109,11 +121,6 @@ void MinCoverSetComputer::monotone_pruning(const MonotonePruningParam& param) {
}
++
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
// reaching the following line. Note that this differs from what is
// described in the reference paper (see the documentation of
...
...
This diff is collapsed.
Click to expand it.
src/mincoversetcomputer.hpp
+
10
−
7
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
...
...
This diff is collapsed.
Click to expand it.
tests/tests_main.cpp
+
2
−
2
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
"
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment