Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

European Journal of Operational Research 148 (2003) 672–686

www.elsevier.com/locate/dsw

O.R. Applications

Optimization of the keyboard arrangement problem using


an Ant Colony algorithm
Jan Eggers, Dominique Feillet *, Steffen Kehl, Marc Oliver Wagner,
Bernard Yannou
Laboratoire G
enie Industriel, Ecole Centrale Paris, Grande Voie des Vignes, 92295 Ch^
atenay-Malabry Cedex, France
Received 11 October 2001; accepted 7 June 2002

Abstract

In order to solve the problem of the arrangement of letters on a computer keyboard, an abstract representation of a
keyboard is introduced and an evaluation function taking account of ergonomic criteria is proposed. It results in a new
optimization problem that we name the keyboard arrangement problem. Based on the generic framework of Ant
Colony optimization, an algorithm is developed and applied to this problem. New effective keyboard arrangements are
deduced for several languages. Comparisons are made with standard manually optimized keyboards.
 2002 Elsevier Science B.V. All rights reserved.

Keywords: Ant Colony optimization; Keyboard arrangement

1. Introduction imposed the arrangement. Introduced by the


Sholes brothers in 1873, the keyboards using this
A computer user or typist is easily surprised arrangement have become known as Sholes or
when first looking at the seemingly arbitrary QWERTY keyboards. Initially designed in an
arrangement of letters on a standard computer Anglophone context, they were slightly rear-
keyboard. Neither does the arrangement have any ranged and thus adapted to other languages such
alphanumeric logical order nor is it optimized ac- as French and German. These counter-optimized
cording to a high hit rate or ergonomic comfort. keyboards were justified for some decades during
The keyboard was even optimized to slow down which mechanical problems remained in type-
typists to prevent the keys getting stuck. In fact, it writers. Rapidly it was not the case anymore but
is more the result of the historical development of despite some serious work to get optimized key-
the typewriter market and notably the achieved board arrangements (Dvorak in the USA and
dominance of the Remington II typewriter which Marsan in France), the QWERTY layout re-
mained the standard.
This fact might be partially explained by the
*
Corresponding author. Tel.: +33-1-41-131607; fax: +33-1-
drawbacks to a change in standard, which excludes
41-131272. repeated changes or changes with no guarantee of a
E-mail address: feillet@pl.ecp.fr (D. Feillet). prominent impact. As a matter of fact, ergonomic

0377-2217/03/$ - see front matter  2002 Elsevier Science B.V. All rights reserved.
doi:10.1016/S0377-2217(02)00489-7
J. Eggers et al. / European Journal of Operational Research 148 (2003) 672–686 673

research in the field of computer keyboards has so Most of the problems that have challenged
far not been able to supply a satisfying set of rules ACO algorithms so far distinguish themselves by
for the ergonomic evaluation of a keyboard ar- one characteristic feature—the objective function
rangement. The only rules one can hope for is easily calculated. Once a tour is chosen in the
therefore consist of a collection of heuristic rules TSP or an assignment established for the QAP, the
which derive from common sense and are verified calculation of the quality of the solution requires
by experimental studies. Especially, this is the case very little time. The calculation of the objective
of MarsanÕs ergonomic rules (1976) upon which function for the KAP, on the contrary, requires a
are based our ergonomic rules. significant amount of time. Besides the modeling
Several proposals for a keyboard arrangement of the KAP and the attempt to obtain optimized
optimizing a criterion such as typing speed or ra- keyboard arrangements, the aim of this paper is to
pid learning of the typing system were made (see evaluate the suitability of ACO algorithms for
Norman and Fisher, 1982). Furthermore, some such an optimization problem, involving a com-
papers (e.g., Pollatschek et al., 1975; Burkard and plex objective function. It furthermore establishes
Offermann, 1977) investigated more complex er- a new benchmark problem for comparing different
gonomic criteria, but did not insist on a realis- types of metaheuristic, such as genetic algorithms,
tic modeling nor an optimization method that simulated annealing or taboo search.
would have finely addressed the problem. Thus, It is worth mentioning that other research is
so far as we know, no paper has been devoted conducted concerning the arrangement of letters
to the optimization of a realistic keyboard ar- on a keyboard but in a different direction. Other
rangement taking account of precise ergonomic researchers consider the case of a keyboard where
criteria. the number of letters exceeds the number of avail-
In this paper, we describe the application of a able positions and the objective is to minimize the
standard Ant Colony optimization (ACO) algo- inherent ambiguity (see Glover, 1986 or Oommen
rithm to the problem of the arrangement of letters et al., 1992 for instance).
on a computer keyboard (KAP, for keyboard ar- The paper is organized as follows. In Section 2
rangement problem), using an evaluation function an abstract model of a keyboard is introduced,
based on a complex set of ergonomic criteria. Let which allows a representation of different types of
us mention that a complementary paper (Wagner keyboards, and the expression of heuristic ergo-
et al., 2001), designed from an ergonomic point of nomic criteria is presented. It results in the defi-
view, provides more extensive details on the defi- nition of the KAP. After a brief bibliographic
nition of ergonomic criteria, their respective im- review of ACO algorithms, Section 3 presents the
portance and the analysis of the results. solution algorithm. In Section 4 computational
ACO algorithms have been used to solve very results are given and the specificities of the algo-
different types of optimization problems. Among rithm as well as the quality of the obtained opti-
these problems are the traveling salesman problem mized keyboard arrangements commented on. The
(TSP), see, e.g., St€utzle and Dorigo (1999), the conclusion points out possible directions in which
quadratic assignment problem (QAP), e.g., Dorigo future research will be conducted.
et al. (1996), the sequential ordering problem
(Gambardella and Dorigo, 1997), the graph col-
oring problem (Costa and Hertz, 1997) and several 2. The keyboard arrangement problem
other combinatorial, static optimization problems
as well as dynamic ones which are primarily found In order to correctly define this problem, the
in the routing for telecommunication networks following approach is used. First, an abstract
(e.g., Di Caro and Dorigo, 1997, 1998). ACO al- model of a keyboard is proposed enabling the
gorithms have proven to be a powerful and easily representation of different types of keyboards.
adaptable tool which yields excellent results for Second, an evaluation function for the ergonomic
combinatorial problems. factors of a particular keyboard is defined. To this
674 J. Eggers et al. / European Journal of Operational Research 148 (2003) 672–686

