The constraints satisfaction problem approach in the design of an architectural functional layout

A design support system with a new strategy for finding the optimal functional configurations of rooms for architectural layouts is presented. A set of configurations satisfying given constraints is generated and ranked according to multiple objectives. The method can be applied to problems in architectural practice, urban or graphic design—wherever allocation of related geometrical elements of known shape is optimized. Although the methodology is shown using simplified examples—a single story residential building with two apartments each having two rooms—the results resemble realistic functional layouts. One example of a practical size problem of a layout of three apartments with a total of 20 rooms is demonstrated, where the generated solution can be used as a base for a realistic architectural blueprint. The discretization of design space is discussed, followed by application of a backtrack search algorithm used for generating a set of potentially ‘good’ room configurations. Next the solutions are classified by a machine learning method (FFN) as ‘proper’ or ‘improper’ according to the internal communication criteria. Examples of interactive ranking of the ‘proper’ configurations according to multiple criteria and choosing ‘the best’ ones are presented. The proposed framework is general and universal—the criteria, parameters and weights can be individually defined by a user and the search algorithm can be adjusted to a specific problem.


What is architecture?
According to some estimates, there are approximately two thousand definitions of the term 'architecture' (Leśniakowska 1996). This alone shows that in this field there are some major difficulties with nomenclature and formalizations due to the enormous expressive power of the natural language, that can easily generate contradictions and paradoxes (Sowa 2008). Therefore the definitions used in this article are somewhat arbitrary.
The language of architecture is mostly visual-the most effective way to communication is by diagrams, plans, perspective drawings, elevation drawings, etc. An architectural design is usually not a linear procedure, but a sequence of gradual transitions using functional sketches, sketches of the intended appearance, functional layouts, detailed drafting and approval process to the issue of the drawings and documents. There are usually many feedbacks and reconsiderations before the final blueprints are produced, and there is rarely common satisfaction with the results. This situation may indicate any combination of the following possibilities: (1) In a general sense the problems that architectural design deals with are difficult and the known heuristics are not sufficient.
(2) The problems are not addressed properly.
(3) Whether it is true or not, considering the architectural design as a multi-objective optimization problem, an 'ideal' solution was not found. The ideal solution in this sense is the point in the objective space where co-ordinates have maximal (minimal) values of the objective functions. Often such a solution does not exist. In such a case it is necessary to make a choice among the permissible solutions which then becomes the so-called admissible solution.
In practice, this selection is another difficult problem, so the final decision is most often made arbitrarily.

What is a functional layout?
The following definition of a functional layout is assumed: A functional layout is a graphic representation of relationships among spaces of a building. Although the level of accuracy greatly varies, the sizes and dimensions of spaces (for example rooms) need to be represented with proper proportions, so the elements of a functional layout roughly correspond to the final architectural plan.
In most cases, the success of the final architectural design strongly depends on the proper solution of functional allocation of spaces considering their approximate sizes and relationships. Experience has shown also that the most effective strategy for the layout problem is the iterative approach (Liggett 2000). As mentioned above, although the architectural design is a complex process that in general cannot be linearized, it can be divided into independent stages ( Figure 1).
In the past the problem of creating an optimal functional layout was approached by computer science methods. The resulting schemes-although correct-lacked certain organizational, aesthetic, or identifiable characteristics (Terzidis 2006). The results of the method presented, although simplified, have topologies and geometries of realistic architectural designs. The design of the functional layout of the spaces in the architectural design of a building and industrial facilities has received a lot of attention in the fields of architecture and engineering. However, research results from those fields are seldom used in the other (Del Río-Cidoncha 2007).
Two types of constraints limit the number of possible solutions: project requirements and external limitations. The project requirements provide information regarding the sizes and relationships among the spaces. As an example, consider a simple apartment with a master bedroom, second bedroom, living room, kitchen, bathroom and WC. Additional requirements are for the kitchen to be adjacent to the living room, the bathroom to be adjacent to the master bedroom, the living room to face south and none of the bedrooms to face north. The latter conditions are an extension of the traditional adjacency diagram often used in the architectural practice (Mitchell 1990). The newly introduced elements are orientation and negative edges (forbidden adjacencies). These are the requirements that must be met.
The external limitations are certain additional geometrical constraints due to plot size and shape, building code requirements, daylight conditions and structural system requirements. These are the constraints that must not be violated and in the implemented algorithm they translated to so-called 'pruning functions'. Although the presented framework can be applied to a variety of 'layout' problems, further in the text the application is addressed specifically to single-storey residential buildings.
If the geometry of the layout is given and only the facility arrangement is to be optimized, the problem can be reduced to so-called 'facility layout optimization'. Heuristic methods such as genetic algorithms (Tam 1992), simulated annealing (Sharpe 1986), 'annealed neural network' (Yeh 2006) and tabu search strategies (including multi-searching tabu search strategy) (Liang 2008) have been successfully implemented for this kind of optimization.
However, in architectural practice such problems are in fact rare and almost always the purpose of the architectural layout optimization is to establish the layout geometry under several constraints.

