protected List<RandomVariable> order(BayesianNetwork bn,
List<RandomVariable> vars)
{
// Note: Trivial Approach:
// For simplicity just return in the reverse order received,
// i.e. received will be the default topological order for
// the Bayesian Network and we want to ensure the network
// is iterated from bottom up to ensure when hidden variables
// are come across all the factors dependent on them have
// been seen so far.
List<RandomVariable> order = new List<RandomVariable>(vars);
order.Reverse();
return order;
}