Polynomial functions on Young diagrams arising from bipartite graphs