Graph algorithms as a C extension to Ruby