The discretization of the space: a unit grid
Although theoretically rooms in a residential building can have seemingly any sizes (Michalek 2002), in fact almost always their sizes and proportions lie within a certain, surprisingly narrow range. For example, the room proportions almost always lie within 1-2 squares. Such practical knowledge can greatly reduce the search space and exclude a vast amount of practically unacceptable solutions. The use of various grid systems has a long history in all sorts of design: architectural, urban, engineering, graphic, etc. Specifically in the field of layout optimization, a grid is used in the quadratic assignment problem where the shape of a building is given on a coarse grid and space units are assigned to their corresponding locations while the space elements have relationships among each other. The relationships include topology and geometry and distinguish space layout planning from the classical linear assignment problem (Jo and Gero 1998). However, in the architectural functional layout problem usually additional constraints are given for the shapes of the spaces and the lot. Moreover, usually the outline of the building is not a priori given and designing the shape is the essence of architect's efforts. The studies of existing architectural layouts, specifically of multi-unit residential buildings lead to the following assumptions: Assumption 1: The functional layouts problems can be solved in a discrete space.
All of the investigated cases of floor plans of residential buildings could be schematically transcribed on to a very coarse square grid maintaining exactly all the relationships among spaces and approximately the room sizes and proportions. Fine-grid architectural plans, where the grid is usually of 1 cm, can be discretized into a much coarser grid maintaining the topological relationships as shown in example in Figure 2. The simplified graphical representation in the top right corner is a functional layout as defined above. The final architectural plan is far more complicated since it is subject to a number of additional constraints and requirements such as the construction system limiting the spans of the slabs, the placement of the load bearing members and the provision for services such as plumbing and HVAC. The type of the coarse grid, the sizes and proportions of spaces on the grid must be always determined according to the expert knowledge about certain type of building.
Assumption 2: Any functional layout can be transformed into the architectural plan.
In principle an architectural plan can be derived from a functional layout. There is a possibility that some functional layouts cannot be transformed into the architectural blueprints due to structural conflicts, but then some adjustments to the initial constraints in the algorithm must be made and process reiterated. All the dimensions of the functional layout that use a coarse single-unit grid must be interpreted and adjusted by a designer in order to become an architectural 'blueprint'.
Assumption 3: For a given type of functional layout, the number of size variations of the given rooms is small.
Although in architectural blueprints, the sizes of rooms on a 1 cm fine-grid vary greatly, after discretization into the functional grid (which uses an arbitrary unit, in this case it is the minimum clearance for a corridor; that is, between 1 and 1.5 metres), the number of possible sizes and proportions of rooms decreases considerably ( Figure 2).