aim we use a set of heuristic criteria issued from of sequences are enforced. For example, the capital
MarsanÕs work (1976, 1979, 1987) and that have letter ‘‘E’’ is composed by hitting the shift key and
been validated through heavy experiments carried the key which is used to produce the character ‘‘e’’.
out on both conventional and Marsan optimized ‘‘E’’ and ‘‘e’’ therefore form a set which is subse-
keyboards. More details concerning these heuristic quently called a combination character set (a table
criteria can be found in Wagner et al. (2001) and of the combination character sets may be found in
Kehl and Wagner (2000). Kehl and Wagner (2000)). It is the assignment of
these combination character sets to keys which is
2.1. Representation of a keyboard addressed in the definition of the KAP. Besides,
modifier keys as the shift keys have a physically
A keyboard basically serves to enter a string of fixed position. These choices are justified by the
characters into a computer by hitting a sequence of ergonomic rule which demands a rapid mastery of
keys. An abstract definition can therefore be the the standard typing system and then by consider-
following: a set of typeable characters and the ations of logical associations in terms of memori-
respective sequences of keys which enable their zation. An assignment of a combination character
construction. For instance, ‘‘E’’ is associated with set to a key is called an elementary assignment. A
the sequence of first hitting the ‘‘shift’’ key and solution is therefore given by a complete set of
then the key labeled ‘‘e’’. To this definition a elementary assignments, meaning that every com-
geometrical representation has to be added in or- bination character set is associated to a key.
der to locate every key on the keyboard. Since A supplementary important feature of the
most keyboards are arranged in rows and col- model is related to modifier keys as shift and to
umns, we propose to represent the geographic the ‘‘space’’ key. It is conventional to provide two
position of a key by: possibilities, that is two keys, for the hit of a shift.
In the same way, the usual space bar can be hit by
• a hand (left, right), any of the two thumbs and is represented in our
• a column (0–7 for the left hand and 0–8 for the model by two different keys, each one being asso-
right hand), ciated with one thumb. It introduces new difficul-
• a row (0–5, 0 standing for the top row and 3 for ties since a typist has to decide which one of the
the rest row). two keys he is going to use. We assume that some
deterministic decision rules are applied. A shift key
The above given number of columns and rows is struck with the opposite hand, compared to the
allows the representation of most of the presently hand that strikes the following key. The space key
available keyboards, notably the QWERTY key- is struck by the opposite hand, compared to the
board and its German and French equivalents hand that strikes the previous key.
as well as the Marsan keyboard. In addition, the An example for the transcription of the stan-
following rule was used which is true for the dard French AZERTY keyboard to the proposed
standard typing systems on all presently available model is given in Fig. 1.
keyboards: A given column is always hit by the
same finger. Since conventional keyboards dispose 2.2. Ergonomic criteria
of a home row which determines the location of
the fingers in a relaxed position, this row serves as A keyboard design should seek to attain four
a reference row for calculations in optimization main objectives:
considerations.
Without any supplementary condition, there is • allow typing a text without fatigue,
an infinite number of possible layout solutions, • maximize typing speed,
any sequence of keys being a candidate for a letter. • reduce the number of typing errors,
In order to simplify the problem by reducing the • allow rapid mastery of the touch typing
size of the solution space, the size and the structure method.
J. Eggers et al. / European Journal of Operational Research 148 (2003) 672–686 675

Fig. 1. Representation of the AZERTY keyboard.

