Dear members of the group I hope this is the right place to as the following question! I am using the new function FindSpanningTree to find the a tree with minimum cost. This is,
dg = {0 -> 1, 3 -> 0, 1 -> 2, 0 -> 2, 0 -> 3, 2 -> 3};
dg1 = {0 <-> 1, 3 <-> 0, 1 <-> 2, 0 <-> 2, 0 <-> 3, 2 <-> 3};
Names1 = {Vs, c1, sw1, D1, R2, L};
g = Graph[Thread[Labeled[dg, Names1]], VertexLabels -> "Name"]
HighlightGraph[g,
EdgeList[FindSpanningTree[g, EdgeWeight -> {1, 2, 3, 4, 5, 6},
Method -> "MinimumCostAborescence"]]]
The result is
It seems to me that the function failed because the tree includes branch R2, with weight 5, instead of c1 with weight 2. Is this a bug or I am doing something wrong ? I have tried also undirected graphs but the obtained tree is not the minimum cost tree. As shown in the following figure. ![enter image description here](/c/portal/getImageAttachment?filename=Tree.png&userId=67240)
I will appreciate any help!
Jesus Rico-Melgoza