Assumption 4: A combinatorial search is feasible in a functional design space.
All these observations lead to an assumption that by providing sufficient initial information regarding the room configuration and by applying an appropriate coarse gird system, the number of solutions decreases enough to apply a combinatorial search method. Assigning facilities to given shapes on grid was first formulated by Armour and Buffa in 1963 as a 'quadratic assignment problem' (QAP). Their work resulted in a computer program CRAFT (computerized relative allocation of facilities technique) (Buffa and Armour 1964) and later on, implementations of heuristic methods such as genetic algorithm were also successfully demonstrated (Liggett 2000, Jo andGero 1998). However, space planning problems are generally more complex than the quadratic assignment formulation due to the imposition of activity area requirements. Since areas required by activities are not necessarily equal, it is not always feasible to match activities and locations on a one-toone basis (Liggett 2000). In this article, unlike the classic QAP, all rooms are rectangular, have different predefined sizes and the outline of the building is not given. Because of these conditions the use of genetic algorithm could not be implemented and seems very difficult if possible at all. However, application of genetic algorithm for optimizing the topology of an architectural layout defined as finding of the best adjacencies between functional spaces among many possible ones under given constraints was demonstrated (Wong and Chan 2009).

The procedure
The procedure of ranking the room configurations according to the given criteria is a multi-step process: (1) The input of all possible information. This includes the desired geometrical properties of the rooms (number, sizes), daylight requirements, relationships between rooms (adjacencies, minimum and maximum distances between the given rooms) and the geometrical constraints (sizes) for the apartments.
(2) The generation of the configurations (potential solutions). For this constraint satisfaction problem (CSP) a depth-first backtrack search algorithm is applied. Only complete configurations are valid so that every configuration must contain all the rooms and none of the constraints can be violated. The algorithm is very sensitive to the initial data. Therefore, although the search is significantly constrained, the cordiality of the generated set of configurations sometimes is very large and sometimes is null. The procedure can be stopped after collecting any number of potential solutions, but ideally a full search should be performed in order to find the best one. From designer's perspective it is also desirable to have a choice among a number of solutions instead of getting a single mathematically optimal layout (Yeh 2009).
(3) Selection of the proper configurations from the potential solutions. Not all the initially generated configurations (potential solutions) are proper in the architectural sense. The classification criteria are explained further in text. Although the selection can be always made by a designer, in this article a machine learning method was applied for automation of this classification problem. (4) Final ranking of the proper functional layouts. Additional criteria can be applied for sorting of the solutions, for example: smallest perimeter of the whole layout, the size of the internal communication, a selected room being in a certain zone (for example, at the north facade). Some of these criteria could be included in the initial input for the configuration generation, but in design practice it is more natural to consider a wider range of possible solutions and filter them out according to additional criteria which are often variable. At this stage other kinds of knowledge can be used for ranking of the solutions. It is also possible that there are no solutions that meet both old and new requirements. However since it is an iterative process, adjustments to the initial input can be made and the whole process restarted.

Human knowledge and creativity
The most natural way of expressing the knowledge about design requirements are fuzzy terms and although algebraic operations can be performed on fuzzy numbers after defuzzification process (Kosiński and Weigl 1998), quantification of the knowledge by assigning numerical values to the satisfaction levels is still and probably will remain a major problem. Although the translation of knowledge into the algorithm is a separate problem which is not discussed in this article, formalization of the architectural layout optimization as discrete combinatorial optimization problem required expert knowledge from the field of architecture. The embedded in the algorithm knowledge on residential building contains setting the type of and size of grid and rooms' sizes and proportions on the grid. Moreover, the architectural knowledge is also included in the way the rooms are positioned in the process of generating the layout solutions-reflecting daylight and communication requirements from the building code. It also possible to adjust the algorithm to various kinds of expert knowledge regarding issues like energy conservation, passive solar and daylighting, structural grid, HVAC, plumbing, security etc. by formulating geometrical constraints. Although the presented procedure can be applied to a variety of layouts, the algorithm should be always adjusted for a specific problem, for example: residential, swimming pool, commercial, office building etc. The article focuses on demonstrating that this design support system can be used by an architect for realistic tasks and gives concrete results for specific problems.
It should not be forgotten that designing is a creative act and still remains a special human activity (Saridakis and Dentsoras 2008). Moreover, most of the time it is a pleasurable activity for the designer (Cross 1999). There are probably instances where performance of a room configuration cannot be enumerated, or when a number of different room configurations will perform equally according to the given criteria. However, the proposed framework is a practical tool that gives the designer a choice of solutions which meet their preferences and constraints which can be explicitly addressed and enumerated. The present authors do not deny the creative role of a designer and therefore do not claim that the proposed algorithm will handle all the layout problems by its own. The successful implementation of a tool does not mean replacing the user, but giving one new possibilities.