As already pointed out, these objectives cannot criteria. These criteria were first established by
be easily translated into mathematical criteria Marsan (1976, 1987), but modified in Kehl and
which could serve for an evaluation of a given Wagner (2000). They are supported by sets of rules
keyboard. Indeed, a basic difficulty can be en- established in Norman and Fisher (1982) and
countered in the different types of fatigue and their Burkard and Offermann (1977). The rules will not
potential pathological nature. Short-term fatigue be explained in depth nor will a justification be
reduces typing speed but does not present a danger given (see Kehl and Wagner, 2000 for details). For
to the writerÕs health whereas long-term fatigue a given keyboard arrangement, a score is associ-
might lead to repetitive stress disorders. A second ated with each criterion and a global score is
uncertainty lies in the localization of fatigue. Since computed by a simple weighted linear combination
typing requires movements of fingers, arms and of the six scores.
shoulders and since those movements are pro- Since the rules form two major groups, the
duced by a combination of actions of muscles, notion of mono- and digraphs has to be intro-
joints and tendons it is difficult to quantify fatigue. duced. A monograph is an isolated key which is
This justifies the need of heuristic criteria, intro- struck in the process of typing a text. A digraph is
duced in the following section. a sequence of two consecutive keys hit in the
process of typing a text. This idea allows the dis-
2.3. The evaluation function tinction between rules that concern the absolute
position of a given key and the relative position
In order to evaluate the quality of the arrange- of two consecutive keys. Using a given keyboard
ment of a keyboard, we use a set of six heuristic layout, any text may be decomposed into a
676 J. Eggers et al. / European Journal of Operational Research 148 (2003) 672–686

sequence of keys which have to be struck in order


to type the text. This sequence may be seen as
a sequence of monographs or a sequence of di-
graphs. It may therefore serve to establish a sta-
tistic of the appearance of mono- and digraphs.
Subsequently, fmi and fdi stand for appearance
frequencies of the monograph mi and the digraph
di , respectively, for a given keyboard layout and a
given text. These frequencies serve as data for the
evaluation of the heuristic criteria which are de-
fined now. For each of these criteria, we shortly
Fig. 2. Ideal load distribution for the right hand.
describe the ergonomic rules that support it and
we formulate the equation that provides the score
of a keyboard arrangement regarding this criteria.
This ideal load distribution is given in Fig. 2 for
the right hand. It presents the nine columns as-
2.3.1. Accessibility and load
signed to the different fingers, starting on the left
The combination character sets should be dis-
with one column for the thumb, two columns for
tributed on the keys in a way that the total load is
the forefinger, a column for the middle and ring
shared adequately by all fingers. The fact that
finger respectively and four columns for the little
some keys are less accessible than others has to be
finger. The third row represents the home row and
taken into account. So as to evaluate a score, an
the height of the bars the ideal hit load normalized
optimal distribution of the hit load has to be de-
to have a maximum of 10,000.
fined for each key position. In a first step, a value
The score evaluates the variance of the load
is assigned to each hand representing a possible
distribution on a keyboard from the ideal distri-
difference in their performance and endurance.
bution and is given by the following equation
Since the two ergonomists we consulted did not
X
agree on giving the right hand an advantage over v1 ¼ ðfmi  fmopt Þ2 ð1Þ
i
the left hand, the ratio is chosen to be 50% for each mi 2Nm
1
hand. Each column then receives a ratio which
takes into account the relative agility and endur- where Nm1 is the set of all monographs.
ance of the fingers and each row receives a ratio
representing the relative accessibility of that row 2.3.2. Key number
(see Table 1). The optimal load distribution fmiopt is In order to minimize the total hit load, the
then calculated by multiplying the three corre- number of hits necessary to compose a given text
sponding ratios for each key. has to be minimized. The score v2 is therefore
calculated by dividing the number of characters in
a text by the number of keystrokes necessary to
Table 1 produce the text. While it is relatively important
Ideal load distribution for the most general definition, this score does not
No. Row (%) Column (%) vary between the different solutions of the KAP.
0 10.87 15.38 This is due to the enforcement of the structure of
1 13.04 10.26 the sequences used to obtain the characters, which
2 15.22 15.38
fixes the number of necessary keys. It should
3 43.48 23.08
4 10.87 17.95 nevertheless be mentioned that the keyboard which
5 6.52 6.41 allows the highest productivity in terms of words
6 5.13 per minute, the so-called chord keyboard, requires
7 3.85 significantly more hits than a standard keyboard
8 2.56
(see Alden et al., 1972).
J. Eggers et al. / European Journal of Operational Research 148 (2003) 672–686 677

2.3.3. Hand alternation Table 2


The fastest and most comfortable typing is as- Big step coefficients
sured when consecutive keys are not hit by the Thumb Forefinger Middle Ring Little
same hand. In order to quantify the hand alter- finger finger finger
nation rule, we sum the frequency of the digraphs Thumb 0 0 0 0 0
Forefinger 0 0 5 8 6
which are typed by fingers of the same hand. In
Middle finger 0 5 0 9 7
terms of mathematical formulation the score is Ring finger 0 8 9 0 10
calculated as follows: Little finger 0 6 7 10 0
X
v3 ¼ fdi ð2Þ
di 2Nd3

where Nd3 is the set of all digraphs which are typed representing the thumb and 5 the little finger (2–3,
by fingers of the same hand. 2–5, 3–5, 2–4, 3–4, 4–5).
X
2.3.4. Consecutive usage of the same finger v5 ¼ jðdi Þfdi ð5Þ
di 2Nd5
The preceding alternation rule is also true for
the fingers. Two consecutive keys should not be hit where jðdi Þ is the weight coefficient. The chosen
by the same finger. The criterion is calculated by heuristic values for jðdi Þ ¼ jðu; vÞ are represented
summing the frequencies of the corresponding in Table 2, u and v representing the first and sec-
digraphs and multiplying each of them with a ond finger respectively.
distance coefficient. The greater the distance, the
more inconvenience for a consecutive usage. The 2.3.6. Hit direction
relevant set Nd4 is therefore the set of digraphs For digraphs typed by one hand only, the pre-
which are typed using the same finger of one hand. ferred hit direction is from the little finger towards
The equation derived is: the thumb. This is the natural finger movement for
X most people, which may easily be verified by tap-
v4 ¼ fdi distðdi Þ ð3Þ
ping on the table according to the two possible
di 2Nd4
directions. Nd6 is therefore the set of all digraphs
The chosen distance function is the so-called which are produced by using one hand only and
Manhattan distance given by: whose hit direction is not the preferred one. The
distðdi Þ ¼ jc2  c1 j þ jr2  r1 j ð4Þ score is given by:
where c2 and c1 are the respective columns of the X
v6 ¼ fdi ð6Þ
two keys which establish the digraph and r2 and r1
di 2Nd6
the corresponding rows.

2.3.5. Avoid big steps 2.3.7. Global score


When one hand is used for two consecutive hits, To define a global score, which allows a direct
great distances which require awkward hand pos- comparison with any other keyboard arrange-
tures should be avoided. This is the case for keys ment, the scores vj ð1 6 j 6 6Þ are combined lin-
whose vertical distance is greater or equal to one. early. Actually, since these scores have different
The relevant set Nd5 is therefore the set of digraphs ranges and units and since they have different
which are typed using the same hand, but not the relative importances, they are first divided by the
same finger, and the vertical distance between the respective scores of a reference keyboard vj;ref .
two keys is greater than or equal to one row. A Once the scores are turned dimensionless they are
weight coefficient depending on the two fingers multiplied by a relative weight coefficient cj and
used is assigned to each digraph. The coefficient summed. The values of cj are represented in Table
increases with the following pairs of fingers, 1 3. These values were obtained with the help of two
678 J. Eggers et al. / European Journal of Operational Research 148 (2003) 672–686

Table 3 letters to distribute. In order to do so, it starts


Weight coefficients cj with an empty keyboard, i.e. a keyboard whose
Rule cj keys are available to be assigned to any combi-
Load and accessibility 0.45 nation character set. Subsequently, the combina-
Key number 0.5 tion character sets which correspond to the letters
Hand alternation 1.0
in the string are assigned to the keys on the key-
Consecutive usage of the same finger 0.8
Avoid steps 0.7 board in a random manner, but taking successful
Hit direction 0.6 placements in the past into account and respecting
the ergonomic rules established in Section 2.3 as
much as possible. Therefore the pheromone matrix
specialized ergonomists, using a pairwise compar- acts as an abstract memory by indicating all
ison method (see Limayem and Yannou, 2002). pheromone levels that link a key to a combination
This leads to the final formula: character set. Once every ant has assigned all com-
bination character sets to a key, a cycle is finished
X6
vj and the keyboards are evaluated. The ants leave
V ¼ cj ð7Þ
v pheromone on the elementary assignments which
j¼1 j;ref
are part of its solution. The amount of pheromone
that defines the evaluation of a keyboard for the that each ant deposits is proportional to the qual-
KAP. The lower the score, the better the keyboard ity of its solution. The pheromone is then partially
arrangement. evaporated, the keyboards are cleared and the
ants restart the search process with new charac-
ter strings until a predefined stopping criterion
3. An ACO algorithm for the KAP is met.
The a priori interest of a such approach for
Ant Colony algorithms are now classical ap- the KAP, compared to other metaheuristic ap-
proaches for solving combinatorial optimization proaches, relies on the complexity of the evalua-
problems, that were first introduced by Dorigo tion of a key board arrangement. The important
et al. (1991). Their fundamental idea is based on point is that this computation first requires the
the behavior of natural ants who succeed in finding computation of the mono- and digraph statistic,
the shortest paths from their nest to food sources which depends of the solution. With the ACO
by communicating via a collective memory which approach, when an ant arranges letters on a key-
consists of pheromone trails. Due to its weak board, it simultaneously computes the statistic,
global perception of its environment, an ant moves which permits a fast evaluation of the solution at
essentially at random when no pheromone is pre- the end of the cycle. This particularity and the
sent. However, it tends to follow a path with a successful application of ACO algorithms to sev-
high pheromone level when many ants move in a eral different optimization problems, especially the
common area, which leads to an autocatalytic QAP that offers many similarities with the KAP,
process. Finally, the ant does not choose its di- finally led to the conclusion that their potential to
rection based exclusively on the level of phero- solve the KAP might exceed the potential of other
mone, but also takes the proximity of the nest and approaches.
of the food source respectively into account. This
allows the discovery of new and potentially shorter 3.1. Principles of the algorithm
paths.
Applied to the keyboard assignment problem, Since the appearance of the first ACO algo-
the algorithm can be defined as follows: A colony rithm, many approaches have been proposed to
consists of N ants. Each ant is a simple agent that enhance its efficiency. Our algorithm presents a
arranges the combination character sets on its combination of some of these approaches. As a
own keyboard starting from a specific string of basic framework, we use the Ant Colony System
J. Eggers et al. / European Journal of Operational Research 148 (2003) 672–686 679

algorithm described in Dorigo et al. (1999). The in an incomplete keyboard at the end of the con-
basic ideas of ASElite (Dorigo et al., 1991, 1996) are struction phase and prohibits a valid evaluation of
added by assigning more pheromone to the ant the quality of the keyboard. Due to their minor
that found the best solution during one cycle. importance, those sets are randomly assigned to
Thus, the importance of the best solution found the remaining keys.
is emphasized. MAX  MIN AS (St€ utzle and
Hoos, 1996) also contributes to the final algo- 3.2. Description of the algorithm
rithm, since a minimum and a maximum values
are defined for the pheromone level. Finally, From the principles mentioned above, the fol-
ASRank principle (Bullnheimer et al., 1997) is in- lowing algorithm has been deduced. It consists of
cluded by selecting the ants that are allowed to two parts. The first one is an initialization phase
update the pheromone according to the respective which creates the necessary data structure and sets
ranking of their solutions. The reader is referred to all parameters to their initial value. The second
the indicated papers for more details about these part is the iterative phase of the algorithm which is
basic features. repeated until a stopping criterion is satisfied. This
Beyond the mere choice of certain characteris- criterion is defined to be a predefined number of
tics of past algorithms, some other extensions are cycles.
included. In the literature, one idea, which seems
to have a promising impact on the characteristics
3.2.1. Initialization
of the algorithm, has been mentioned, but not yet
During the initialization phase, the following
thoroughly examined: A non-uniform initializa-
tasks are carried out:
tion of the pheromone levels. In the standard
version, the pheromone is initially distributed uni-
1. An Ant Colony of N agents is created.
formly over all possible elementary assignments.
2. A text source is defined.
However, since there are some interesting starting
3. An empty character string of fixed length l is as-
points for the search in the form of existing good
signed to each ant.
quality keyboard arrangements like the Dvorak or
4. An empty keyboard is assigned to each ant.
the Marsan keyboards, we have proposed to con-
5. A pheromone matrix is created and its elements
sider a non-uniform initialization of the phero-
are set to values that take an a priori knowledge
mone matrix. This distribution—first suggested in
of the solution in the form of high quality key-
Corne et al. (1999)—translates an a priori knowl-
board arrangements into account.
edge of the subspace in which the optimal solution
6. The algorithm parameters (see definitions later)
may be found. By attributing a higher pheromone
are initialized.
level to the elementary assignments defined by a
set of high quality keyboard arrangements than to
the rest of the elementary assignments, the con- 3.2.2. Iteration
centration of the search on the desired subspace The second part of the algorithm is repeated
may be implemented. The obvious drawback of until a certain number of iterations have been
this concentration is the fact that an optimal so- completed. The subsequent steps are:
lution outside the determined subspace is found
with a smaller probability than in the case of a 1. The keyboards assigned to the ants are emptied.
uniform initial pheromone distribution. 2. The strings assigned to the ants are initialized
A second noteworthy modification is related to using the text source.
the fact that it is impossible to guarantee that all 3. Each ant reads its string and produces a se-
the characters are present in the text string used by quence of combination character sets that it
a given ant to establish its keyboard. Indeed, some places on its keyboard until the end of the string
rarely used combination character sets are usually is reached. This procedure is described in detail
not attributed during a cycle. This possibly results in Section 3.2.3.
680 J. Eggers et al. / European Journal of Operational Research 148 (2003) 672–686

4. The remaining combination character sets are 8. The pheromone matrix is modified to fit the al-
randomly assigned to the remaining keys. lowed range [smin ; smax ].
5. Each ant evaluates the solution it has found.
6. The pheromone matrix s evaporates with a co- A representation of the algorithm in pseudocode is
efficient qall : given in Fig. 3.
s qall s ð8Þ
3.2.3. Character placement
7. A number p of the best solutions are selected The subsequent steps allow an ant to choose
and pheromone is updated according to their the most adequate key to place the combination
rank: The kth best ant, with 1 6 k 6 p, deposits character set i under consideration:
a quantity Ds qðkÞ of pheromone on each ele-
mentary assignment that it has chosen, where 1. The ant verifies if the combination character set
Ds represents a quantity of pheromone and has already been placed on the keyboard. If so,
the vector q is a measure of importance of the the ant skips the following steps and continues
best ants. with the next combination character set.

Fig. 3. Solution algorithm for the KAP.


J. Eggers et al. / European Journal of Operational Research 148 (2003) 672–686 681

