Minimal version of Hama graph partitioning algorithm and related code