The initial input data
The initial data, provided by the user, contains the information about the number and sizes of the rooms and apartments. The information about a single room is a two-level list. The first sub-list is the general and constant description of the room-the apartment index, the room index, the room index to which it is adjacent and the daylight requirement. The second sub-list contains the information about the dimensions of the room (which may be exchanged by rotation of the room as explained further in the text): In the process of the layout optimization the value of the second sub-list may be reversed due to rotation of the room: A layout of an apartment or a whole building is uniquely represented as a list of such rooms. An example of a layout with two apartments each having two rooms is shown in Figure 3.

Further preparation of the input data: the rooms' permutations
The room configuration generating algorithm operates on a fixed list of rooms. The user gives more general information about rooms: sizes and proportions, therefore the algorithm must consider every permutation of the room sequence. The sequence of rooms' shapes within each apartment is permuted and combined with the other apartment as shown in Figure 4.   The total number of permutations in the apartment sequence can be expressed in the following way: where N A = the total number of apartments, N A > 1 N Ri = the number of rooms in the ith apartment.
The algorithm automatically rotates rectangular rooms in order to fit them in available space.

Finding potential solutions: the generation of the rooms' configurations as the constraint satisfaction problem (CSP)
Since the placement of the rooms is constrained to allowed locations, the design of a functional layout can be considered as a constraint satisfaction problem (CSP). For the layout optimization defined as partitioning of a rectangle, a number of programs based on CSP have been implemented in the past: LOOS/ABLOOS (Flemming et al. 1992), SEED (Flemming et al. 1994), HeGeL (Akin et al. 1992) and WRIGHT (Baykan 1991).
Although the housing styles vary greatly, there are always certain constraints for room locations. The reasons why formalization of these constraints is usually the most challenging task are: (1) At the communication level, transcribing expressed in natural language the expert knowledge of an architect and the client's requirements into numbers; implementing it into the algorithm is often difficult, perhaps sometimes even impossible.
(2) Since the number of generated solutions is sensitive to the given initial constraints, setting the constraints too 'loosely' results in astronomical numbers, while too 'tightly' leads to no solutions at all. (3) Setting the initial constraints too rigorously leads to omitting potentially very interesting and exceptional solutions which were not preconceived by the designer. (4) Some of the constraints, at least to some degree are contradictory.
The architectural knowledge about the design of most residential buildings can be expressed in the following principles and became geometrical constraints for the rooms' configurations, which have been implemented in the search algorithm: • Two rooms are adjacent if they share at least one unit segment of the wall so a door can be placed in order to connect these rooms. Therefore a corner-to-corner neighbourhood is not considered as adjacency. • The main rooms require daylight, therefore are located on the perimeter of the building (for example: living room, bedroom, study room). In this sense a building with atria has more than one perimeter. • The auxiliary rooms such as bathrooms, toilets and closets can be located inside the building, which are without access to daylight. • The main rooms of all the apartments constitute a chain; that is, one main room is adjacent to another main room and so forth. In this project gaps in the chain are not allowed (except between the very first and last rooms-to ensure that the main entrance can be realized). • The size of the building is limited (and given as an input).
• All the rooms are rectangular. Although it is a major limitation for the architectural creativity, in fact such a statement is true for the great majority of the building stock. However, an approach for solving layout problems not limited to the orthogonal space was also investigated (Bier et al. 2008, Damski andGero 1997). • The sizes of all rooms are required as an input.
• The sizes of all apartments are limited and given as an input.
• Any distance constraints for any two rooms can be given as an input.
• The corridors are not predefined since their shape is usually not important. Nevertheless, they are crucial for the layout but usually should be as small as possible.
Further constraints for the algorithm such as lot, apartments and room sizes, relative location of the rooms, preferences in certain room locations etc. are given by the user. Most of the knowledge is formalized into the logic statements in the pruning functions which impose geometrical constraints of the placement of rooms in the layout generation process. Although fuzzy logic seems more natural for expressing spatial (architectural) relationships (Changa 2009), since the search space is large, for computational efficiency bivalent logic was used in the algorithm. Most of the formalized architectural knowledge is specific to the type of building to be optimized.

The depth-first backtracking
The number of all possible room configurations grows very fast with the number and sizes of the rooms. The number of all positions of rooms on a grid so that the sequence is given and the next room always adheres to the previous one (like in a chain as shown in Figure 3) can be calculated with the formula below: where k = number of rooms Although corner-to-corner adjacency and overlapping of rooms are not accepted for a room layout, in this calculation they are also included. Moreover, every rectangular room can have two orientations as shown in Figure 5.
Therefore the number of possible configurations for a given sequence of rooms should be multiplied by 2 j where j is the number of all rectangular rooms in the layout. For this extremely simple example the final number of all possible geometrical arrangements is: This shows clearly that the use of brute force search methods for problems of realistic size in this method is not rational. Although the search tree grows geometrically in width, the depth of the tree is fixed and defined by the number of rooms. Since the width of the search tree is much larger than the depth, and only a room configuration containing all the rooms from the given list is valid, a depth-first backtracking search method was implemented. The algorithm adds the rooms from the input list one after another until all the rooms are placed successfully on a grid as shown in Figure 6.
Backtracking was already implemented in the rectangle partitioning for the unequal area layout problem in HeGel (Akin et al. 1992) and WRIGHT (Baykan 1991) programs. In this project backtracking is implemented in the following way: if a room cannot be added due to the violation of any constraint or pruning function, this branch of the search is abandoned, the position of the previous room is altered (translation or in case of rectangular room-rotation) and the procedure continues.
The algorithm takes the list of initial input values as in Figure 3, and additional parameters further constraining the search as shown and described in Table 1.   Additional three distance constraints: room 3 in relation to room 1 must not be closer than 1 unit and not farther than 2 units and so on.
The solutions are generated in the form of a list containing information for each room. Every room is uniquely encoded in a list of three sub-lists. The first one is the general description of the room provided as an input data; the apartment index, the room index, the room index to which it is adjacent and the daylight requirement. The second sub-list gives the x and y dimensions of the room which in case of rotation of a rectangular room will be the reverse of the original input data. The third sub-list gives the coordinates of the room's bottom left corner as shown and explained in Figure 7.
The additional parameters such as plot size and the apartments' sizes further limit the search space. Adjusting them takes some trials and practice. In this example, if the constraints are limited only to the sizes of the whole layout and apartments, the number of generated configurations is very large and most of them have inefficient communication manifested as clustering of rooms as shown in Figure 8.   The communication of the layout means creation of sub-corridors to each room within the apartments and main corridor connecting all the sub-corridors. If it is impossible to create the communication system for the given layout, or it becomes too large and/or complex, it is considered inefficient.
Further constraining of rooms' distances (for example, rooms 3 and 4 should always leave at least one unit of clearance from rooms 1 and 2) results in generation of much more useful configurations (Figure 9).
In this example there are 695 unique solutions generated. It is important that the algorithm does not produce redundant configurations; that is, any two solutions in which one, after rotation by π , is identical to the other one, are considered not unique. Some examples of the generated configurations are shown in Figure 10.
Out of a total of 695 generated configurations (potential solutions), 244 were proper (35%). The evaluation method is given in the next section.

Proper rooms configurations according to the communication criteria
Unlike the rooms, the corridors are not predefined because their shape is not important as long as the communication works, in other words it is possible to enter all the rooms as shown in Figure 11. If the shape is important, the corridor should be introduced as an additional room to the input data and specific adjacency relationships should be defined.
The classification of the proper rooms configurations is a fairly complex process and rather difficult to formalize. Even for a trained person it takes a while to decide whether a given configuration is proper or not. For this project the classification was based on the following requirements: • Every apartment must have an independent sub-corridor.
• The sub-corridors of the apartments must be communicated by the main corridor.
• All the communication must take not more than four units. • If possible, the main corridor should be larger than the sub-corridors.
• The size of the sub-corridor should be proportional to the size of the apartment.
An example of a proper room configuration that has efficient communication among improper potential solutions is shown in Figure 12.
If both the numbers of considered configurations and number of rooms in the layouts are small, this kind of evaluation can be done simply by looking at every layout. Unfortunately in more realistic cases, the number of rooms is in the range of dozens, while number of solutions is in the thousands and (much) more. Figure 10. Samples of generated configurations (potential solutions); the number of potential solutions for the given permutation of the initial sequence of rooms is given on the left.  The formalization of the communication criteria is rather difficult and its implementation as an additional constraint during the generation process seems problematic. Since a person evaluating a given configuration uses simultaneously a lot of geometrical information which seems difficult to implement as a procedural algorithm, a machine learning method was applied for automation of this process.

