On the optimization of bipartite secret sharing schemes