Here is the quick guide for adding a structure learner:
To add a parent iParent to node iAttribute, use
bayesNet.getParentSet(iAttribute).AddParent(iParent, instances) where
instances need to be passed for the parent set to derive properties of
the attribute.
Alternatively, implement public void search(BayesNet bayesNet, Instances instances). The implementation of buildStructure in the base class. This method is called by the SearchAlgorithm will call search after initializing parent sets and if the initAsNaiveBase flag is set, it will start with a naive Bayes network structure. After calling search in your custom class, it will add arrows if the markovBlanketClassifier flag is set to ensure all attributes are in the Markov blanket of the class node.
NB 1. do not use the -E option since that is reserved for the BayesNet class to distinguish the extra options for the SearchAlgorithm class and the Estimator class. If the -E option is used, it will not be passed to your SearchAlgorithm (and probably causes problems in the BayesNet class).
NB 2. make sure to process options of the parent class if any in the get/setOpions methods.