The application of a neural network for the classification of rooms' configurations
Although the number of solutions in the discussed example is not overwhelming and each of 695 configurations can be 'manually' inspected, an application of a feed forward network (FFN) was investigated. The FFN was chosen for the following reasons: • It is a classic supervised machine learning method.
• It is a common method for classification problems.
• It is always possible to determine whether a given configuration is proper or not.
• The evaluation criteria are difficult to formalize. • Theoretically it is always possible to give sufficient training data. In this case over 15 × 15 = 225 training vectors were required-622 were provided. • All the classes are equally represented by the data.
• All data samples are similar.
The original encoding was compressed by removing any redundant information, such as room and apartment number etc. as shown in Figure 13.
All the 695 potential solutions were transcribed into the 14 dimensional vectors as visualized in Figure 14. The first part of them became the training and the second part the validation data for the neural network.
A 14 input/1 output feed forward network (FFN) with one hidden layer with 14 neurons and activation function of sigmoid type was initialized. The training was done by the Levenberg-Marquardt algorithm with random initial weights in maximum 1000 iterations-the second terminating condition was when there was no change in five consecutive iterations of λ-which is the vector with one component describing the width of the basis function for each neuron. The training of the FNN in 10 trials expressed by root mean square deviation is shown in Figure 15.
Performance of FNN in 10 training trials is compared in Figure 16.     After applying a threshold function nearly 90% of validation samples were classified correctly by the best FFN of the 10 training trials. The detailed validation is shown in Figure 17.
In these examples the shapes and sizes of corridors are in fact very limited, namely to a minimal (unit) square {1, 1} and rectangles {2, 1} or {1, 2}. Hence they could be included as a 'room' for the configuration generation algorithm. Nevertheless, in more practical cases, where the variety of shapes and sizes of corridors is much larger than those of rooms, using them as a special class of rooms seems impractical. It is crucial that the classification method is accurate, whether 90% accuracy is sufficient or not is arguable. Although misclassification of an improper configuration as a proper one can be verified later, much more disadvantageous is an error when a proper configuration is overlooked and excluded.

Ranking the proper configurations according to additional criteria
The final selection of the proper configurations can be done by sorting them according to different parameters and values; for example, the length of the perimeter of a layout, the preference in the relative positions of given rooms, the size of the corridor, the geometrical complexity, etc. In architectural practice, however, usually not all of the client's requirements can be easily formalized and implemented. As an example, some configurations with various lengths of the layout perimeter are shown in Figure 18. The smaller the perimeter, the more compact is the layout. In practice, building compactness, expressed by the area to volume ratio is a very important factor in energy conservation (Smeds 2007).
Another practical criterion that can be easily implemented for layout ranking is the preferred location of given rooms; for example, room number 3 should be as close to the north-west (top left) corner as possible as shown in Figure 19.
One of the most intuitive criteria besides the overall perimeter of the building and certain rooms' locations is the size of the corridors. Figure 20 shows some configurations with the smallest possible corridors (only the apartments' corridors are shown, the main corridor is excluded).
Another highly intuitive criterion is the geometrical complexity of a layout which can be expressed by the total number of unique co-ordinates of all corners of each room. This means that if the corners of two rooms overlap, it is counted as one. The greater this number the more complex is the geometry of the layout (Figure 21).     It also seems rational to include the corridors in the complexity calculation. The same configurations are shown with corridors in Figure 22. The additional complexity of the corridor is expressed by the number of independent, that is not shared, vertices. Usually low geometrical complexity of the rooms causes high complexity of the corridors and vice versa.
The combination of both values, the complexity of rooms and the complexity of the corridors, gives a different sorting order. The values can be weighted for finer adjustments. Some examples of configurations where the sum of the room and corridor complexity equals 15 are shown in Figure 23.

