Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. nx = 3; ny = 5; G = GridGraph[{nx, ny}];
  2. w = RandomInteger[{1, 6}, EdgeCount[G]];
  3. GG = Graph[EdgeList[G], EdgeWeight -> w, VertexLabels -> "Name",
  4. VertexLabelStyle -> Directive[Blue, Italic, 10],
  5. EdgeLabels -> "EdgeWeight",
  6. EdgeStyle -> Directive[Opacity[0.65`], Blue],
  7. EdgeLabelStyle -> Directive[Black, Italic, 10]] ;
  8. k = FindSpanningTree[GG];
  9. HighlightGraph[GG, k, GraphHighlightStyle -> "Thick"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement