Commit b946f0f4 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Fix bug in shortest_distance() with "directed" parameter

This fixes issue #300
parent 0f5c6894
Pipeline #179 failed with stage
...@@ -1439,18 +1439,18 @@ def shortest_distance(g, source=None, target=None, weights=None, ...@@ -1439,18 +1439,18 @@ def shortest_distance(g, source=None, target=None, weights=None,
if source is not None: if source is not None:
pmap = g.copy_property(u.vertex_index, value_type="int64_t") 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), int(source),
target, target,
_prop("v", g, dist_map), _prop("v", u, dist_map),
_prop("e", g, weights), _prop("e", u, weights),
_prop("v", g, pmap), _prop("v", u, pmap),
float(max_dist), float(max_dist),
negative_weights) negative_weights)
else: else:
libgraph_tool_topology.get_all_dists(u._Graph__graph, libgraph_tool_topology.get_all_dists(u._Graph__graph,
_prop("v", g, dist_map), _prop("v", u, dist_map),
_prop("e", g, weights), dense) _prop("e", u, weights), dense)
if source is not None and len(target) > 0: if source is not None and len(target) > 0:
if len(target) == 1: if len(target) == 1:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment