ABSTRACT With the growing interest in the railway sector, mainly because of energetic reasons, there is also a need to increase the efficiency of the railway lines. One way to optimize this sector is to improve quality in the train control process itself. Nowadays, train dispatching is still mostly done by human operators that use elementary tools and thereby solving conflicts sub-optimally. Motivated by these factors, this report presents a model capable of detecting and solving conflicts, for single track railways. More specifically, this model proposes two resolution methods: a heuristic resolution and a search for the optimal solution. To evaluate the quality of the developed model, several tests were made, obtaining encouraging results. These results showed that it is possible to solve conflicts optimally or near optimally, in a feasible amount of time. This program comes with a graphic interface so that the interaction with the dispatcher can be more user friendly. The major novelties of this work regard the improvement on the conflict detection process, the introduction of capacity conflicts, and the creation of several parameters to adjust the search for the optimal solution.