We introduce an innovative graph generation technique that strictly complies with predefined constraints. It revolutionizes the way of molecular structure design. Our method leverages reinforcement learning to incrementally build molecular graphs guided by user-specified rules. The process initiates with a single node and progressively adds new nodes and edges, making decisions based on the current state of the graph. Each step is informed by the reinforcement learning model, which has been trained to balance the intricate trade-offs between fulfilling the constraints and maintaining structural diversity. This ensures that the generated molecular structures are not only compliant with the specified rules but also exhibit a rich variety of forms. One of the significant advantages of our approach is its applicability in the field of chemical compound design. By enforcing specific constraints and rules during the graph generation process, our model can create molecular structures that meet precise requirements essential for various applications in chemistry and materials science.