Home > Keyboards > Keyboard Genetic Algorithm

Keyboard Genetic Algorithm

With help from Bilfo, I have designed a program in Ruby to score keyboard layouts, and a genetic algorithm program to determine the best layout. I got the idea from Michael Capewell who in turn got the idea from Peter Klausler. Unfortunately, because Ruby is a fairly high-level language, it takes a while to do things that could be done faster in Java or C.

I ran the program for 6 hours, and it generated this layout:

w f l m ; j p y , ‘
r s n t d h i o a e
z x c g v u b k . q

Through the scoring program, it got 6.3. However, Dvorak scores 5.8 on the genetic algorithm program. It has not yet generated a layout better than Dvorak.

Notes on the above layout:

The home row looks good. The 8 most common letters are on the home row, but e is on the pinky which is not good. I also notice that, like Dvorak, all the vowels are on one side of the keyboard. Other potential problems here are that C is on the bottom row, which some people like because it makes ctrl-c easy, but in terms of letter frequency it’s not the best spot. Also h and i are on the same finger, and hi is a pretty common digraph. Other than that, same-finger usage looks good.

Hmm, what is same finger usage? That is when the same finger is used twice in a row, like ed on QWERTY. It is a very bad thing, and slows down your typing a lot.

NOTICE: There is currently a small bug in the program which may cause a problem with scoring. The development team is working hard to fix it.

Advertisements
Categories: Keyboards
  1. June 30, 2014 at 4:44 pm

    Can I get a copy of your Ruby code for: Keyboard Genetic Algorithm?

    • June 30, 2014 at 5:49 pm

      I rewrote the program in C and it’s much faster and more fully-featured. The C version is available here.

      Do you still want the Ruby version? I’m not at my home computer so I can’t upload it right now.

      • June 30, 2014 at 11:09 pm

        I see that now… thanks. Further conversation on github…

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: