Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SWP Algorithmen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
goldman09
SWP Algorithmen
Commits
de5454e9
Commit
de5454e9
authored
11 months ago
by
goldman09
Browse files
Options
Downloads
Patches
Plain Diff
added toggle for comparision with suggested solution
parent
9f5a2be6
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
solver.cpp
+20
-16
20 additions, 16 deletions
solver.cpp
with
20 additions
and
16 deletions
solver.cpp
+
20
−
16
View file @
de5454e9
...
...
@@ -14,6 +14,7 @@ using namespace std;
int
current_best_budget
=
0
;
const
bool
verbose
=
false
;
const
bool
optimize
=
true
;
const
bool
compare_to_suggested_solution
=
false
;
void
calculate_augmentations
(
int
num_verts_bottom
,
int
top_vert_num
,
vector
<
vector
<
int
>>
adj_mat
,
vector
<
int
>&
l_most
,
vector
<
int
>&
r_most
,
vector
<
vector
<
int
>>&
r
,
vector
<
vector
<
int
>>&
p
)
{
...
...
@@ -722,6 +723,7 @@ int main(int argc, char* argv[]) {
cout
<<
"Number crossings in optimal solution: "
<<
max_crossings_k
-
opt
.
B
<<
"
\n
"
;
cout
<<
"Check result: Number crossings is "
<<
calculate_num_crossings
(
top
.
ans
,
crossing_mat
)
<<
".
\n
"
;
if
(
compare_to_suggested_solution
)
{
vector
<
int
>
suggested_permutation
;
ifstream
solfile
(
"test_sets/medium_test_set/solutions/1.sol"
);
if
(
solfile
.
is_open
())
{
...
...
@@ -741,6 +743,8 @@ int main(int argc, char* argv[]) {
}
cout
<<
"
\n
"
;
cout
<<
"Number crossings in suggested solution: "
<<
calculate_num_crossings
(
suggested_permutation
,
crossing_mat
)
<<
"
\n
"
;
}
ofstream
myfile
(
"solution.sol"
);
if
(
myfile
.
is_open
())
{
...
...
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