Explanation of implementation of an algorithm for Dominating Set
This algorithm just tries every subset of the vertices and calculates whether it is a dominating set.  It tries the subsets in increasing order of size, and halts whenever it finds one.

Note that the running time is $O(2^n n)$ so it is exponential, and quite badly so.  There are faster algorithms that compute dominating sets in $O^*(1.7^n)$ or even $O^*(1.5^n)$ time, but I don't recall whether they are implementable.

By the way, dominating set, being W[2]-complete, is not expected to have an algorithm running in time $f(k) \cdot \text{poly}(n)$ for any function $f$ where $k$ is the size of a minimum dominating set.