Graph flow problem solver implementation.