Frustration is a common emotion among regular bus users, as bus transport tends to be slow, inefficient, and inflexible. Typically, a bus service (i.e., a set of bus routes and timetables) remains the same throughout the day, even when the demand for bus transport varies considerably over time. The main reason for this inflexibility was that, until very recently, public bus operators had no way of knowing the demand for transportation at any given moment, and were therefore forced to use fixed bus schedules. This lack of knowledge is, however, likely to change with the advent of the "smart city". In the near future, sensors, mobile devices, and other smart city technology will empower public transport operators to roll out flexible bus services that respond to the actual demand for transportation, the current traffic conditions, etc. Also the on-line communication between potential passengers and bus operators, in both directions, will work smoothly. This increases the number of opportunities to improve and tailor the route, stops or timetable of a bus line, also during operations. The aim of this project is to develop the optimization models and algorithms to fully exploit these opportunities and to evaluate the added value of flexible services over conventional fixed-line fixedtimetable services. The goal is to obtain a flexible and demand oriented public transport system which is more efficient from an operator cost perspective and sustainable from a societal perspective.