Graph problems solver