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 was analyzed. To apply the basic method of graph on this issue, the strict mathematical definition of some basic conception was given. Based on these, it was analyzed that how to capture and release a node, and how to find a safe route. A new scheme of interlocking program was presented. At last, the experiments on real data proved 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.