solve Graph theory