Say I have two integers $g$ and $M$. I have to construct the smallest bipartite graph $B_{n,n}$ on $2n$ vertices with $n$ vertices of each color so that the graph has genus $g$ and has exactly the given number of matchings $M$. My first question is whether for a genus $g$ and matching number $M$, is there a way to quickly check such a bipartite graph on $2n$ vertices exists? My second question is whether there is an algorithm to construct such a graph quickly is such a graph exists?