Definition 10.3.4. Child of a Root.
Given a rooted tree with root a child of is a vertex that is connected to by an edge of the tree. We refer to the root as the parent of each of its children.
Start
as the root. It is an example of what is called a decision tree.xxxxxxxxxx
edges=[(1, 2, 4), (2, 8, 4), (3, 8, 4), (4, 7, 5), (6, 8, 5), (1, 3, 6), (1, 7, 6), (4, 5, 6), (5, 10, 9), (2, 10, 7), (4, 6, 7), (2, 4, 8), (1,8, 9), (1, 9, 9), (5, 6, 9), (1, 10, 10), (2, 9, 10), (4, 9, 10), (5, 9, 10), (6, 9, 10)]
G=Graph(edges)
G.weighted(True)
G.graphplot(edge_labels=True,save_pos=True).show()
xxxxxxxxxx
from sage.graphs.spanning_tree import kruskal
E = kruskal(G, check=True);E
xxxxxxxxxx
T=Graph(E)
T.set_pos(G.get_pos())
T.graphplot(edge_labels=True).show()