Solution (source code)

= Solution

For a distribution faithful to a <Directed acyclic graph>, the smallest Markov blanket of a vertex consists of

* its parents,
* its children, and
* every other parent of one of its children.

Conditioning on this set blocks every path from the vertex to all remaining vertices. Each listed neighbor is necessary under <faithfulness of a directed acyclic graph>: omitting a parent or child leaves its direct edge active, while omitting a child's other parent leaves the collider path through that conditioned child active. Faithfulness rules out accidental cancellations that could otherwise make a smaller blanket sufficient.