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
Currently, the steiner_tree function reproduces the same behavior that it has for SimpleGraph where in that case, all vertices in the range 1:nv(steiner_tree(g,...)) remain. However, it may be that NamedGraphs should not have this behavior, and that only vertices which are reachable by traversing the Steiner tree should be included in the returned graph.
Here is a small code demonstrating the current behavior and output:
using Graphs: add_edge!, edges, nv, steiner_tree, vertices
using NamedGraphs
g = NamedGraph(["a","b","c"])
add_edge!(g,"a","c")
add_edge!(g,"a","b")
st = steiner_tree(g,["a","c"])
@show st
Output:
st = NamedGraph{String} with 3 vertices:
3-element NamedGraphs.OrderedDictionaries.OrderedIndices{String}
"a"
"b"
"c"
and 1 edge(s):
"a" => "c"
and one can confirm that in this case nv(st) == 3.
The text was updated successfully, but these errors were encountered:
Glad you agree. I was trying to write a patch, but you might know a more efficient way to do it since you know the internals better. Only thing I could get to work so far was just selectively calling rem_vertex! on the output before returning it.
Currently, the
steiner_tree
function reproduces the same behavior that it has forSimpleGraph
where in that case, all vertices in the range1:nv(steiner_tree(g,...))
remain. However, it may be that NamedGraphs should not have this behavior, and that only vertices which are reachable by traversing the Steiner tree should be included in the returned graph.Here is a small code demonstrating the current behavior and output:
Output:
and one can confirm that in this case
nv(st) == 3
.The text was updated successfully, but these errors were encountered: