I am trying to count the number of matchings in a complete bipartite graph (perfect as well as imperfect). It's relatively easy for me to convince myself that there is $n!$ perfect matchings in the graph $\mathcal{K}_{n,n}$. However, I cannot seem to figure out how many matchings this graph contains. I have experimented a bit, and the number seems to be very large. I have repeatedly solved the IP \begin{align} \min &\ \sum_{i=1}^n\sum_{j=1}^n x_{ij }\\ \mbox{s.t.:}\ & \sum_{i =1}^n x_{ij}=1,&&\forall j=1,\dots,n\\ \ & x_{ij}\in\{0,1\},&&\forall i,j=1,\dots,n \end{align} and then added ``no-good'' inequalities to remove the current solution until the solver (CPLEX) declared the problem infeasible. For $n=1,2,3,4$ I have gotten the numbers $1,4,27,256$ which suggests that the number of matchings should be $n^n$. But $n=5$ gave me $3174$ matchings (not the expected $5^5=3125$).
Can anyone guide me to the number of mathings in $\mathcal{K}_{n,n}$?
Edit: The no-good inequalities I use are the following \begin{equation} \sum_{(i,j):\bar{x}_{ij}=1}x_{ij}\leq n-1 \end{equation} where $\bar{x}$ is the solution I want to cut out.
It turns out that @Kuifje was right and that I had a bug in my code. After fixing that, I get that there is $n^n$ solutions to my IP.