<jats:title>Abstract</jats:title><jats:p>In this paper, we investigate application of mathematical optimization to construction of a cubature formula on Wiener space, which is a weak approximation method of stochastic differential equations introduced by Lyons and Victoir (Proc R Soc Lond A 460:169–198, 2004). After giving a brief review on the cubature theory on Wiener space, we show that a cubature formula of general dimension and degree can be obtained through a Monte Carlo sampling and linear programming. This paper also includes an extension of stochastic Tchakaloff’s theorem, which technically yields the proof of our primary result.</jats:p>