Multi-objective optimization of a functional layout of rooms
The ranking of configurations according to multiple criteria can be considered as a multi-objective optimization problem: where m is the number of objectives, D is the feasible region in the decision space and μ 1 (x), . . . , μ m (x) are the co-ordinates of the image of x in the objective space.
As an example, the following objectives representing the practical knowledge are subject to optimization (minimization): (1) the overall geometrical complexity (including the corridors), (2) the size of a corridor and (3) the preference in the position of a given room-room no. 3 should be as far south as possible.
These parameters can be viewed as representing the designer's expert knowledge or client's preference and can be visualized in the 3D space by assigning each of them to an axis ( Figure 24). In practice, the decision as to which configuration is better than another is rather difficult because only some criteria can be precisely defined, but usually not all of them and so far, in practice, the final evaluation is most likely to be based on an arbitrary decision.
The simplest method is to combine all the objective functions by a weighted sum into a single aggregate objective function (AOF): where m is the number of objectives, F 1 , . . . , F m are the objective functions and w 1 , . . . , w m are the weights given to the objective functions. The advantage of using this method is that the influence of each objective function can be adjusted by a weight. However, when the number of objectives rises, the manual setting of the weights becomes very difficult (Messac 2000). The AOF combines the size of the corridor (2 ≤ n ≤ 4), the distance of room no. 3 from the southernmost edge of the layout (0 < n < 4) and the geometrical complexity of the configuration (15 ≤ n ≤ 19). The parameters were normalized. The histogram of optimization with all weights equal to 1 is shown in Figure 25.
In a real architectural problem, the weighting of the parameters is fairly difficult and requires a number of experiments. Moreover, the evaluation of a solution is even more ambiguous due to  the fact that the relative importance of the criteria is very difficult to estimate and it sometimes even changes during the decision-making process.
In this example all feasible solutions in the objective function space can be directly visualized in a 3-D space by assigning the three partial objective functions to three coordinates ( Figure 26).
The weight of the parameters of the AOF can be adjusted. An example is shown where the position of room no. 3 to the south has the highest priority ( Figure 27).

Application of the algorithm to a realistic layout problem
Although the concept was explained using a simplified model, the current algorithm works efficiently also on moderate-size realistic problems.
The computational scale of this problem is also worth mentioning. For an example of a building with three apartments, having eight, six and six rooms respectively, using the formula (2) multiplied by 2 15 , since there are 15 rectangular rooms which have two possible orientations, the number of all possible room positions in the given sequence on the grid is: 274957638029688176640000 × 2 15 (there are 15 rectangular rooms) ∼ 9.01 × 10 27 Despite the fact that this is 100 times more than the size the observable universe expressed in metres, after approximately 25 minutes on a single core 1.86 GHz computer, 24 potential solutions were generated as shown in Figure 28. In this case the initial data gave very constrained search space, which resulted in generation of only 24 configurations as shown in Figure 28. The selection of the 12 proper configurations was done by the authors and the final one was chosen according to the following criteria: (1) The largest apartment to be on the East.
(2) The smallest apartment to be on the North.
(3) The north facade to be simple (low geometrical complexity).
The finally selected configuration is shown in Figure 29.
This functional layout was adjusted by an architect according to several practical issues and was used as a floor plan for a project of a multi-family house as shown in Figure 30.
As mentioned before, the CSP search algorithm is sensitive to the constraints, therefore setting them is crucial and rather difficult. Despite the fact that at the current stage, the process of setting the parameters for the algorithm is difficult, and generating optimal solutions is rather time consuming, the results are finally acceptable from the architect's perspective. Figure 29. The solution of the functional layout optimization (on the left) and the architectural plan created on its basis (on the right).

