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
b946f0f4
Commit
b946f0f4
authored
May 09, 2016
by
Tiago Peixoto
Browse files
Fix bug in shortest_distance() with "directed" parameter
This fixes issue
#300
parent
0f5c6894
Pipeline
#179
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/topology/__init__.py
View file @
b946f0f4
...
...
@@ -1439,18 +1439,18 @@ def shortest_distance(g, source=None, target=None, weights=None,
if
source
is
not
None
:
pmap
=
g
.
copy_property
(
u
.
vertex_index
,
value_type
=
"int64_t"
)
libgraph_tool_topology
.
get_dists
(
g
.
_Graph__graph
,
libgraph_tool_topology
.
get_dists
(
u
.
_Graph__graph
,
int
(
source
),
target
,
_prop
(
"v"
,
g
,
dist_map
),
_prop
(
"e"
,
g
,
weights
),
_prop
(
"v"
,
g
,
pmap
),
_prop
(
"v"
,
u
,
dist_map
),
_prop
(
"e"
,
u
,
weights
),
_prop
(
"v"
,
u
,
pmap
),
float
(
max_dist
),
negative_weights
)
else
:
libgraph_tool_topology
.
get_all_dists
(
u
.
_Graph__graph
,
_prop
(
"v"
,
g
,
dist_map
),
_prop
(
"e"
,
g
,
weights
),
dense
)
_prop
(
"v"
,
u
,
dist_map
),
_prop
(
"e"
,
u
,
weights
),
dense
)
if
source
is
not
None
and
len
(
target
)
>
0
:
if
len
(
target
)
==
1
:
...
...
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