[graph-tool] shortest_distance / concurrency / graph view

Tiago de Paula Peixoto tiago at skewed.de
Wed Oct 5 23:06:47 CEST 2016


On 04.10.2016 17:55, François Kawala wrote:
> Hello, 
> 
> I have a rather fuzzy question about the topology.shortest_distance
> function. I'll try to explain my problem as clearly as I can. If I fail to
> be clear enough, don't waste your time, just let me know.
> 
> I have a pool of workers using one single graph view instance, each work
> calls a function f described below. The graph view has an edge filter.
> 
>     def f(g, origin, targets_ids, weights):
>         d, p = topology.shortest_distance(g, source=origin,
>     target=targets_ids, weights=weights, pred_map=True)
>         i = score(d)
>         path = topology.shortest_path(g, source=origin,
>     target=targets_ids[i], pred_map=p)
> 
>         return path
> 
> 
> Once in a while, the path from function f is not consistant with the graph
> view (it goes through disabled edges). 
> 
> I tried to reproduce the error in a single thread environment. The exact
> same inputs do not fail as observed previously (ie. with multiple workers). 
> 
> It seems highly unlikely, but would it be possible for the predecessor map
> "p" to be overwritten by the actions of an another worker in the pool ? I'm
> asking because I ran out of ideas to explain this problem, although it
> sounds dumb. 

I don't see how that would happen, but without a complete (and minimal)
working example, it is not possible to say much.

Best,
Tiago


-- 
Tiago de Paula Peixoto <tiago at skewed.de>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <https://lists.skewed.de/pipermail/graph-tool/attachments/20161005/95b8a724/attachment.asc>


More information about the graph-tool mailing list