Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tss
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
Jakub Janák
tss
Commits
e51da794
Commit
e51da794
authored
4 months ago
by
Jakub Janák
Browse files
Options
Downloads
Patches
Plain Diff
unnecessary public methods changed to private
parent
fda0dc48
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+1
-0
1 addition, 0 deletions
CMakeLists.txt
controller/Controller.h
+6
-5
6 additions, 5 deletions
controller/Controller.h
graph/TSInstance.h
+13
-13
13 additions, 13 deletions
graph/TSInstance.h
with
20 additions
and
18 deletions
CMakeLists.txt
+
1
−
0
View file @
e51da794
...
...
@@ -83,6 +83,7 @@ add_executable(run_tests
controller/Controller.h
helper/Helper.cpp
helper/Helper.h
test/catch.hpp
)
# Link the test executable with Google Test, Graphviz, and Boost
...
...
This diff is collapsed.
Click to expand it.
controller/Controller.h
+
6
−
5
View file @
e51da794
...
...
@@ -13,13 +13,8 @@ class Controller {
std
::
deque
<
std
::
unique_ptr
<
TSInstance
>>
unsolvedInstances
;
boost
::
program_options
::
options_description
desc
=
{
"Arguments"
};
public
:
Controller
();
static
void
print_header
();
int
run
(
int
argc
,
char
*
argv
[]);
void
load_instance
(
const
std
::
string
&
file_name
);
void
auto_load_instances
();
...
...
@@ -29,6 +24,12 @@ public:
void
solve
(
int
num_of_threads
=
1
);
// not multithreaded by default
void
heuristic_combo
();
public
:
Controller
();
int
run
(
int
argc
,
char
*
argv
[]);
};
...
...
This diff is collapsed.
Click to expand it.
graph/TSInstance.h
+
13
−
13
View file @
e51da794
...
...
@@ -20,39 +20,39 @@ class TSInstance : public Graph {
std
::
vector
<
std
::
vector
<
Node
>
>
bestHamiltonianPaths
;
std
::
chrono
::
duration
<
long
long
,
std
::
ratio
<
1
,
1000000000
>
>
elapsed
{};
public
:
TSInstance
(
std
::
vector
<
std
::
shared_ptr
<
Node
>
>
nodes
,
std
::
vector
<
std
::
shared_ptr
<
Edge
>
>
edges
);
static
std
::
unique_ptr
<
TSInstance
>
create_synthetic_instance
(
int
numOfNodes
);
std
::
vector
<
std
::
vector
<
Node
>
>
solve
(
int
num_of_threads
=
1
);
// not multithreaded by default
void
branch
(
std
::
vector
<
Node
>
visitedNodes
,
double
cost
,
Node
&
currentNode
);
void
start_branch_parallel
(
const
std
::
vector
<
Node
>
&
visitedNodes
,
double
cost
,
Node
&
currentNode
,
int
numberOfThreads
);
void
branch_parallel
(
std
::
vector
<
Node
>
visitedNodes
,
double
cost
,
Node
&
currentNode
);
[[
nodiscard
]]
std
::
vector
<
std
::
vector
<
Node
>>
brute_force_solve
()
const
;
[[
nodiscard
]]
double
get_lower_bound
(
std
::
vector
<
Node
>
subPath
)
const
;
void
nearest_neighbour
(
std
::
vector
<
Node
>&
greedyPath
)
const
;
double
two_opt
(
std
::
vector
<
Node
>
greedyPath
);
[[
nodiscard
]]
double
heuristic_combo
();
[[
nodiscard
]]
double
get_min_cost
();
[[
nodiscard
]]
bool
is_solved
()
const
;
void
set_min_cost
(
double
minCost
);
void
clear_best_hams
();
void
add_best_hamiltonian
(
const
std
::
vector
<
Node
>
&
path
);
public
:
TSInstance
(
std
::
vector
<
std
::
shared_ptr
<
Node
>
>
nodes
,
std
::
vector
<
std
::
shared_ptr
<
Edge
>
>
edges
);
static
std
::
unique_ptr
<
TSInstance
>
create_synthetic_instance
(
int
numOfNodes
);
std
::
vector
<
std
::
vector
<
Node
>
>
solve
(
int
num_of_threads
=
1
);
// not multithreaded by default
[[
nodiscard
]]
std
::
vector
<
std
::
vector
<
Node
>>
brute_force_solve
()
const
;
[[
nodiscard
]]
double
heuristic_combo
();
[[
nodiscard
]]
bool
is_solved
()
const
;
void
print_statistics
()
const
;
void
save
(
const
std
::
string
&
fileName
)
const
;
...
...
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