2. For all free keys j, the ant calculates a probabil- smallest level of pheromone of the possible ele-
ity according to the random-proportional deci- mentary assignments of i. Furthermore, let dsi ¼
sion rule given in Eq. (9): si;max  si;min be their difference. For a scalar k 2
a b
½0; 1 , the k-branching factor factk ðiÞ is defined as
½sij ½gij the number of elementary assignments associat-
pij ¼ P a b
ð9Þ
k2X ½sik ½gik ing the combination character set i to a key j,
whose pheromone level satisfies the following equa-
where X is the set of not yet occupied keys and tion:
gij the global score calculated according to the
formula given in Section 2.3 when only the sij > kdsi þ si;min ð11Þ
present and the previously assigned keys are
Hence, the k-branching factor quantifies the num-
considered. It is worthwhile to note that the
ber of elementary assignments for a fixed combi-
score gij only requires a few calculations to be
nation character set i which have a significant
computed. a and b are two coefficients de-
chance of being chosen by an ant. Since this search
scribing the relative importance of experience
space description is limited to the combination
and locally good elementary assignment. The
character set i, another definition defining a global
ant uses the calculated probabilities to establish
indicator is necessary.
a random variable, according to which it de-
termines a key among those that are still free.
Definition 2. The mean k-branching factor is the
3. The ant places the combination character set on
arithmetic mean of the k-branching factors for all
the chosen key.
combination character sets i.
4. The ant evaporates pheromone on the elemen-
tary assignment found according to the follow- 1 X
ing equation: factk ¼ factk ðiÞ ð12Þ
N i2N c
sij q sij ð10Þ
ACO being an autocatalytic process, the k-branch-
q being the coefficient of evaporation. ing factor naturally decreases with time, which
basically meets the needs of the search activity. In
3.3. Indicator for the search activity the beginning, a relatively large space should be
searched whereas in the later stages of the search,
As stated before, ACO presents an example of the effective search space should be concentrated
an autocatalytic process. While the ants move in a around the optimal solution.
large part of the search space in the beginning, The evolution of the k-branching factor is clo-
they continually tend to concentrate on a subspace sely related to the value of all the parameters that
of smaller and smaller size. In order to describe the are defined within the algorithm. Actually, it
autocatalytic behavior and compare it to that ob- would be a valuable indicator for the adjustment
served when applying ACO to other combinatorial of these parameters, possibly in a dynamic fashion.
optimization problems, an indicator can be intro- For the time being, however, we simply use it to
duced. Such an indicator, the so-called k-branch- determine the size of the search space throughout
ing factor, was defined in Dorigo et al. (1991). It the resolution.
quantifies the effective size of the search space and
therefore the search activity itself. It is recalled in
the following definition: 4. Computational results

Definition 1. Let Nc be the set of all combination The experimental work consisted of three major
character sets and let Nt be the set of all keys. For phases. First, an efficient and effective parameter
i 2 Nc , let si;max ¼ maxfsij ; j 2 Nt g and si;min ¼ setting was determined. Then, the algorithm was
minfsij ; j 2 Nt g be respectively the greatest and the run several times using this setting with and
682 J. Eggers et al. / European Journal of Operational Research 148 (2003) 672–686

without initializing the pheromone matrix. Finally, significantly accelerate the convergence during the
the results and the developments of the k-branch- first few cycles, but does not enable to find better
ing factor were examined. solutions or to reach the chosen solutions with
notably more efficiency. Indeed, the pheromone
4.1. Parameters setting matrix converges towards a certain limit which
does not change much between runs and the total
It is known that the convergence depends number of iterations needed to reach the chosen
strongly on the parameters affecting the compu- solution is very large. By way of illustration, Fig. 6
tational formula (see Dorigo et al., 1991). In the gives a good idea on the convergence of the solu-
case of the presented algorithm, N, a, b, q, qall , Ds, tion.
smin , smax , p, l and q had to be determined. As a
starting point for a heuristic determination of 4.3. Evolution of the k-branching factor
the parameters, those used in Dorigo et al.
(1991) were chosen. Observing the development of As mentioned in Section 3.3, the k-branching
the pheromone matrix, the parameter settings factor is an adequate means to measure the de-
were adjusted experimentally. The best parameters velopment of the effective search space all through
found are summarized in Table 4. the solution. Fig. 4 describes its evolution, for
Since the objective is to find a nearly optimal different values of k. The asymptotic behavior
keyboard arrangement, the algorithm is not meant which is typical for autocatalytic processes can be
to be for repetitive use. Once a quasi-optimal so- observed. However, compared to the development
lution is found, the algorithm is not used any of the k-branching factor in a TSP application, as
more, the only apparent reuse being the applica- observed in Gambardella and Dorigo (1995), it
tion of the algorithm to other languages. We de- displays a much faster convergence and less regu-
termined values of the parameters that appear to larity in the early stages.
be efficient, in the sense that slight changes in some
parameters frequently led to a significant decrease 4.4. Optimized keyboard arrangement
of the solution quality. However, it has to be said
that a detailed statistical examination of different The best arrangement found for a French key-
parameter settings was left out. board with the algorithm is presented in Fig. 5. It
required about 2000 iterations which corresponds
4.2. Initialization of the pheromone matrix to about 14 hours on a 400 MHz PC. The source
for the text which is parsed during the algorithm is
The algorithm was launched with and without taken from the newspaper Le Monde. The devel-
an initialization of the pheromone matrix. A opment of the solution quality during the corre-
comparison showed that an initialization does sponding run is represented in Fig. 6. It leads to
the satisfactory global score of 0.487, with the
Table 4 AZERTY keyboard as a reference. It also leads to
Choice of optimization parameters a great improvement compared to the Marsan
N 30 keyboard and outperforms it for all of the pro-
q 0.98 posed evaluation criteria (see Table 5).
smin 0.09 The best keyboards produced by the algorithm
l 6000 always have the same main characteristics. They
k 3.0
have in common—though they were not identi-
qall 0.95
smax 1.0 cal—that all the vowels are struck by the same
q [1,0.5,0.2,0.1] hand and that no frequently used consonant is
b 3.0 found on that side of the keyboard. The relative
Ds 0.2 position of the vowels and the most frequently
p 4
used consonants are identical for most of the runs.
J. Eggers et al. / European Journal of Operational Research 148 (2003) 672–686 683

