Graph problems and dp