Search and reasoning can be seen as two basic mechanisms for problem solving. Compared with the former, reasoning focuses upon accumulating the changes step by step, to establish a feasible linkage between initial problem state and desired solutions. An algorithmic design grammar, proposed in a prior study, is proved to be a valid approach for layout generation, based on local reasoning which encodes the interactions between design and design contexts in the rules. However, due to the information incompleteness and design complexity, a reasoning can only ensure to be correct at the time while it may pose a threat to subsequent design actions so that it cannot satisfy other design requirements. As such, this study enhances design grammars with heuristics, a kind of search algorithm, which enables the compensation or correction for the prior bad decisions without degenerating the current design. A general perturbation strategy is presented as a logic guidance for the development of grammars, with two sets of rules separately specified for the improvement of adjacency and area satisfaction as case studies. The comparison between design grammars with and without perturbation rules illustrates significant contributions from the real-time perturbation heuristics. Finally, complex algorithmic patterns, as well as their applicability, are extracted for the reuse in other design problems.