Message Boards Message Boards

0
|
2136 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

On FindSpanningTree

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 enter image description here 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

I will appreciate any help!

Jesus Rico-Melgoza

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract