Masters thesis - graph layout problem