Dear Johan,
I write a simple optimal question, but the solution is not the optimal solution. In the COST matrix, the 22 is the lowest number. But in the solution, corresponding variable matrix(Pg_pieces) position is 0, obviously it is not the optimal solution.
The code are in the attachment. Thanks for your help!