Maximum Weight Spanning Tree
Context
The Maximum Weight Spanning Tree learning algorithm is by far the quickest Unsupervised Structural Learning Algorithm. It only relies on two passes:
- The first pass consists of computing the a priori weights of all binary relationships between all variables.
- The second pass constructs the Maximum Weight Spanning Tree of those relationships.
While the resulting network may not be optimal, it can be useful for an initial imputation of values as part of a Missing Values Processing strategy. The Maximum Weight Spanning Tree learning algorithm can be used as a first network prior to using the Taboo or EQ algorithms. Furthermore, it is a practical basis for performing Variable Clustering. Internally, the Maximum Weight Spanning Tree initially produces an undirected network. To obtain a directed Bayesian network, BayesiaLab orients the arcs so that V-structures are avoided. However, the presence of Fixed Arcs can lead to the introduction of V-structures. An oriented tree with one root and no V-structures has a particularly simple factorization. Each node other than the root conditions on exactly one parent.
The following conditions apply to the Maximum Weight Spanning Tree:
- Fixed Arcs are not protected from deletion.
- Any constraints defined through Forbidden Arcs are respected.
- Temporal Indices are taken into account.
We use the terms Maximum Spanning Tree and Maximum Weight Spanning Tree interchangeably. Both refer to the same learning algorithm.
Usage
Open Menus > Learning > Unsupervised Structural Learning > Maximum Spanning Tree. Choose how BayesiaLab will score each pair of variables. Minimum Description Length weighs the improvement in fit against the cost of adding the relationship to the model. Pearson Correlation uses the strength of the pairwise correlation.

Leave Taboo unchecked to inspect the structure learned in the two passes. To refine that structure, enable Taboo under Post-Processing and set the Taboo List Size. The search can temporarily accept a worse score to explore other structures. Its final network can include nodes with more than one parent.
Compare the scoring methods and post-processing
The three runs below use the starting Body network from Taboo Learning. It contains 26 variables measured on 91 people, uses a Structural Coefficient of 0.5, and forbids incoming arcs to and . Reopen the same network before each run and use Delete All Arcs.
MDL
With Minimum Description Length, 23 of the 26 variables form one tree.
| Run | Arcs | Isolated nodes | Final MDL score |
|---|---|---|---|
| MDL | 22 | 3 | 6,187.433 |
| Pearson | 24 | 1 | 6,213.906 |
| MDL with Taboo | 26 | 3 | 6,089.978 |
The Console reports a final MDL score for all three networks, including the one learned with Pearson correlation. On this data set the Pearson tree connects more variables, while the MDL tree scores better under MDL. Taboo post-processing gives the lowest MDL score of the three.