This paper focuses on the design problem of the interlocking program, which is the core part of computer interlocking system. The most essential problem of the interlocking program is analyzed. To apply the basic method of graph on this issue,the strict mathematical definition of some basic conception is given. Based on these, it is analyzed how to capture and release a node, and how to find a safe route. A new scheme of interlocking program is presented. The experiments on real data prove that the method presented is safe. And compared with the present interlocking system, the program based on the paper has many advantages,such as less data and better portability.