You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 21, 2021. It is now read-only.
I just started using Graphs.jl, but the definition of a distance matrix of a given graph g that is returned from the function distance_matrix(g, eweights) is quite unconventional and misleading. In the documentation of Graphs.jl, the distance matrix is defined as follows:
If u = v, then W[u,v]=0.
If u !=v and (u,v) belongs to the edge set of g, then W[u,v] = edge weight of (u,v).
Otherwise W[u,v] = Inf.
But normally, the definition of the distance matrix of g is:
If there is paths between u and v, then W[u, v] = the minimum among the sums of the edge weights of all the paths connecting between u and v (i.e., the length of the shortest path between u and v);
If there is no path between u and v, then W[u,v] = Inf.
Has someone implemented this correct version of the distance matrix using Graphs.jl functions?
Thanks!
BVPs
The text was updated successfully, but these errors were encountered:
Hi @BoundaryValueProblems, thanks for noting this. Adding subgraph methods might be related to this, which I'm interested in doing. Such as asking for the subgraph between 2+ nodes. This would then return all nodes and edges that connect the nodes, or just the short connectivity path, or maybe the lowest cost path (although not my direct use case). I'd think this requires similar code. Guess we'd have to explore all paths and pick the minimum cost, and then return that result.
Feel free to create a fork and branch from this repo with a suggestion of how you think we could fix this. I can help along the way. Or I can try do it while working on subgraphs aspect in future...
I just started using
Graphs.jl
, but the definition of a distance matrix of a given graphg
that is returned from the functiondistance_matrix(g, eweights)
is quite unconventional and misleading. In the documentation ofGraphs.jl
, the distance matrix is defined as follows:If
u = v
, thenW[u,v]=0
.If
u !=v
and(u,v)
belongs to the edge set ofg
, thenW[u,v] = edge weight of (u,v)
.Otherwise
W[u,v] = Inf
.But normally, the definition of the distance matrix of
g
is:If there is paths between
u
andv
, thenW[u, v]
= the minimum among the sums of the edge weights of all the paths connecting betweenu
andv
(i.e., the length of the shortest path betweenu
andv
);If there is no path between
u
andv
, thenW[u,v] = Inf
.Has someone implemented this correct version of the distance matrix using
Graphs.jl
functions?Thanks!
BVPs
The text was updated successfully, but these errors were encountered: