Use mathematical programming model to infer the structure of a small network given the degree sequence and the stationary states, which is NP-Complete problem. It is computationally expensive to find the exact solution and heuristics are suggested to obtain a good approximate solution.