In this paper,a heterogeneous graph and deep reinforcement learning algorithmic architecture for the 2D rectangular nesting problem is designed and proposed in combination with the 2D rectangular nesting optimization problem with constraints on the mother plate of the part in production practice.Through the graph neural network and reinforcement learning algorithm,the features of the parts and motherboards in the nesting problem are highly integrated and learned,and the decision of the order and location of the parts is made,so that better computational results are obtained in a shorter time compared with the traditional opti-mization algorithms.Experiments have proved that the model trained by the deep reinforcement learning al-gorithm in this paper can get good nesting results in a shorter period of time,and the model trained based on a small-scale problem to solve larger-scale problem instances can also get better results,proving that the algorithm has a better generalization ability.