Fig. 4. Evolution of the k-branching factor—mean over 10 test runs.

Fig. 5. The optimized arrangement for the French language.

Table 5
Algorithm output and Marsan scores in comparison to AZ-
ERTY (French language)
Algorithm AZERTY Marsan
output
Load and accessibility 0.479 1 0.489
Hand alternation 0.673 1 0.687
Consecutive usage of 0.263 1 0.503
the same finger
Avoid big steps 0.222 1 0.315
Hit direction 0.373 1 0.454
Global score 0.487 1 0.568

Fig. 6. Evolution of the solution quality (French language).


Experiments were also carried out to find ar-
rangements of letters for a German and an English
This partitioning, also found when starting from keyboards. Text sources are then respectively Der
random pheromone matrices, is similar to those Spiegel and USA Today. The resulting layouts are
of Dvorak (in an English context) and Marsan presented in Figs. 7 and 8. It also brings out the
manually optimized keyboards, which is intellec- possibility of major improvements to standard
tually satisfactory. keyboards: The global score is 0.592 for the
684 J. Eggers et al. / European Journal of Operational Research 148 (2003) 672–686

Fig. 7. The optimized arrangement for the German language.

Fig. 8. The optimized arrangement for the English language.

German keyboard, with the QWERTZ keyboard on the standard keyboard layout, but requires an
as a reference, while it is 0.593 for the English one, ergonomic layout as presented in Fig. 9.
using the QWERTY keyboard as a reference.
Compared to the Dvorak manually optimized
English keyboard, whose global score is 0.61, we 5. Conclusions
only obtain a minor improvement. Note however
that these results are obtained with parameters In this paper, a new optimization problem that
adjusted to the French language. we call the KAP is addressed. It consists of finding
Let us also mention that all these arrangements the best possible arrangement of letters on a key-
require six rows and therefore cannot be mapped board. A generic modeling and a function are
proposed for the evaluation of a keyboard with
respect to a set of ergonomic rules.
The presented algorithm for the solution of the
KAP contains elements of several different ant op-
timization approaches found in the literature. The
computational experiments show that the algorithm
is effective in finding very good solutions. In par-
ticular, all known manually optimized keyboards
such as the Dvorak and the Marsan keyboard were
outranked. By the time being, no extensive field
trials have been performed to evaluate the benefits
that would yield these new keyboards, even if some
specialists of keyboard arrangements and users of
Marsan keyboards recognize the quality of our
results. The main reason is that it is still very dif-
ficult to evaluate the true advantages that would
provide a new keyboard.
Fig. 9. Ergonomic keyboard layout (with the English optimized Actually, the keyboards that we propose do not
solution). aim to become new reference keyboards in the
J. Eggers et al. / European Journal of Operational Research 148 (2003) 672–686 685

