Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
daae776b
Commit
daae776b
authored
May 20, 2022
by
Tiago Peixoto
Browse files
shortest_distance(): fix 'return_reached' behavior
This fixes
#730
.
parent
4cce0696
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph/topology/graph_distance.cc
View file @
daae776b
...
...
@@ -84,9 +84,10 @@ public:
if
(
size_t
(
p
)
==
v
)
return
;
_dist_map
[
v
]
=
_dist_map
[
p
]
+
1
;
_reached
.
push_back
(
v
);
if
(
_dist_map
[
v
]
>
_max_dist
)
_unreached
.
push_back
(
v
);
else
_reached
.
push_back
(
v
);
if
(
v
==
_target
)
throw
stop_search
();
}
...
...
@@ -207,7 +208,8 @@ public:
{
if
(
_dist_map
[
u
]
>
_max_dist
)
_unreached
.
push_back
(
u
);
_reached
.
push_back
(
u
);
else
_reached
.
push_back
(
u
);
}
private:
...
...
@@ -261,7 +263,8 @@ public:
{
if
(
_dist_map
[
u
]
>
_max_dist
)
_unreached
.
push_back
(
u
);
_reached
.
push_back
(
u
);
else
_reached
.
push_back
(
u
);
}
private:
...
...
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