Travel cost of residence and jobs is important issue of compact city, which we have to consider from the viewpoint of sustainable society. In this paper, we propose a new calculation method of travel cost in the urban city by using Reformulation-Linearization Techniques (RLT) and Quadratic Programming Problem. This method enable us to minimize travel cost in consideration of constrained optimization distribution of residence and jobs and to analyze the characters of the total number of people and the number of working trip. Furthermore, in the analysis, we describe the possibility how this method adapt to the actual urban cities.