Improving quality of graph partitioning using multilevel optimization