implement graph drawer for global DP