future. The reality of typewriting is far from being Di Caro, G., Dorigo, M., 1997. AntNet: A mobile agents
completely known and extensive studies have to be approach to adaptive routing. Technical Report 97-12,
IRIDIA, Universite Libre de Bruxelles.
performed by ergonomists to attain a deep un- Di Caro, G., Dorigo, M., 1998. AntNet: Distributed stimergetic
derstanding of the rules that should drive the ar- control for communication networks. Journal of Artificial
rangement of letters on a keyboard. However, this Intelligence Research (JAIR) 9, 317–365.
work provides them a valuable simulation tool and Corne, D., Dorigo, M., Glover, F., 1999. New Ideas in
proves the efficiency of modern optimization al- Optimization. McGraw-Hill, NY.
Costa, D., Hertz, A., 1997. Ants can colour graphs. Journal of
gorithms for this problem. Furthermore, it permits the Operational Research Society 48, 295–305.
or would permit to easily compute efficient key- Dorigo, M., Caro, G.D., Gambardella, L.M., 1999. Ant algo-
boards in different contexts, if needed. Examples rithms for discrete optimization. Artificial Life 5 (2), 137–172.
are keyboards for right-handed or left-handed Dorigo, M., Maniezzo, V., Colorni, A., 1991. Ant system: An
people, keyboards for multilingual usage or key- autocatalytic optimizing process. Technical Report 91-016,
Dipartimento di Elettronica e Informazione, Politechnico di
boards adapted to a specific purpose (with a re- Milano, Italy.
petitive use of some specific symbols). Dorigo, M., Maniezzo, V., Colorni, A., 1996. The ant system:
Furthermore, this paper demonstrates the suit- Optimization by a colony of cooperating agents. IEEE
ability of ant algorithms for problems such as the Transaction on Systems, Man and Cybernetics—Part B 26
KAP, for which the evaluation of a solution re- (1), 29–41.
Gambardella, L., Dorigo, M., 1997. HAS-SOP: A hybrid ant
quires a complex set of operations. The special system for the sequential ordering problem. Technical
feature of the algorithm is that the evaluation and Report 97-11, IDSIA, Lugano, CH.
the construction of a solution by an ant can be Gambardella, L.M., Dorigo, M., 1995. Ant-Q: A reinforcement
performed simultaneously. Hence, it gives an im- learning approach to the traveling salesman problem. In:
portant advantage compared to metaheuristics Proceedings of ML-95, Twelfth Intern. Conf. Machine
Learning. Morgan Kaufmann, pp. 252–260.
based on local search, for which the evaluation of Glover, D.E., 1986. Experimentation with an adaptive search
too many solutions would be detrimental. strategy for solving a keyboard design/configuration prob-
Finally, it is interesting to see that, although we lem. PhD thesis, University of Iowa.
have restricted ourselves to computer keyboards, Kehl, S., Wagner, M.O., 2000. Modelisation et optimisation de
our approach could easily be adapted to other la repartition des lettres sur un clavier dÕordinateur. Applied
scientific project, Laboratoire Productique Logistique, Ecole
kinds of keyboards, as the ones that are used for Centrale Paris.
industrial control. Limayem, F., Yannou, B., 2002. Le tri croise de Monte Carlo:
une bo^ıte a outils pour lÕaide a la decision cooperative. To
appear in Revue de CFAO et Informatique Graphique.
Acknowledgements Marsan, C., 1976. Perfectionnements aux claviers de machines a
ecrire et similaires. Brevet dÕinvention no. 76-23323, depose
This paper has benefitted from helpful com- le 30 juillet 1976 a lÕInstitut National de la Propriete
ments and suggestions by three anonymous refer- Industrielle, France.
Marsan, C., 1979. Demande de certificat dÕaddition no. 79-
ees, who are gratefully acknowledged.
01065, du 17 janvier 1979 portant sur le brevet no. 76-23323:
‘‘Perfectionnements aux claviers de machines a ecrire et
similaires’’, Institut National de la Propriete Industrielle,
References France.
Marsan, C., 1987. Claviers alphanumeriques ergonomiques
Alden, D.G., Daniels, R.W., Kanarick, A.F., 1972. Keyboard pour machines a ecrire et similaires. Brevet dÕinvention no.
design and operation: A review of the major issues. Human 87-03267, depose le 3 mars 1987 a lÕInstitut National de la
Factors 14 (4), 275–293. Propriete Industrielle, France.
Bullnheimer, B., Hartl, R.F., Strauß, C., 1997. A new rank Norman, D.A., Fisher, D., 1982. Why alphabetic keyboards are
based version of the ant system–a computational study. not easy to use: Keyboard layout doesnÕt much matter.
Technical Report POM-10/97, Institute of Management Human Factors 24 (5), 509–519.
Science, University of Vienna. Oommen, B.J., Valiveti, R., Zgierski, J.R., 1992. Correction to
Burkard, R., Offermann, J., 1977. Entwurf von Schreibmas- an adaptive learning solution to the keyboard optimization
chinentastaturen mittels quadratischer Zuordnungsprob- problem. IEEE Transactions on Systems, Man and Cyber-
leme. Zeitschrift f€
ur Operations Research 21, B121–B132. netics 22 (5), 1233–1243.
686 J. Eggers et al. / European Journal of Operational Research 148 (2003) 672–686

Pollatschek, M., Gershoni, M., Tadday, Y., 1975. Improving Department of Computer Science-Intellectics Group, Ger-
the Hebrew typewriter. Technical report, Haifa. many.
St€
utzle, T., Dorigo, M., 1999. ACO algorithms for the traveling Wagner, M., Yannou, B., Kehl, S., Feillet, D., Eggers, J., 2001.
salesman problem. Technical report, IRIDIA, Universite de Ergonomic modelling and optimization of the keyboard
Bruxelles, Belgium. arrangement with an ant colony optimization algorithm.
St€
utzle, T., Hoos, H.H., 1996. Improving the ant system: A Technical Report CER 01-02 A, Laboratoire Productique
detailed report of the MAX-MIN ant system. Technical Logistique, Ecole Centrale Paris. Available at <http://www.
Report AIDA-96-12, Technical University of Darmstadt, pl.ecp.fr/feillet>.

You might also like