Predicting the size of the search space
Since the search space tends to grow astronomically as shown in Section 3.4, it would be very desirable to estimate its size prior to the computation.
The numbers calculated by the formula (2) are discouragingly large and their practical usage is questionable since it allows overlapping of rooms and does not consider the constraints which greatly reduce the search space. However, for this algorithm there is actually no straightforward way of predicting either if the solution set is non-empty or what its cardinality is, without running an experiment. The preliminary evaluation whether the constraints are too tight-so there is no solution-can be done by checking if the adjacency matrix of the relationships gives a planar graph ( Figure 31).
Planarity is a necessary but insufficient condition for a solution to exist. Although the planarity can be checked by available algorithms, in case of non-planarity two problems occur-the crossing minimization on almost planar graphs (Hliněný and Salazar 2007) as well as the decision on which edge (relationship) should be removed.
Graph theory was already implemented for layout optimization of a rectangular plan in a commercial program FactoryOPT (Montreuil et al. 1993). However, in the presented approach the Figure 31. A graph representation of the relationships given for an example of a realistic layout problem has a planar embedding, therefore the solution may exist. Figure 32. Some examples of room adjacencies represented by a graph and all smallest possible functional layout realizations on a square grid. 'Holes' in the functional plan are not allowed (a hole should become an extra room of with 'hole' function); obviously a non-planar (K 5 ) graph cannot be realized as a functional layout, which by definition is represented in a 2-D plane.
outline of the building is not limited to a rectangle and there are many other geometrical constraints, thus the solutions (room configurations) cannot be derived directly from relationships given by a graph. The application of graph theory for the initial validation of whether the constraints are reasonable, and for the approximation of the size of the feasible search space, is currently under investigation ( Figure 32). Figure 30 shows an attempt to connect the abstract notion of a graph with a concrete geometry of an architectural layout. Building layouts have very rigid topological structure and notion of 'outside' and 'inside' as oppose to the dimensionless graphs which usually have a variety of embeddings. Finding the smallest possible functional realizations for a given relationships may help to predict the feasibility of the search, the size of the search space or be a starting point for the heuristic optimization.

Conclusions and future work
(1) The architectural design is a creative act, always to a certain degree arbitrary and intuitive.
The purpose of this project is to provide a method which as objectively and as flexibly as possible ranks all the proper configurations according to the criteria that can be formalized by the designer.
(2) The proposed framework is general and the aims, criteria, parameters, weights etc., can be customized.
(3) The algorithm should become more coherent and improved for performance, flexibility and interactivity. (4) The method of classifying the proper configurations should be improved. Perhaps the use of machine learning methods is not necessary or can be trained to give 100% accuracy. (5) The adjustment of the decision variables should be improved. Presently it is done by simple trial-and-error. (6) In this project all the relationships among the elements are limited to the 2-D horizontal plane.
Some problems in reality though include the third dimension (Bier et al. 2008). Nevertheless, although the physical space is 3-D, due to the anthropological nature of the architectural design the space in the most of the problems is strongly anisotropic. Changing the vertical co-ordinate (for example moving) is much more difficult and rare than any of the horizontal ones. Although in any multi-storey building there are elements of vertical transportation such as stairs, elevators, piping, etc., there is no need to generalize the problems to 3-D. The stepdown to the 2.5-D space seems rational and practical. For example, although a statement 'the kitchen is adjacent to the living room' can be realized by adjacency both on the horizontal plane and by placing one room over another, for occupants these are certainly two different kinds of adjacencies, especially for the elders. Nevertheless extending the problem to more than 2-D is necessary. (7) Implementing a solution space prediction algorithm is also necessary. As mentioned above it would be practical to know prior to the computation if there will at least be one solution produced for the given problem. (8) A study on grid systems for various types of buildings is under consideration. (9) A study on applying different types of knowledge in the algorithm is under consideration. (10) An integration of the algorithm with a CAD system is under consideration. (11) An implementation of fuzzy logic in the formulation of the layout parameters such as rooms' and apartments' sizes, the outline of a lot, adjacency relationships etc., and for the configuration classification algorithm (Hsu et al. 1999) is under consideration. At the present state the optimization is done in a few distinctive steps. Perhaps application of the fuzzy logic could unify or at least simplify the procedure (Xiong and Rao 2004).