refactor algorithm dir struct
add route recording
add rspec unit testings in diagraph