a network of nodes and edges wherein the nodes represent rooms and the edges represent walls dynamics of temperatures and humidity in the rooms and the temperature of the walls and the building are modeled using differential equations and the network the comfort of the occupants is modeled by a predicted mean vote the minimizing is formulated as an optimal control problem which is discretized using an integration technique to obtain a finite dimensional optimization problem then the finite dimensional optimization problem is solved using sparse linear algebra until convergence application_number US 201313903032 A description fig1 shows a floor plan for a building that can be used by embodiments of our invention the building includes rooms 10 and doors 12 each room is equipped with an indoor air conditioning unit 20 the indoor units are connected to an outdoor unit 26 a refrigerant is used for cooling or heating room air flows 22 to the indoor units from the outdoor unit the refrigerant flows dashed lines 24 from the indoor unit to the outdoor unit where the heat is dissipated and the refrigerant is recycled back to the indoor unit 22 fig2 a shows a numbering of nine rooms 30 in the building i e 1 to 9 the graph network representation in fig2 b based on this numbering nodes 40 represent the rooms in the building and edges 42 represent the rooms that share a wall fig3 a.