# Dominators when node not reachable

For the definition of domination [Wikipedia],

a node $$d$$ of a control-flow graph dominates a node $$n$$ if every path from the entry node to $$n$$ must go through $$d$$.

If node $$n$$ is not reachable from the entry node, why are all other nodes not dominators for it? There is no path from entry node that goes to $$n$$, and thus in particular

• there is no path from the entry node to $$n$$ that does not go through $$d$$.
• According to the definition you posted, all nodes (including the entry node and $n$ itself) are dominators of $n$ when there is no path from the entry node to $n$. However I'm not sure if in control flow-graphs you can have nodes that are not reachable from the entry node in the first place. Jul 4 at 22:46
• @Steven, I see. Perhaps for an arbitrary graph, it would be most reasonable to define dominators if some path exists. Jul 5 at 0:59
• I don't expect the definitions on Wikipedia to be very precise. According to the definitions here a node always dominates itself, moreover an immediate dominator of $N$ is ...the last dominator on all paths from entry to $N$'', which means that, for all nodes $N$ reachable from the entry node, the only immediate dominator of $N$ is $N$ itself. This is probably not what the author intended to define. Jul 5 at 10:19
• Huge thanks for your help @Steven! Aug 19 at 1:53