Ruby graph processing for small graphs